/* Cookie Banner Styles */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: white;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    padding: 20px 0;
    animation: slideUp 0.3s ease-out;
    display: none; /* Hidden by default, shown via JavaScript */
    -webkit-transform: translateZ(0); /* Force hardware acceleration on mobile */
    transform: translateZ(0);
}

.cookie-banner-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
}

.cookie-banner-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    width: 100%;
    box-sizing: border-box;
}

.cookie-banner-content p {
    margin: 0;
    color: #333;
    flex: 1;
    min-width: 250px;
}

.cookie-banner-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.cookie-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    box-sizing: border-box;
}

.cookie-btn-accept {
    background: #f6782c;
    color: white;
}

.cookie-btn-accept:hover {
    background: #e5691f;
}

.cookie-btn-reject {
    background: #666;
    color: white;
}

.cookie-btn-reject:hover {
    background: #555;
}

.cookie-btn-customize {
    background: transparent;
    color: #666;
    border: 2px solid #ddd;
}

.cookie-btn-customize:hover {
    border-color: #999;
    color: #333;
}

/* Cookie Settings Modal */
.cookie-settings-modal {
    display: none;
    position: fixed;
    z-index: 10001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease-in;
}

.cookie-settings-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.cookie-settings-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 2px solid #eee;
}

.cookie-settings-modal-header h2 {
    margin: 0;
    color: #333;
    font-size: 1.5rem;
}

.cookie-settings-modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.cookie-settings-modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

.cookie-settings-modal-body {
    padding: 24px;
}

.cookie-settings-modal-body > p {
    margin: 0 0 24px 0;
    color: #666;
    line-height: 1.6;
}

.cookie-category {
    margin-bottom: 24px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.cookie-category:last-of-type {
    margin-bottom: 0;
}

.cookie-category-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.cookie-category-header h3 {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 1.1rem;
    font-weight: 600;
}

.cookie-category-description {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
    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: #ccc;
    transition: 0.3s;
    border-radius: 26px;
}

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

.cookie-toggle input:checked + .cookie-toggle-slider {
    background-color: #f6782c;
}

.cookie-toggle input:focus + .cookie-toggle-slider {
    box-shadow: 0 0 1px #f6782c;
}

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

.cookie-toggle input:disabled + .cookie-toggle-slider {
    background-color: #f6782c;
    cursor: not-allowed;
    opacity: 0.6;
}

.cookie-settings-actions {
    display: flex;
    gap: 10px;
    margin-top: 24px;
    justify-content: flex-end;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* Mobile Responsive */
@media (max-width: 768px) {
    .cookie-banner {
        padding: 15px 0;
        display: none; /* Ensure hidden by default on mobile */
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }

    .cookie-banner.show {
        display: block !important; /* Force show when class is added */
    }

    .cookie-banner-container {
        padding: 0 15px;
        width: 100%;
        max-width: 100%;
    }

    .cookie-banner-content {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .cookie-banner-content p {
        margin-bottom: 15px;
        min-width: auto;
        width: 100%;
    }

    .cookie-banner-buttons {
        width: 100%;
        flex-direction: column;
        display: flex;
    }

    .cookie-btn {
        width: 100%;
        display: block;
    }

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

    .cookie-settings-modal-header {
        padding: 15px 20px;
    }

    .cookie-settings-modal-body {
        padding: 20px;
    }

    .cookie-category {
        padding: 15px;
    }

    .cookie-category-header {
        flex-direction: column;
        gap: 15px;
    }

    .cookie-toggle {
        align-self: flex-start;
    }

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

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

@media (max-width: 480px) {
    .cookie-banner {
        padding: 12px 0;
        display: none;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
    }

    .cookie-banner.show {
        display: block !important;
    }

    .cookie-banner-container {
        padding: 0 12px;
        width: 100%;
        max-width: 100%;
    }

    .cookie-banner-content {
        width: 100%;
    }

    .cookie-banner-content p {
        font-size: 0.9rem;
        width: 100%;
    }

    .cookie-btn {
        padding: 8px 16px;
        font-size: 13px;
        width: 100%;
        display: block;
    }
}
