/**
 * Cookie Management System Styles
 * GDPR/CCPA Compliant Cookie Banner and Preferences
 */


/* Cookie Consent Banner */

.cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(30, 30, 30, 0.98);
    color: #ffffff;
    padding: 1.5rem;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    z-index: 1100;
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
    border-top: 3px solid var(--primary, #ff6b35);
}

.cookie-consent-banner.show {
    transform: translateY(0);
}

.cookie-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cookie-banner-text h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--primary, #ff6b35);
}

.cookie-banner-text p {
    margin: 0;
    line-height: 1.5;
    font-size: 0.95rem;
}

.cookie-banner-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}


/* Cookie Buttons */

.cookie-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
}

.cookie-btn-accept {
    background: var(--primary, #ff6b35);
    color: white;
}

.cookie-btn-accept:hover {
    background: var(--primary-dark, #e55a2b);
    transform: translateY(-1px);
}

.cookie-btn-reject {
    background: #6c757d;
    color: white;
}

.cookie-btn-reject:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.cookie-btn-manage {
    background: transparent;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.cookie-btn-manage:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.cookie-btn-primary {
    background: var(--primary, #ff6b35);
    color: white;
}

.cookie-btn-primary:hover {
    background: var(--primary-dark, #e55a2b);
}

.cookie-btn-secondary {
    background: #6c757d;
    color: white;
}

.cookie-btn-secondary:hover {
    background: #5a6268;
}


/* Banner Overlay */

.cookie-banner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1099;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.cookie-banner-overlay.show {
    opacity: 1;
    visibility: visible;
}


/* Cookie Preferences Modal */

.cookie-preferences-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 1102;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.cookie-preferences-modal.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.cookie-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1101;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.cookie-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}


/* Modal Content */

.cookie-modal-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.cookie-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

.cookie-modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #333;
}

.cookie-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.cookie-modal-close:hover {
    background: #e9ecef;
    color: #333;
}

.cookie-modal-body {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
}

.cookie-modal-body>p {
    margin: 0 0 1.5rem 0;
    color: #666;
    line-height: 1.5;
}


/* Cookie Categories */

.cookie-categories {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.cookie-category {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.25rem;
    background: #f8f9fa;
}

.cookie-category-header {
    margin-bottom: 0.75rem;
}

.cookie-toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 600;
    color: #333;
}

.cookie-toggle input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.cookie-toggle-slider {
    position: relative;
    width: 50px;
    height: 24px;
    background: #ccc;
    border-radius: 24px;
    margin-left: 0.75rem;
    transition: background-color 0.3s ease;
    flex-shrink: 0;
}

.cookie-toggle-slider::before {
    content: '';
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cookie-toggle input[type="checkbox"]:checked+.cookie-toggle-slider {
    background: var(--primary, #ff6b35);
}

.cookie-toggle input[type="checkbox"]:checked+.cookie-toggle-slider::before {
    transform: translateX(-26px);
}

.cookie-toggle input[type="checkbox"]:disabled+.cookie-toggle-slider {
    background: #28a745;
    opacity: 0.8;
    cursor: not-allowed;
}

.cookie-toggle input[type="checkbox"]:disabled+.cookie-toggle-slider::before {
    transform: translateX(-26px);
}

.cookie-category-name {
    margin-right: 0.75rem;
    font-size: 1rem;
}

.cookie-required {
    font-size: 0.8rem;
    color: #28a745;
    font-weight: normal;
    margin-right: 0.5rem;
}

.cookie-category-description {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
}

.cookie-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.5rem;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
}


/* Cookie Notification */

.cookie-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    color: #333;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 10002;
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 300px;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
}

.cookie-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.cookie-notification-success {
    border-left: 4px solid #28a745;
}

.cookie-notification-info {
    border-left: 4px solid #17a2b8;
}

.cookie-notification-warning {
    border-left: 4px solid #ffc107;
}

.cookie-notification-error {
    border-left: 4px solid #dc3545;
}

.cookie-notification-message {
    flex: 1;
    font-size: 0.9rem;
}

.cookie-notification-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cookie-notification-close:hover {
    color: #333;
}


/* Cookie Settings Link (for footer) */

.cookie-settings-link {
    color: var(--muted, #6c757d);
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.cookie-settings-link:hover {
    color: var(--primary, #ff6b35);
}


/* Responsive Design */

@media (max-width: 768px) {
    .cookie-consent-banner {
        padding: 1rem;
    }
    .cookie-banner-content {
        gap: 1rem;
    }
    .cookie-banner-buttons {
        flex-direction: column;
    }
    .cookie-btn {
        width: 100%;
        justify-content: center;
    }
    .cookie-preferences-modal {
        width: 95%;
        max-height: 90vh;
    }
    .cookie-modal-header,
    .cookie-modal-body,
    .cookie-modal-footer {
        padding: 1rem;
    }
    .cookie-notification {
        right: 10px;
        left: 10px;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .cookie-modal-footer {
        flex-direction: column;
    }
    .cookie-category {
        padding: 1rem;
    }
    .cookie-toggle {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .cookie-toggle-slider {
        margin-left: 0;
        margin-right: auto;
    }
}


/* High contrast mode support */

@media (prefers-contrast: high) {
    .cookie-consent-banner {
        background: #000;
        border-top-color: #fff;
    }
    .cookie-preferences-modal {
        border: 2px solid #000;
    }
    .cookie-category {
        border-color: #000;
    }
}


/* Reduced motion support */

@media (prefers-reduced-motion: reduce) {
    .cookie-consent-banner,
    .cookie-preferences-modal,
    .cookie-modal-overlay,
    .cookie-banner-overlay,
    .cookie-notification,
    .cookie-btn,
    .cookie-toggle-slider,
    .cookie-toggle-slider::before {
        transition: none;
    }
}


/* RTL Support */

[dir="rtl"] .cookie-banner-buttons {
    justify-content: flex-start;
}

[dir="rtl"] .cookie-toggle-slider::before {
    right: auto;
    left: 2px;
}

[dir="rtl"] .cookie-toggle input[type="checkbox"]:checked+.cookie-toggle-slider::before {
    transform: translateX(26px);
}

[dir="rtl"] .cookie-toggle input[type="checkbox"]:disabled+.cookie-toggle-slider::before {
    transform: translateX(26px);
}

[dir="rtl"] .cookie-modal-footer {
    justify-content: flex-start;
}

[dir="rtl"] .cookie-notification {
    right: auto;
    left: 20px;
    transform: translateX(-100%);
}

[dir="rtl"] .cookie-notification.show {
    transform: translateX(0);
}

@media (max-width: 480px) {
    [dir="rtl"] .cookie-notification {
        left: 10px;
        right: 10px;
    }
}