/**
 * Cookie Consent Banner Styles
 * GDPR compliant cookie consent UI
 * 
 * IMPORTANT: This banner is appended to <html> element, not <body>
 * Reason: body has overflow-x:hidden which breaks position:fixed
 */

/* Fix for html element to allow proper fixed positioning */
html {
    position: relative !important;
}

.cookie-consent-banner {
    /* Positioning - CRITICAL for visibility */
    position: fixed !important;
    inset: auto 0 0 0 !important; /* Modern way: bottom=0, left=0, right=0 */
    
    /* Fallback for older browsers */
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    
    /* Appearance */
    background: #ffffff !important;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1) !important;
    border: none !important;
    
    /* Z-index must be maximum */
    z-index: 2147483647 !important;
    
    /* Force hardware acceleration to break out of overflow context */
    /* transform: translateZ(0) !important;
    -webkit-transform: translateZ(0) !important; */
    backface-visibility: hidden !important;
    -webkit-backface-visibility: hidden !important;
    
    /* Layout */
    padding: 20px !important;
    margin: 0 !important;
    width: 100% !important;
    min-height: auto !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    display: block !important;
    
    /* Remove any potential inherited properties */
    float: none !important;
    clear: both !important;
    
    /* Animation */
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out !important;
    
    /* Ensure it's not affected by parent transforms */
    will-change: transform !important;
    
    /* Font reset */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    color: #333 !important;
}

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

.cookie-consent-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

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

.cookie-consent-text h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: #333;
}

.cookie-consent-text p {
    margin: 0;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

.cookie-consent-text a {
    color: #007bff;
    text-decoration: underline;
}

.cookie-consent-text a:hover {
    color: #0056b3;
}

.cookie-consent-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.cookie-consent-banner .btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}

.cookie-consent-banner .btn-primary {
    background: #007bff;
    color: white;
}

.cookie-consent-banner .btn-primary:hover {
    background: #0056b3;
}

.cookie-consent-banner .btn-secondary {
    background: #6c757d;
    color: white;
}

.cookie-consent-banner .btn-secondary:hover {
    background: #545b62;
}

.cookie-consent-banner .btn-link {
    background: transparent;
    color: #007bff;
    text-decoration: underline;
}

.cookie-consent-banner .btn-link:hover {
    color: #0056b3;
}

.cookie-consent-details {
    max-width: 1200px;
    margin: 0 auto;
}

.cookie-consent-options {
    margin-bottom: 20px;
}

.cookie-option {
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    margin-bottom: 10px;
    background: #f9f9f9;
}

.cookie-option label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    margin: 0;
}

.cookie-option input[type="checkbox"] {
    margin-top: 3px;
    cursor: pointer;
    min-width: 18px;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.cookie-option input[type="checkbox"]:disabled {
    cursor: not-allowed;
}

.cookie-option .cookie-label-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-left: 12px;
}

.cookie-option strong {
    display: block;
    color: #333;
    font-size: 15px;
}

.cookie-option .cookie-description {
    display: block;
    color: #666;
    font-size: 13px;
    line-height: 1.4;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .cookie-consent-banner {
        padding: 15px;
    }
    
    .cookie-consent-content {
        flex-direction: column;
        align-items: stretch;
    }
    
    .cookie-consent-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .cookie-consent-banner .btn {
        width: 100%;
        justify-content: center;
    }
    
    .cookie-consent-text h3 {
        font-size: 16px;
    }
    
    .cookie-consent-text p {
        font-size: 13px;
    }
}

/* Accessibility */
.cookie-consent-banner .btn:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Print - hide banner */
@media print {
    .cookie-consent-banner {
        display: none !important;
    }
}
