/* ========================================
   OPITEFY TECHNOLOGY - COOKIE STYLES
   Estilos para Banner e Modal de Cookies
   ======================================== */

/* ── Map cookie vars to main design system ────────── */
:root {
  --color-bg:         var(--bg);
  --color-surface:    var(--surface2);
  --color-border:     var(--border);
  --color-text:       var(--text);
  --color-text-muted: var(--text2);
  --color-pink:       var(--teal);
  --color-pink-hover: var(--teal2);
}

/* ========================================
   COOKIE BANNER
   ======================================== */

.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: rgba(6, 8, 15, 0.96);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border-top: 1px solid var(--border);
    padding: 1.5rem;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), background 0.22s ease, border-color 0.22s ease;
}

[data-theme="light"] .cookie-banner {
    background: rgba(244, 245, 249, 0.97);
    border-top: 1px solid var(--border);
}

.cookie-banner.show {
    transform: translateY(0);
}

.cookie-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.cookie-banner-text h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--color-text);
}

.cookie-banner-text p {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

.cookie-banner-text a {
    color: var(--color-pink);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.cookie-banner-text a:hover {
    color: var(--color-pink-hover);
    text-decoration: underline;
}

.cookie-banner-actions {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* ========================================
   COOKIE BUTTONS
   ======================================== */

.cookie-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-family: inherit;
}

.cookie-btn-primary {
    background: var(--accent);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

.cookie-btn-primary:hover {
    background: var(--accent2);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4);
}

.cookie-btn-secondary {
    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.cookie-btn-secondary:hover {
    background: var(--color-bg);
    border-color: var(--color-pink);
}

.cookie-btn-settings {
    background: transparent;
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
}

.cookie-btn-settings:hover {
    color: var(--color-pink);
    border-color: var(--color-pink);
}

/* ========================================
   COOKIE MODAL
   ======================================== */

.cookie-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.cookie-modal.show {
    opacity: 1;
    pointer-events: all;
}

.cookie-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

[data-theme="light"] .cookie-modal-overlay {
    background: rgba(0, 0, 0, 0.6);
}

.cookie-modal-content {
    position: relative;
    background: var(--bg2);
    border: 1px solid var(--border2);
    border-radius: 16px;
    max-width: 650px;
    width: 90%;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transition: background 0.22s ease, border-color 0.22s ease;
}

.cookie-modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cookie-modal-header h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--color-text);
}

.cookie-modal-close {
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.cookie-modal-close:hover {
    background: var(--color-surface);
    color: var(--color-pink);
}

.cookie-modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

.cookie-modal-intro {
    color: var(--color-text-muted);
    line-height: 1.7;
    margin-bottom: 2rem;
}

.cookie-category {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.cookie-category:hover {
    border-color: rgba(124, 58, 237, 0.28);
}

.cookie-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.cookie-category-info h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    color: var(--color-text);
}

.cookie-category-info p {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    line-height: 1.6;
}

/* ========================================
   TOGGLE SWITCH
   ======================================== */

.cookie-toggle {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    flex-shrink: 0;
}

.cookie-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cookie-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--color-border);
    transition: all 0.3s ease;
    border-radius: 50px;
}

.cookie-toggle-slider::before {
    position: absolute;
    content: '';
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: var(--color-text-muted);
    transition: all 0.3s ease;
    border-radius: 50%;
}

.cookie-toggle input:checked + .cookie-toggle-slider {
    background: var(--color-pink);
    border-color: var(--color-pink);
}

.cookie-toggle input:checked + .cookie-toggle-slider::before {
    background: #ffffff;
    transform: translateX(24px);
}

.cookie-toggle input:disabled + .cookie-toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

.cookie-toggle input:disabled:checked + .cookie-toggle-slider {
    background: var(--color-text-muted);
    border-color: var(--color-text-muted);
}

.cookie-modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--color-border);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* ========================================
   CONFIRMATION TOAST
   ======================================== */

.cookie-confirmation {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 10001;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-left: 3px solid var(--color-pink);
    border-radius: 10px;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cookie-confirmation.show {
    transform: translateX(0);
}

.cookie-confirmation svg {
    color: var(--color-pink);
    flex-shrink: 0;
}

.cookie-confirmation span {
    font-weight: 600;
    color: var(--color-text);
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 968px) {
    .cookie-banner-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .cookie-banner-actions {
        width: 100%;
        flex-direction: column;
    }

    .cookie-btn {
        width: 100%;
        justify-content: center;
    }

    .cookie-modal-content {
        width: 95%;
        max-height: 90vh;
    }

    .cookie-modal-body {
        padding: 1.5rem;
    }

    .cookie-modal-header {
        padding: 1.25rem 1.5rem;
    }

    .cookie-modal-footer {
        padding: 1.25rem 1.5rem;
        flex-direction: column-reverse;
    }

    .cookie-modal-footer .cookie-btn {
        width: 100%;
    }

    .cookie-category-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .cookie-toggle {
        align-self: flex-end;
    }
}

@media (max-width: 600px) {
    .cookie-banner {
        padding: 1rem;
    }

    .cookie-banner-text h3 {
        font-size: 1.1rem;
    }

    .cookie-banner-text p {
        font-size: 0.9rem;
    }

    .cookie-confirmation {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
    }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    .cookie-banner,
    .cookie-modal,
    .cookie-confirmation {
        transition: none;
    }
}

/* Focus states */
.cookie-btn:focus-visible,
.cookie-toggle input:focus-visible + .cookie-toggle-slider,
.cookie-modal-close:focus-visible {
    outline: 2px solid var(--color-pink);
    outline-offset: 2px;
}
