/**
 * Cookie Consent Banner & Preferences Modal Styles
 * GDPR/CCPA Compliant Design
 */

/* Cookie Banner */
.cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    border-top: 1px solid var(--grey-300);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    z-index: 10000;
    padding: var(--space-4);
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

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

.cookie-consent-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.cookie-consent-text {
    flex: 1;
}

.cookie-consent-text h3 {
    margin: 0 0 var(--space-2) 0;
    color: var(--primary-color);
    font-size: var(--text-lg);
}

.cookie-consent-text p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.5;
}

.cookie-consent-text a {
    color: var(--primary-color);
    text-decoration: underline;
}

.cookie-consent-actions {
    display: flex;
    gap: var(--space-3);
    flex-shrink: 0;
}

/* Cookie Preferences Modal */
.cookie-preferences-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cookie-preferences-modal.show {
    opacity: 1;
    visibility: visible;
}

.cookie-preferences-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

.cookie-preferences-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--white);
    border-radius: var(--radius-lg);
    max-width: 600px;
    width: 90vw;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.cookie-preferences-header {
    padding: var(--space-6);
    border-bottom: 1px solid var(--grey-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cookie-preferences-header h2 {
    margin: 0;
    color: var(--primary-color);
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: var(--space-2);
    line-height: 1;
    border-radius: var(--radius-md);
    transition: background-color 0.2s ease;
}

.close-btn:hover {
    background: var(--grey-100);
}

.cookie-preferences-body {
    padding: var(--space-6);
    max-height: 60vh;
    overflow-y: auto;
}

.cookie-preferences-body > p {
    margin: 0 0 var(--space-6) 0;
    color: var(--text-secondary);
    line-height: 1.6;
}

.cookie-categories {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.cookie-category {
    border: 1px solid var(--grey-200);
    border-radius: var(--radius-md);
    padding: var(--space-4);
}

.cookie-category-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}

.cookie-category-header h4 {
    margin: 0;
    color: var(--text-primary);
    font-size: var(--text-base);
}

.cookie-category-description {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    line-height: 1.5;
}

/* Toggle Switch */
.cookie-toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    cursor: pointer;
}

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

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

.cookie-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--grey-300);
    transition: 0.3s;
    border-radius: 26px;
}

.cookie-toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: var(--white);
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

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

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

.cookie-preferences-footer {
    padding: var(--space-6);
    border-top: 1px solid var(--grey-200);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
}

/* Button Styles */
.cookie-consent-banner .btn,
.cookie-preferences-modal .btn {
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-block;
    white-space: nowrap;
}

.cookie-consent-banner .btn-primary,
.cookie-preferences-modal .btn-primary {
    background: var(--primary-color);
    color: var(--white);
}

.cookie-consent-banner .btn-primary:hover,
.cookie-preferences-modal .btn-primary:hover {
    background: var(--primary-dark);
}

.cookie-consent-banner .btn-secondary,
.cookie-preferences-modal .btn-secondary {
    background: var(--grey-600);
    color: var(--white);
}

.cookie-consent-banner .btn-secondary:hover,
.cookie-preferences-modal .btn-secondary:hover {
    background: var(--grey-700);
}

.cookie-consent-banner .btn-outline,
.cookie-preferences-modal .btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.cookie-consent-banner .btn-outline:hover,
.cookie-preferences-modal .btn-outline:hover {
    background: var(--primary-color);
    color: var(--white);
}

/* Cookie Preferences Link in Footer */
.cookie-preferences-link {
    color: var(--primary-color);
    text-decoration: underline;
    cursor: pointer;
    background: none;
    border: none;
    font-size: inherit;
    font-family: inherit;
}

.cookie-preferences-link:hover {
    color: var(--primary-dark);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .cookie-consent-content {
        flex-direction: column;
        gap: var(--space-3);
        text-align: center;
    }
    
    .cookie-consent-actions {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .cookie-consent-banner .btn {
        padding: var(--space-3) var(--space-4);
        min-width: 120px;
    }
    
    .cookie-preferences-content {
        width: 95vw;
        max-height: 90vh;
    }
    
    .cookie-preferences-header,
    .cookie-preferences-body,
    .cookie-preferences-footer {
        padding: var(--space-4);
    }
    
    .cookie-preferences-footer {
        flex-direction: column;
    }
    
    .cookie-preferences-footer .btn {
        width: 100%;
        text-align: center;
    }
    
    .cookie-category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-2);
    }
}

@media (max-width: 480px) {
    .cookie-consent-banner {
        padding: var(--space-3);
    }
    
    .cookie-consent-text h3 {
        font-size: var(--text-base);
    }
    
    .cookie-consent-text p {
        font-size: var(--text-sm);
    }
    
    .cookie-consent-actions {
        gap: var(--space-2);
    }
    
    .cookie-consent-banner .btn {
        padding: var(--space-2) var(--space-3);
        font-size: var(--text-xs);
        min-width: 100px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .cookie-consent-banner {
        border-top: 2px solid var(--text-primary);
    }
    
    .cookie-toggle-slider {
        border: 1px solid var(--text-primary);
    }
    
    .cookie-category {
        border: 2px solid var(--text-primary);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .cookie-consent-banner {
        transition: none;
    }
    
    .cookie-preferences-modal {
        transition: none;
    }
    
    .cookie-toggle-slider,
    .cookie-toggle-slider:before {
        transition: none;
    }
} 