/**
 * Cookie Consent Banner & Settings Modal
 * GDPR/CCPA Compliant Styling
 */

/* Cookie Consent Banner */
.cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.98), rgba(139, 92, 246, 0.98));
    color: white;
    padding: 1.5rem;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
    backdrop-filter: blur(10px);
}

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

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

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

.cookie-consent-text h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.125rem;
    font-weight: 600;
}

.cookie-consent-text p {
    margin: 0;
    font-size: 0.875rem;
    opacity: 0.95;
    line-height: 1.5;
}

.cookie-consent-text a {
    color: white;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cookie-consent-text a:hover {
    opacity: 0.8;
}

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

.cookie-btn {
    padding: 0.625rem 1.25rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    white-space: nowrap;
}

.cookie-btn-primary {
    background: white;
    color: var(--primary-color, #2563eb);
}

.cookie-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
}

.cookie-btn-secondary {
    background: transparent;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.cookie-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: white;
}

/* Cookie Settings Modal */
.cookie-settings-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 10001;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(4px);
}

.cookie-settings-modal.show {
    display: flex;
}

.cookie-settings-dialog {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.cookie-settings-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--dark-color, #1f2937);
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-600, #6b7280);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.close-modal:hover {
    background: var(--gray-100, #f3f4f6);
}

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

.cookie-category {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--gray-200, #e5e7eb);
}

.cookie-category:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.cookie-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.cookie-category-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--dark-color, #1f2937);
}

.cookie-category-badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    background: var(--gray-200, #e5e7eb);
    color: var(--gray-700, #374151);
    font-size: 0.75rem;
    border-radius: 12px;
    font-weight: 500;
}

.cookie-category-badge.always-on {
    background: var(--success-color, #10b981);
    color: white;
}

.cookie-category-description {
    font-size: 0.875rem;
    color: var(--gray-600, #6b7280);
    line-height: 1.5;
    margin: 0;
}

/* Toggle Switch */
.cookie-toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

.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(--gray-300, #d1d5db);
    transition: 0.3s;
    border-radius: 24px;
}

.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(--primary-color, #2563eb);
}

.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-settings-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--gray-200, #e5e7eb);
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.cookie-settings-footer .cookie-btn {
    padding: 0.75rem 1.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cookie-consent-content {
        flex-direction: column;
        gap: 1rem;
    }

    .cookie-consent-text {
        min-width: 100%;
    }

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

    .cookie-btn {
        width: 100%;
        text-align: center;
    }

    .cookie-settings-dialog {
        margin: 0;
        max-height: 100vh;
        border-radius: 0;
    }

    .cookie-settings-footer {
        flex-direction: column-reverse;
    }

    .cookie-settings-footer .cookie-btn {
        width: 100%;
    }
}

/* Accessibility */
.cookie-btn:focus,
.cookie-toggle input:focus + .cookie-toggle-slider,
.close-modal:focus {
    outline: 2px solid var(--primary-color, #2563eb);
    outline-offset: 2px;
}

/* Print: Hide cookie elements */
@media print {
    .cookie-consent-banner,
    .cookie-settings-modal {
        display: none !important;
    }
}
