/* Cookie Consent for Crypto Ninja Trades
 * GDPR-compliant cookie consent banner with light/dark mode support
 */

/* Container for the banner */
.cookie-consent {
    position: fixed;
    bottom: 0.7rem;
    left: 0.7rem;
    right: 0.7rem;
    max-width: 900px;
    margin: 0 auto;
    background: rgba(26, 26, 26, 0.95);
    border: 1px solid rgba(55, 95, 124, 0.4);
    border-radius: 8px;
    padding: 0.8rem 1.2rem;
    box-shadow: 0 15px 25px rgba(0, 0, 0, 0.3);
    z-index: 2147483647 !important; /* Maximum possible z-index */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    color: #E0E0E0;
    font-size: 0.85rem;
    line-height: 1.4;
    display: flex !important;
    flex-direction: column;
    gap: 0.6rem;
    opacity: 1 !important; /* Force visible by default */
    transform: translateY(0) !important; /* Force fully visible */
    visibility: visible !important; /* Force visibility */
    pointer-events: auto !important; /* Ensure clickable */
    width: auto !important; /* Prevent width override */
    height: auto !important; /* Prevent height override */
}

/* Dark and light mode support */
.theme-light .cookie-consent {
    background: rgba(240, 240, 240, 0.95);
    color: #1A1A1A;
    border-color: rgba(55, 95, 124, 0.2);
}

@media (min-width: 768px) {
    .cookie-consent {
        flex-direction: row;
        align-items: center;
        padding: 1.25rem 2rem;
    }
    
    .cookie-consent-text {
        flex: 1;
    }
    
    .cookie-consent-actions {
        display: flex;
        gap: 10px;
        flex-shrink: 0;
    }
}

/* Text container */
.cookie-consent-text {
    flex: 1;
}

.cookie-consent-text h3 {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
}

.cookie-consent-text p {
    color: rgba(224, 224, 224, 0.8);
    margin-bottom: 0.3rem;
    font-size: 0.8rem;
}

.theme-light .cookie-consent-text p {
    color: rgba(26, 26, 26, 0.8);
}

/* Action buttons */
.cookie-consent-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

@media (min-width: 640px) {
    .cookie-consent-actions {
        flex-direction: row;
    }
}

/* Accept button */
.cookie-accept {
    background-color: #375F7C;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.82rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    flex: 1;
}

.cookie-accept:hover {
    background-color: #4A6378;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(55, 95, 124, 0.4);
}

/* Refuse button */
.cookie-refuse {
    background-color: transparent;
    border: 1px solid rgba(224, 224, 224, 0.3);
    color: #E0E0E0;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    flex: 1;
}

.cookie-refuse:hover {
    border-color: rgba(224, 224, 224, 0.6);
    background-color: rgba(224, 224, 224, 0.05);
}

.theme-light .cookie-refuse {
    border-color: rgba(26, 26, 26, 0.3);
    color: #1A1A1A;
}

.theme-light .cookie-refuse:hover {
    border-color: rgba(26, 26, 26, 0.6);
    background-color: rgba(26, 26, 26, 0.05);
}

/* Settings button */
.cookie-settings {
    background: none;
    border: none;
    color: #375F7C;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    margin: 0;
    font-size: 0.85rem;
    transition: color 0.2s ease;
}

.cookie-settings:hover {
    color: #4A6378;
}

/* Modal for detailed cookie settings */
.cookie-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.cookie-modal.visible {
    opacity: 1;
    visibility: visible;
}

.cookie-modal-content {
    background: #1A1A1A;
    border: 1px solid rgba(55, 95, 124, 0.4);
    border-radius: 10px;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    color: #E0E0E0;
    position: relative;
}

.theme-light .cookie-modal-content {
    background: #F0F0F0;
    color: #1A1A1A;
    border-color: rgba(55, 95, 124, 0.2);
}

.cookie-modal-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(55, 95, 124, 0.3);
}

.cookie-modal-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
}

.cookie-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: #E0E0E0;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.theme-light .cookie-modal-close {
    color: #1A1A1A;
}

.cookie-modal-close:hover {
    background-color: rgba(224, 224, 224, 0.1);
}

.theme-light .cookie-modal-close:hover {
    background-color: rgba(26, 26, 26, 0.1);
}

.cookie-modal-body {
    margin-bottom: 1.5rem;
}

/* Cookie categories in modal */
.cookie-category {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(55, 95, 124, 0.2);
}

.cookie-category:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.cookie-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.cookie-category h4 {
    font-weight: 600;
    font-size: 1rem;
}

.cookie-category p {
    color: rgba(224, 224, 224, 0.7);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.theme-light .cookie-category p {
    color: rgba(26, 26, 26, 0.7);
}

/* Toggle switch for cookie categories */
.cookie-toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    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: rgba(224, 224, 224, 0.2);
    transition: 0.4s;
    border-radius: 34px;
}

.theme-light .cookie-toggle-slider {
    background-color: rgba(26, 26, 26, 0.2);
}

.cookie-toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

.cookie-toggle input:checked + .cookie-toggle-slider {
    background-color: #375F7C;
}

.cookie-toggle input:checked + .cookie-toggle-slider:before {
    transform: translateX(26px);
}

/* Disabled toggle (for necessary cookies) */
.cookie-toggle.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.cookie-toggle.disabled .cookie-toggle-slider {
    cursor: not-allowed;
}

/* Modal action buttons */
.cookie-modal-actions {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2rem;
}

.cookie-modal-actions button {
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.cookie-save-prefs {
    background-color: #375F7C;
    color: white;
    border: none;
    flex: 1;
}

.cookie-save-prefs:hover {
    background-color: #4A6378;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(55, 95, 124, 0.4);
}

.cookie-accept-all {
    background-color: transparent;
    border: 1px solid rgba(55, 95, 124, 0.5);
    color: #375F7C;
    flex: 1;
}

.cookie-accept-all:hover {
    border-color: #375F7C;
    background-color: rgba(55, 95, 124, 0.05);
}

.theme-light .cookie-accept-all {
    border-color: rgba(55, 95, 124, 0.4);
    color: #375F7C;
}

/* Animation for banner appearance */
@keyframes slideFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cookie-consent {
    animation: slideFadeIn 0.5s ease-out forwards;
}
