/**
 * Cookie Consent Banner & Settings Modal - Styles
 * GDPR/ePrivacy Compliant Design
 */

/* ============================================
   Cookie Consent Banner (Bottom)
   ============================================ */

.cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: var(--bg-surface, #ffffff);
    border-top: 3px solid var(--primary, #4361A8);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    padding: 1.25rem 1rem;
    transform: translateY(100%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.cookie-consent-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1.5rem;
    align-items: center;
}

.cookie-consent-icon {
    font-size: 2.5rem;
    color: var(--primary, #4361A8);
    display: flex;
    align-items: center;
}

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

.cookie-consent-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: var(--text-primary, #212529);
}

.cookie-consent-description {
    font-size: 0.875rem;
    color: var(--text-secondary, #6c757d);
    margin: 0 0 0.5rem 0;
    line-height: 1.5;
}

.cookie-consent-links {
    font-size: 0.813rem;
    margin: 0;
}

.cookie-consent-links a {
    color: var(--primary, #4361A8);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.cookie-consent-links a:hover {
    color: var(--primary-dark, #2E4578);
    text-decoration: underline;
}

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

.cookie-consent-actions .btn {
    white-space: nowrap;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.2s;
}

/* ============================================
   Cookie Settings Modal
   ============================================ */

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

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

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

.cookie-settings-content {
    position: relative;
    background: var(--bg-surface, #ffffff);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    transform: scale(0.9);
    transition: transform 0.3s;
}

.cookie-settings-modal.show .cookie-settings-content {
    transform: scale(1);
}

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

.cookie-settings-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary, #212529);
}

.cookie-settings-header .btn-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-secondary, #6c757d);
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.cookie-settings-header .btn-close:hover {
    background: var(--bg-hover, #f8f9fa);
    color: var(--text-primary, #212529);
}

.cookie-settings-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.cookie-category {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-secondary, #f8f9fa);
    border-radius: 12px;
    border: 1px solid var(--border-color, #e0e0e0);
    transition: all 0.2s;
}

.cookie-category:hover {
    border-color: var(--primary, #4361A8);
    box-shadow: 0 2px 8px rgba(67, 97, 168, 0.1);
}

.cookie-category-header {
    margin-bottom: 0.75rem;
}

.cookie-category .form-check {
    padding-left: 0;
}

.cookie-category .form-check-input {
    width: 3rem;
    height: 1.5rem;
    cursor: pointer;
    border: 2px solid var(--border-color, #dee2e6);
    margin-right: 0.75rem;
}

.cookie-category .form-check-input:checked {
    background-color: var(--primary, #4361A8);
    border-color: var(--primary, #4361A8);
}

.cookie-category .form-check-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cookie-category .form-check-label {
    font-size: 1rem;
    color: var(--text-primary, #212529);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cookie-category .form-check-input:disabled + .form-check-label {
    cursor: not-allowed;
}

.cookie-category-description {
    font-size: 0.875rem;
    color: var(--text-secondary, #6c757d);
    margin: 0;
    padding-left: 3.75rem;
    line-height: 1.5;
}

.cookie-category-description small {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.813rem;
    color: var(--text-muted, #999);
}

.cookie-settings-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color, #e0e0e0);
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.cookie-settings-footer .btn {
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 6px;
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 768px) {
    .cookie-consent-content {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .cookie-consent-icon {
        display: none;
    }

    .cookie-consent-actions {
        width: 100%;
    }

    .cookie-consent-actions .btn {
        flex: 1;
        min-width: 0;
    }

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

    .cookie-settings-header,
    .cookie-settings-body,
    .cookie-settings-footer {
        padding: 1rem;
    }

    .cookie-category-description {
        padding-left: 0;
        margin-top: 0.5rem;
    }
}

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

    .cookie-consent-title {
        font-size: 1rem;
    }

    .cookie-consent-description {
        font-size: 0.813rem;
    }

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

    .cookie-consent-actions .btn {
        width: 100%;
    }
}

/* ============================================
   Dark Mode Support
   ============================================ */

[data-theme="dark"] .cookie-consent-banner {
    background: var(--bg-surface);
    border-top-color: var(--primary);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .cookie-settings-content {
    background: var(--bg-surface);
}

[data-theme="dark"] .cookie-category {
    background: var(--bg-primary);
    border-color: var(--border-color);
}

/* ============================================
   Accessibility
   ============================================ */

/* Focus indicators for keyboard navigation */
.cookie-consent-actions .btn:focus,
.cookie-settings-footer .btn:focus,
.cookie-settings-header .btn-close:focus {
    outline: 3px solid var(--primary, #4361A8);
    outline-offset: 2px;
}

.cookie-category .form-check-input:focus {
    outline: 3px solid var(--primary, #4361A8);
    outline-offset: 2px;
    box-shadow: none;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .cookie-consent-banner,
    .cookie-settings-modal,
    .cookie-settings-content,
    .cookie-category {
        transition: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .cookie-consent-banner {
        border-top-width: 4px;
    }

    .cookie-category {
        border-width: 2px;
    }

    .cookie-consent-actions .btn,
    .cookie-settings-footer .btn {
        font-weight: 700;
    }
}

/* ============================================
   Print: Hide cookie banner
   ============================================ */

@media print {
    .cookie-consent-banner,
    .cookie-settings-modal {
        display: none !important;
    }
}
