/**
 * Cookie Consent Styles
 * Matches SiteSide dark teal theme with seafoam/lime accents
 *
 * Colors:
 * - Background: #0d1f1f (dark teal)
 * - Elevated: #142424 (elevated teal)
 * - Accent: #7fcc9e (seafoam green)
 * - Text: #ffffff (white) / #8fb3b3 (teal-tinted gray)
 * - Borders: #1f3636 (teal borders)
 */

/* ========================================
   COOKIE CONSENT BANNER
   ======================================== */

.cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #0d1f1f 0%, #0a1515 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(127, 204, 158, 0.2);
    padding: 1.5rem 2rem;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.5), 0 0 40px rgba(127, 204, 158, 0.1);
    z-index: 9999;
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.4s ease;
}

.cookie-consent-banner.show {
    transform: translateY(0);
    opacity: 1;
}

.cookie-banner-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.cookie-banner-text {
    flex: 1;
}

.cookie-banner-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 0.5rem 0;
}

.cookie-banner-description {
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: #8fb3b3;
    margin: 0;
    line-height: 1.6;
    max-width: 600px;
}

.cookie-banner-actions {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* ========================================
   BUTTONS
   ======================================== */

.cookie-btn {
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.cookie-btn:focus {
    outline: 2px solid #7fcc9e;
    outline-offset: 2px;
}

.cookie-btn:active {
    transform: scale(0.98);
}

/* Accept Button - Seafoam accent */
.cookie-btn-accept {
    background: linear-gradient(135deg, #7fcc9e 0%, #6bb88a 100%);
    color: #0d1f1f;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(127, 204, 158, 0.3);
}

.cookie-btn-accept:hover {
    box-shadow: 0 6px 30px rgba(127, 204, 158, 0.4);
    transform: translateY(-2px);
}

/* Reject Button - Subtle outline */
.cookie-btn-reject {
    background: transparent;
    color: #8fb3b3;
    border: 1px solid #2a4545;
}

.cookie-btn-reject:hover {
    background: rgba(127, 204, 158, 0.05);
    border-color: #7fcc9e;
    color: #ffffff;
}

/* Customize Button */
.cookie-btn-customize {
    background: rgba(127, 204, 158, 0.1);
    color: #7fcc9e;
    border: 1px solid rgba(127, 204, 158, 0.3);
}

.cookie-btn-customize:hover {
    background: rgba(127, 204, 158, 0.15);
    border-color: #7fcc9e;
    color: #ffffff;
}

/* Save Button */
.cookie-btn-save {
    background: linear-gradient(135deg, #7fcc9e 0%, #6bb88a 100%);
    color: #0d1f1f;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(127, 204, 158, 0.3);
}

.cookie-btn-save:hover {
    box-shadow: 0 6px 30px rgba(127, 204, 158, 0.4);
    transform: translateY(-2px);
}

/* ========================================
   PREFERENCES MODAL
   ======================================== */

.cookie-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cookie-modal.show {
    opacity: 1;
    visibility: visible;
}

.cookie-modal.show .cookie-modal-content {
    transform: scale(1);
    opacity: 1;
}

.cookie-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 21, 21, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.cookie-modal-content {
    position: relative;
    background: linear-gradient(135deg, #0d1f1f 0%, #0a1515 100%);
    border: 1px solid rgba(127, 204, 158, 0.2);
    border-radius: 16px;
    max-width: 700px;
    width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7),
                0 0 60px rgba(127, 204, 158, 0.15);
    transform: scale(0.9);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease;
}

/* ========================================
   MODAL HEADER
   ======================================== */

.cookie-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2rem 2rem 1.5rem;
    border-bottom: 1px solid #1f3636;
}

.cookie-modal-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
}

.cookie-modal-close {
    background: transparent;
    border: none;
    color: #8fb3b3;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.cookie-modal-close:hover {
    background: rgba(127, 204, 158, 0.1);
    color: #7fcc9e;
}

.cookie-modal-close:focus {
    outline: 2px solid #7fcc9e;
    outline-offset: 2px;
}

/* ========================================
   MODAL BODY
   ======================================== */

.cookie-modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

/* Custom scrollbar */
.cookie-modal-body::-webkit-scrollbar {
    width: 8px;
}

.cookie-modal-body::-webkit-scrollbar-track {
    background: rgba(127, 204, 158, 0.05);
    border-radius: 4px;
}

.cookie-modal-body::-webkit-scrollbar-thumb {
    background: rgba(127, 204, 158, 0.3);
    border-radius: 4px;
}

.cookie-modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(127, 204, 158, 0.5);
}

.cookie-modal-intro {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    color: #8fb3b3;
    line-height: 1.7;
    margin: 0 0 1.5rem 0;
}

/* ========================================
   COOKIE CATEGORIES
   ======================================== */

.cookie-categories {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.cookie-category {
    background: rgba(20, 36, 36, 0.5);
    border: 1px solid #1f3636;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.cookie-category:hover {
    background: rgba(20, 36, 36, 0.8);
    border-color: rgba(127, 204, 158, 0.3);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.cookie-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.cookie-category-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.cookie-category-name {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
}

.cookie-category-badge {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    color: #7fcc9e;
    background: rgba(127, 204, 158, 0.15);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    border: 1px solid rgba(127, 204, 158, 0.3);
}

.cookie-category-description {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: #8fb3b3;
    line-height: 1.6;
    margin: 0 0 0.75rem 0;
}

.cookie-category-cookies {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    color: #6a9191;
}

/* ========================================
   TOGGLE SWITCH
   ======================================== */

.cookie-toggle {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    cursor: pointer;
}

.cookie-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cookie-toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #1f3636;
    border: 1px solid #2a4545;
    border-radius: 28px;
    transition: all 0.3s ease;
}

.cookie-toggle-slider:before {
    content: "";
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: #6a9191;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.cookie-toggle input:checked + .cookie-toggle-slider {
    background: linear-gradient(135deg, #7fcc9e 0%, #6bb88a 100%);
    border-color: #7fcc9e;
    box-shadow: 0 0 20px rgba(127, 204, 158, 0.3);
}

.cookie-toggle input:checked + .cookie-toggle-slider:before {
    transform: translateX(24px);
    background: #ffffff;
}

.cookie-toggle input:disabled + .cookie-toggle-slider {
    background: rgba(127, 204, 158, 0.3);
    border-color: rgba(127, 204, 158, 0.4);
    cursor: not-allowed;
    opacity: 0.6;
}

.cookie-toggle input:disabled + .cookie-toggle-slider:before {
    background: #ffffff;
}

.cookie-toggle input:focus + .cookie-toggle-slider {
    outline: 2px solid #7fcc9e;
    outline-offset: 2px;
}

/* ========================================
   MODAL FOOTER
   ======================================== */

.cookie-modal-footer {
    display: flex;
    gap: 0.75rem;
    padding: 1.5rem 2rem 2rem;
    border-top: 1px solid #1f3636;
}

.cookie-modal-footer .cookie-btn {
    flex: 1;
}

/* ========================================
   FLOATING SETTINGS BUTTON
   ======================================== */

.cookie-settings-btn {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #0d1f1f 0%, #0a1515 100%);
    border: 1px solid rgba(127, 204, 158, 0.3);
    border-radius: 50%;
    color: #7fcc9e;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5),
                0 0 30px rgba(127, 204, 158, 0.2);
    z-index: 9998;
    transition: all 0.3s ease;
}

.cookie-settings-btn:hover {
    transform: scale(1.1) rotate(90deg);
    border-color: #7fcc9e;
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.6),
                0 0 40px rgba(127, 204, 158, 0.4);
}

.cookie-settings-btn:focus {
    outline: 2px solid #7fcc9e;
    outline-offset: 2px;
}

.cookie-settings-btn:active {
    transform: scale(1.05) rotate(90deg);
}

.cookie-settings-btn svg {
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
}

/* Tooltip */
.cookie-settings-tooltip {
    position: absolute;
    left: 70px;
    background: #0d1f1f;
    color: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    border: 1px solid rgba(127, 204, 158, 0.3);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.cookie-settings-btn:hover .cookie-settings-tooltip {
    opacity: 1;
    transform: rotate(-90deg);
    transform-origin: left center;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
    .cookie-consent-banner {
        padding: 1.25rem 1.5rem;
    }

    .cookie-banner-content {
        flex-direction: column;
        align-items: stretch;
        gap: 1.25rem;
    }

    .cookie-banner-actions {
        flex-direction: column;
    }

    .cookie-btn {
        width: 100%;
        justify-content: center;
    }

    .cookie-modal-content {
        max-height: 95vh;
        border-radius: 12px;
    }

    .cookie-modal-header {
        padding: 1.5rem 1.5rem 1rem;
    }

    .cookie-modal-title {
        font-size: 1.5rem;
    }

    .cookie-modal-body {
        padding: 1.5rem;
    }

    .cookie-modal-footer {
        padding: 1rem 1.5rem 1.5rem;
        flex-direction: column;
    }

    .cookie-category {
        padding: 1.25rem;
    }

    .cookie-category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .cookie-settings-btn {
        bottom: 1rem;
        left: 1rem;
        width: 48px;
        height: 48px;
    }

    .cookie-settings-btn svg {
        width: 20px;
        height: 20px;
    }

    .cookie-settings-tooltip {
        display: none;
    }
}

@media (max-width: 480px) {
    .cookie-banner-title {
        font-size: 1.1rem;
    }

    .cookie-banner-description {
        font-size: 0.9rem;
    }

    .cookie-btn {
        font-size: 0.9rem;
        padding: 0.65rem 1.25rem;
    }

    .cookie-modal-title {
        font-size: 1.25rem;
    }

    .cookie-category-name {
        font-size: 1rem;
    }
}

/* ========================================
   DARK MODE ADJUSTMENTS
   ======================================== */

@media (prefers-color-scheme: dark) {
    /* Already optimized for dark mode */
}

/* ========================================
   REDUCED MOTION
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    .cookie-consent-banner,
    .cookie-modal,
    .cookie-modal-content,
    .cookie-btn,
    .cookie-toggle-slider,
    .cookie-toggle-slider:before,
    .cookie-settings-btn {
        transition: none;
        animation: none;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .cookie-consent-banner,
    .cookie-modal,
    .cookie-settings-btn {
        display: none !important;
    }
}

/* ========================================
   HIGH CONTRAST MODE
   ======================================== */

@media (prefers-contrast: high) {
    .cookie-consent-banner {
        border-top: 2px solid #7fcc9e;
    }

    .cookie-btn-accept {
        border: 2px solid #7fcc9e;
    }

    .cookie-modal-content {
        border: 2px solid #7fcc9e;
    }

    .cookie-toggle input:checked + .cookie-toggle-slider {
        border: 2px solid #7fcc9e;
    }
}
