/**
 * Cookie Consent Modal Styles
 * Design: Figma Załoga Rave Design (nodes 444:884, 445:885)
 * 
 * Colors from Figma:
 * - Modal background: #1c1c1e
 * - Backdrop: #000000 @ 80%
 * - Title: #f4f4f4
 * - Description: #ffffff @ 65%
 * - Primary btn bg: #ffffff, text: #000000
 * - Secondary btn bg: #000000, text: #ffffff
 * - Border radius: 12-16px
 */

/* ===== Overlay / Backdrop ===== */
.cookie-consent-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 99999;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 50px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cookie-consent-overlay[hidden] {
    display: none;
}

.cookie-consent-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

/* ===== Modal Container ===== */
.cookie-consent-modal {
    background: #1c1c1e;
    border-radius: 16px;
    padding: 24px;
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    max-height: calc(100vh - 100px);
    max-height: calc(100dvh - 100px);
    overflow-y: auto;
}

.cookie-consent-overlay.is-visible .cookie-consent-modal {
    transform: translateY(0);
}

/* ===== Title ===== */
.cookie-consent-title {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro', 'Poppins', sans-serif;
    font-size: 24px;
    font-weight: 400;
    line-height: 1.2;
    color: #f4f4f4;
    margin: 0;
}

/* ===== Description ===== */
.cookie-consent-description {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro', 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 200;
    line-height: 20px;
    color: rgba(255, 255, 255, 0.65);
    margin: 0;
    padding-bottom: 0;
}

/* ===== Manage Link / Toggle ===== */
.cookie-consent-manage-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro', 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    color: #ffffff;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    text-align: left;
    transition: color 0.2s ease;
}

.cookie-consent-manage-link:hover,
.cookie-consent-manage-link:focus {
    color: rgba(255, 255, 255, 0.8);
    outline: none;
}

.cookie-consent-manage-link:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
    border-radius: 4px;
}

.cookie-consent-chevron {
    transition: transform 0.2s ease;
}

.cookie-consent-manage-link[aria-expanded="true"] .cookie-consent-chevron {
    transform: rotate(180deg);
}

/* ===== Settings Panel ===== */
.cookie-consent-settings {
    display: flex;
    flex-direction: column;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
    padding-top: 0;
    padding-bottom: 0;
}

.cookie-consent-settings.is-expanded {
    max-height: 500px;
    opacity: 1;
    padding-top: 8px;
}

.cookie-consent-settings[hidden] {
    display: none;
}

/* ===== Cookie Option Row ===== */
.cookie-consent-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cookie-consent-option--disabled {
    opacity: 0.7;
}

/* ===== Option Left (plus + text) ===== */
.cookie-consent-option-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* ===== Toggle Label (wraps only the checkbox) ===== */
.cookie-consent-toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
}

/* ===== Expandable Cookie Details ===== */

.cookie-consent-expand-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: none;
    border: 0;
    color: rgba(255, 255, 255, 0.6);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    padding: 0;
}

.cookie-consent-expand-btn:hover {
    color: #ffffff;
}

.cookie-consent-expand-btn[aria-expanded="true"] {
    transform: rotate(45deg);
}

.cookie-consent-details {
    padding: 8px 0 8px 28px;
    font-size: 12px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.5);
    animation: slideDown 0.2s ease;
}

.cookie-consent-details[hidden] {
    display: none;
}

.cookie-consent-option-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.cookie-consent-option-name {
    font-size: 16px;
    font-weight: 400;
    color: #f4f4f4;
}

.cookie-consent-option-desc {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

/* ===== Custom Checkbox ===== */
.cookie-consent-toggle input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.cookie-consent-checkbox {
    width: 44px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    position: relative;
    flex-shrink: 0;
    transition: background 0.2s ease;
}

.cookie-consent-checkbox::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #ffffff;
    border-radius: 50%;
    transition: transform 0.2s ease;
}

.cookie-consent-toggle input[type="checkbox"]:checked + .cookie-consent-checkbox {
    background: #34c759;
}

.cookie-consent-toggle input[type="checkbox"]:checked + .cookie-consent-checkbox::after {
    transform: translateX(20px);
}

.cookie-consent-checkbox--disabled {
    background: #34c759;
    opacity: 0.6;
}

.cookie-consent-checkbox--disabled::after {
    transform: translateX(20px);
}

.cookie-consent-toggle input[type="checkbox"]:focus-visible + .cookie-consent-checkbox {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

/* ===== Buttons ===== */
.cookie-consent-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cookie-consent-btn {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro', 'Poppins', sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 24px;
    padding: 11px 16px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.15s ease;
    text-align: center;
}

.cookie-consent-btn:hover {
    opacity: 0.9;
}

.cookie-consent-btn:active {
    transform: scale(0.98);
}

.cookie-consent-btn:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

/* Primary Button - White background */
.cookie-consent-btn--primary {
    background: #ffffff;
    color: #000000;
}

/* Secondary Button - Black background */
.cookie-consent-btn--secondary {
    background: #000000;
    color: #ffffff;
}

/* Save Button - Matches primary but slightly smaller */
.cookie-consent-btn--save {
    background: #ffffff;
    color: #000000;
    margin-top: 4px;
}

/* ===== Simple Mode Actions ===== */
#cookie-consent-simple-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#cookie-consent-simple-actions[hidden] {
    display: none;
}

/* ===== Advanced Mode Actions ===== */
.cookie-consent-advanced-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cookie-consent-advanced-actions[hidden] {
    display: none;
}


/* ===== Privacy Link ===== */
.cookie-consent-privacy-link {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: underline;
    text-underline-offset: 2px;
    text-align: center;
    transition: color 0.2s ease;
}

.cookie-consent-privacy-link:hover {
    color: rgba(255, 255, 255, 0.8);
}

/* ===== Mobile Styles (Bottom Sheet) ===== */
@media (max-width: 480px) {
    .cookie-consent-overlay {
        align-items: flex-end;
        justify-content: center;
        padding: 0;
    }
    
    .cookie-consent-modal {
        max-width: 100%;
        border-radius: 16px 16px 0 0;
        padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
        max-height: 90vh;
        max-height: 90dvh;
    }
    
    .cookie-consent-overlay.is-visible .cookie-consent-modal {
        transform: translateY(0);
    }
    
    /* Slide up animation for mobile */
    .cookie-consent-modal {
        transform: translateY(100%);
    }
}

/* ===== Desktop Styles ===== */
@media (min-width: 481px) {
    .cookie-consent-title {
        font-size: 28px;
    }
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
    .cookie-consent-overlay,
    .cookie-consent-modal,
    .cookie-consent-chevron,
    .cookie-consent-checkbox,
    .cookie-consent-checkbox::after,
    .cookie-consent-btn,
    .cookie-consent-settings {
        transition: none;
        animation: none;
    }
}

/* ===== Dark Mode Enhancement ===== */
@media (prefers-color-scheme: dark) {
    .cookie-consent-modal {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    }
}

/* ===== Light Mode (if needed) ===== */
@media (prefers-color-scheme: light) {
    .cookie-consent-modal {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    }
}

