/* ============================================
   COOKIE CONSENT BANNER & MANAGEMENT
   ============================================ */

/* Cookie Banner */
.cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-top: 3px solid var(--primary-color);
}

.cookie-consent-banner.show {
    transform: translateY(0);
}

.cookie-consent-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.cookie-icon {
    font-size: 3rem;
    color: var(--primary-color);
    flex-shrink: 0;
}

.cookie-text {
    flex: 1;
    min-width: 300px;
}

.cookie-text h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.cookie-text p {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.cookie-text a {
    color: var(--primary-color);
    text-decoration: underline;
}

.cookie-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.cookie-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.cookie-btn-accept {
    background: var(--primary-color);
    color: white;
}

.cookie-btn-accept:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

.cookie-btn-settings {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.cookie-btn-settings:hover {
    background: var(--bg-secondary);
    border-color: var(--primary-color);
}

.cookie-btn-reject {
    background: transparent;
    color: var(--text-secondary);
}

.cookie-btn-reject:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
}

/* Cookie Settings Modal */
.cookie-settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(5px);
}

.cookie-settings-modal.show {
    display: flex;
}

.cookie-settings-content {
    background: var(--bg-primary);
    border-radius: 16px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cookie-settings-header {
    padding: 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cookie-settings-header h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.cookie-settings-header h2 i {
    color: var(--primary-color);
}

.cookie-close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.cookie-close-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
    transform: rotate(90deg);
}

.cookie-settings-body {
    padding: 2rem;
}

.cookie-category {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.cookie-category:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.cookie-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.cookie-category-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.cookie-category-title i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.cookie-category-title h3 {
    font-size: 1.125rem;
    color: var(--text-primary);
    margin: 0;
}

.cookie-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.cookie-badge.required {
    background: #e3f2fd;
    color: #1976d2;
}

.cookie-badge.optional {
    background: #fff3e0;
    color: #f57c00;
}

.cookie-category-description {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.cookie-category-items {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0 0;
}

.cookie-category-items li {
    padding: 0.5rem 0;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cookie-category-items li i {
    color: var(--primary-color);
    font-size: 0.875rem;
}

/* Toggle Switch */
.cookie-toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.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: #ccc;
    transition: 0.4s;
    border-radius: 26px;
}

.cookie-toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

.cookie-toggle input:checked + .cookie-toggle-slider {
    background-color: var(--primary-color);
}

.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 2rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.cookie-settings-footer .cookie-btn {
    flex: 1;
    min-width: 150px;
    justify-content: center;
}

/* Cookie Floating Button */
.cookie-float-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
}

.cookie-float-btn.show {
    opacity: 1;
    visibility: visible;
}

.cookie-float-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(255, 193, 7, 0.4);
}

/* Responsive Design */
@media (max-width: 768px) {
    .cookie-consent-content {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem;
    }

    .cookie-icon {
        font-size: 2.5rem;
    }

    .cookie-actions {
        width: 100%;
        flex-direction: column;
    }

    .cookie-btn {
        width: 100%;
        justify-content: center;
    }

    .cookie-settings-content {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
    }

    .cookie-settings-header,
    .cookie-settings-body {
        padding: 1.5rem;
    }

    .cookie-settings-footer {
        flex-direction: column;
        padding: 1rem 1.5rem;
    }

    .cookie-settings-footer .cookie-btn {
        width: 100%;
    }

    .cookie-float-btn {
        bottom: 80px;
        right: 20px;
        left: auto;
    }
}

/* Dark Theme Adjustments */
[data-theme="dark"] .cookie-consent-banner {
    background: #1a1a1a;
    border-top-color: var(--primary-color);
}

[data-theme="dark"] .cookie-settings-content {
    background: #1a1a1a;
}

[data-theme="dark"] .cookie-category {
    background: #2a2a2a;
    border-color: #3a3a3a;
}

[data-theme="dark"] .cookie-toggle-slider {
    background-color: #555;
}

/* Animation */
@keyframes cookiePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.cookie-float-btn.pulse {
    animation: cookiePulse 2s infinite;
}

/* Print Styles */
@media print {
    .cookie-consent-banner,
    .cookie-settings-modal,
    .cookie-float-btn {
        display: none !important;
    }
}
