/**
 * Cookie Consent Banner Styles
 * Modern, GDPR-compliant design that works with both themes
 */

/* === COOKIE BANNER === */
.cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-primary);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
}

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

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

.cookie-consent-content {
    flex: 1;
    min-width: 300px;
}

.cookie-consent-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
}

.cookie-consent-text {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.cookie-consent-link {
    color: var(--accent-primary);
    text-decoration: underline;
    transition: color 0.2s;
}

.cookie-consent-link:hover {
    color: var(--accent-primary-hover);
}

.cookie-consent-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

/* === COOKIE BUTTONS === */
.cookie-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    white-space: nowrap;
}

.cookie-btn-primary {
    background-color: var(--accent-primary);
    color: white;
}

.cookie-btn-primary:hover {
    background-color: var(--accent-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

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

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

/* === COOKIE 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;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cookie-modal.show {
    opacity: 1;
}

.cookie-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.cookie-modal-content {
    position: relative;
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

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

.cookie-modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-primary);
}

.cookie-modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.cookie-modal-close:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

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

.cookie-modal-intro {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.cookie-category {
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    background-color: var(--bg-secondary);
}

.cookie-category-header {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.cookie-category h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.cookie-category p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* === TOGGLE SWITCH === */
.cookie-toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    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-color: var(--bg-elevated);
    transition: 0.3s;
    border-radius: 26px;
    border: 1px solid var(--border-primary);
}

.cookie-toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

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

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

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

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

/* === MOBILE RESPONSIVE === */
@media (max-width: 768px) {
    .cookie-consent-container {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .cookie-consent-actions {
        width: 100%;
        justify-content: stretch;
    }
    
    .cookie-btn {
        flex: 1;
        text-align: center;
    }
    
    .cookie-modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .cookie-category-header {
        flex-direction: column;
    }
    
    .cookie-toggle {
        order: -1;
    }
}

/* === PRINT STYLES === */
@media print {
    .cookie-consent-banner,
    .cookie-modal {
        display: none !important;
    }
}

/* === ACCESSIBILITY === */
@media (prefers-reduced-motion: reduce) {
    .cookie-consent-banner,
    .cookie-modal,
    .cookie-btn,
    .cookie-toggle-slider,
    .cookie-toggle-slider:before {
        transition: none !important;
    }
}

/* Focus styles for keyboard navigation */
.cookie-btn:focus,
.cookie-modal-close:focus,
.cookie-toggle input:focus + .cookie-toggle-slider {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}
