/* ==============================================
   ALVIRAN COOKIE CONSENT - MODAL STYLE
   Version: 3.1.0
   ============================================== */

/* Overlay - Visual only, allows background scroll */
.alv-cookie-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 13, 25, 0.4);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1),
        visibility 0.4s;
}

.alv-cookie-overlay.show {
    opacity: 1;
    visibility: visible;
}

.alv-cookie-overlay.show .alv-cookie-modal {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

/* Modal Container */
.alv-cookie-modal {
    position: relative;
    max-width: 520px;
    width: 100%;
    background: linear-gradient(180deg, rgba(20, 18, 30, 0.98), rgba(15, 13, 25, 0.99));
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    padding: 2rem;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #F3F1FA;
    transform: translate3d(0, 30px, 0) scale(0.95);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
        opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

/* Gold accent line */
.alv-cookie-modal::before {
    content: "";
    position: absolute;
    top: 0;
    left: 2rem;
    right: 2rem;
    height: 2px;
    background: linear-gradient(90deg, transparent, #f9c86c, transparent);
    border-radius: 2px;
    opacity: 0.6;
}

/* Header */
.alv-cookie-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.alv-cookie-icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    background: linear-gradient(135deg, #f9c86c, #ffdca0);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 16px rgba(249, 200, 108, 0.3);
}

.alv-cookie-icon svg {
    width: 18px;
    height: 18px;
    color: #0f0d19;
}

.alv-cookie-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.35rem;
    color: #F3F1FA;
    margin: 0;
    letter-spacing: -0.02em;
}

/* Body */
.alv-cookie-body {
    margin-bottom: 1.5rem;
}

.alv-cookie-description {
    font-size: 0.95rem;
    line-height: 1.6;
    color: rgba(243, 241, 250, 0.8);
    margin: 0;
}

/* Footer */
.alv-cookie-footer {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.alv-cookie-actions {
    display: flex;
    gap: 0.75rem;
}

.alv-cookie-btn {
    flex: 1;
    padding: 0.9rem 1.25rem;
    border-radius: 12px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
    white-space: nowrap;
}

/* Primary Button - Gold (Accept All) - Now on LEFT */
.alv-cookie-btn-primary {
    background: linear-gradient(135deg, #f9c86c, #e5b45a);
    border: 1px solid rgba(249, 200, 108, 0.5);
    color: #0f0d19;
    box-shadow: 0 4px 16px rgba(249, 200, 108, 0.25),
        0 0 0 1px rgba(249, 200, 108, 0.1) inset;
}

.alv-cookie-btn-primary:hover {
    background: linear-gradient(135deg, #ffdca0, #f9c86c);
    border-color: rgba(249, 200, 108, 0.7);
    box-shadow: 0 6px 24px rgba(249, 200, 108, 0.35),
        0 0 0 1px rgba(249, 200, 108, 0.2) inset;
    transform: translateY(-2px);
}

/* Secondary Button (Essential Only) */
.alv-cookie-btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #F3F1FA;
}

.alv-cookie-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

/* Text Button (Save Preferences) */
.alv-cookie-btn-text {
    padding: 0.75rem;
    background: none;
    border: none;
    color: rgba(243, 241, 250, 0.6);
    font-size: 0.85rem;
    font-weight: 600;
    flex: initial;
}

.alv-cookie-btn-text:hover {
    color: rgba(249, 200, 108, 0.9);
    background: rgba(255, 255, 255, 0.03);
}

/* Cookie Settings Toggle (subtle, smaller link under buttons) */
.alv-cookie-settings-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.3rem;
    background: none;
    border: none;
    color: rgba(243, 241, 250, 0.3);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.7rem;
    font-weight: 400;
    cursor: pointer;
    transition: color 0.2s ease;
}

.alv-cookie-settings-toggle:hover {
    color: rgba(243, 241, 250, 0.5);
}

.alv-cookie-settings-toggle svg {
    width: 11px;
    height: 11px;
    transition: transform 0.3s ease;
}

.alv-cookie-settings-toggle[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

/* Categories (initially hidden) */
.alv-cookie-categories {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1),
        opacity 0.3s ease,
        margin 0.3s ease;
    margin-top: 0;
}

.alv-cookie-categories.show {
    max-height: 400px;
    opacity: 1;
    margin-top: 0.75rem;
}

.alv-cookie-category {
    display: block;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.alv-cookie-category:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
}

.alv-cookie-category.disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.alv-cookie-category.disabled:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
}

.alv-cookie-category-header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.alv-cookie-checkbox {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* Toggle Switch */
.alv-cookie-toggle {
    position: relative;
    width: 44px;
    min-width: 44px;
    height: 24px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    transition: background 0.3s ease;
}

.alv-cookie-toggle-slider {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.alv-cookie-checkbox:checked+.alv-cookie-toggle {
    background: linear-gradient(90deg, #f9c86c, #ffdca0);
}

.alv-cookie-checkbox:checked+.alv-cookie-toggle .alv-cookie-toggle-slider {
    transform: translateX(20px);
    background: #0f0d19;
}

.alv-cookie-checkbox:disabled+.alv-cookie-toggle {
    opacity: 0.6;
    background: #666;
}

.alv-cookie-category-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alv-cookie-category-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: #F3F1FA;
}

.alv-cookie-category-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    background: rgba(249, 200, 108, 0.15);
    color: #f9c86c;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.alv-cookie-category-desc {
    font-size: 0.8rem;
    line-height: 1.5;
    color: rgba(243, 241, 250, 0.6);
    margin: 0.5rem 0 0 0;
    padding-left: 3.5rem;
}

/* Meta info */
.alv-cookie-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding-top: 0.75rem;
    font-size: 0.75rem;
    color: rgba(243, 241, 250, 0.5);
}

.alv-cookie-meta svg {
    width: 12px;
    height: 12px;
    color: rgba(249, 200, 108, 0.7);
}

.alv-cookie-meta a {
    color: rgba(249, 200, 108, 0.8);
    text-decoration: none;
    font-weight: 600;
}

.alv-cookie-meta a:hover {
    color: #ffdca0;
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .alv-cookie-modal {
        padding: 1.5rem;
        border-radius: 16px;
        max-width: calc(100% - 2rem);
    }

    .alv-cookie-modal::before {
        left: 1.5rem;
        right: 1.5rem;
    }

    .alv-cookie-icon {
        width: 28px;
        height: 28px;
    }

    .alv-cookie-icon svg {
        width: 16px;
        height: 16px;
    }

    .alv-cookie-title {
        font-size: 1.15rem;
    }

    .alv-cookie-description {
        font-size: 0.88rem;
    }

    .alv-cookie-category {
        padding: 0.85rem;
    }

    .alv-cookie-category-name {
        font-size: 0.88rem;
    }

    .alv-cookie-category-desc {
        font-size: 0.76rem;
        padding-left: 3rem;
    }

    .alv-cookie-actions {
        flex-direction: column;
    }

    .alv-cookie-btn {
        padding: 0.8rem 1rem;
        font-size: 0.85rem;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {

    .alv-cookie-overlay,
    .alv-cookie-modal,
    .alv-cookie-category,
    .alv-cookie-btn,
    .alv-cookie-toggle,
    .alv-cookie-toggle-slider,
    .alv-cookie-categories,
    .alv-cookie-settings-toggle svg {
        transition: none !important;
    }
}

/* Scrollbar styling for modal */
.alv-cookie-modal::-webkit-scrollbar {
    width: 6px;
}

.alv-cookie-modal::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.alv-cookie-modal::-webkit-scrollbar-thumb {
    background: rgba(249, 200, 108, 0.3);
    border-radius: 3px;
}

.alv-cookie-modal::-webkit-scrollbar-thumb:hover {
    background: rgba(249, 200, 108, 0.5);
}