/**
 * Cookie Banner Styles
 * Theme-aware styling for both Consistis (modern) and Tangrakan (retro) themes
 */

/* Base Cookie Banner Styles */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.95);
    color: white;
    padding: 20px;
    z-index: 10000;
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
    font-family: inherit;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

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

.cookie-banner.hide {
    transform: translateY(100%);
}

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

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

.cookie-banner-text h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
}

.cookie-banner-text p {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
    opacity: 0.9;
}

.cookie-banner-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.cookie-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: none;
    font-family: inherit;
}

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

.cookie-btn:active {
    transform: translateY(0);
}

/* Modern Theme Styles */
.cookie-banner.modern {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-top: 3px solid #2563eb;
}

.cookie-banner.modern .cookie-banner-text h3 {
    color: #60a5fa;
}

.cookie-banner.modern .cookie-btn-essential {
    background: #374151;
    color: white;
    border: 1px solid #4b5563;
}

.cookie-banner.modern .cookie-btn-essential:hover {
    background: #4b5563;
}

.cookie-banner.modern .cookie-btn-accept {
    background: #2563eb;
    color: white;
}

.cookie-banner.modern .cookie-btn-accept:hover {
    background: #1d4ed8;
}

.cookie-banner.modern .cookie-btn-customize {
    background: transparent;
    color: #60a5fa;
    border: 1px solid #60a5fa;
}

.cookie-banner.modern .cookie-btn-customize:hover {
    background: #60a5fa;
    color: #0f172a;
}

.cookie-banner.modern .cookie-btn-reject {
    background: #dc2626;
    color: white;
}

.cookie-banner.modern .cookie-btn-reject:hover {
    background: #b91c1c;
}

/* Retro Theme Styles */
.cookie-banner.retro {
    background: linear-gradient(135deg, #000000 0%, #1a1a1a 100%);
    border-top: 3px solid #ff6b35;
    font-family: 'Courier New', monospace;
}

.cookie-banner.retro .cookie-banner-text h3 {
    color: #ff6b35;
    text-shadow: 2px 2px 0px #000;
    font-size: 20px;
    font-weight: bold;
}

.cookie-banner.retro .cookie-banner-text p {
    color: #ffffff;
    text-shadow: 1px 1px 0px #000;
}

.cookie-banner.retro .cookie-btn {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 0;
    position: relative;
    overflow: hidden;
}

.cookie-banner.retro .cookie-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.cookie-banner.retro .cookie-btn:hover::before {
    left: 100%;
}

.cookie-banner.retro .cookie-btn-essential {
    background: #333333;
    color: #ffffff;
    border: 2px solid #666666;
    box-shadow: 3px 3px 0px #000;
}

.cookie-banner.retro .cookie-btn-essential:hover {
    background: #444444;
    transform: translateY(-2px);
    box-shadow: 5px 5px 0px #000;
}

.cookie-banner.retro .cookie-btn-accept {
    background: #ff6b35;
    color: #000000;
    border: 2px solid #ff6b35;
    box-shadow: 3px 3px 0px #000;
    text-shadow: 1px 1px 0px #ffffff;
}

.cookie-banner.retro .cookie-btn-accept:hover {
    background: #ff8c42;
    transform: translateY(-2px);
    box-shadow: 5px 5px 0px #000;
}

.cookie-banner.retro .cookie-btn-customize {
    background: transparent;
    color: #ff6b35;
    border: 2px solid #ff6b35;
    box-shadow: 3px 3px 0px #000;
}

.cookie-banner.retro .cookie-btn-customize:hover {
    background: #ff6b35;
    color: #000000;
    transform: translateY(-2px);
    box-shadow: 5px 5px 0px #000;
}

.cookie-banner.retro .cookie-btn-reject {
    background: #dc2626;
    color: #ffffff;
    border: 2px solid #dc2626;
    box-shadow: 3px 3px 0px #000;
    text-shadow: 1px 1px 0px #000;
}

.cookie-banner.retro .cookie-btn-reject:hover {
    background: #b91c1c;
    transform: translateY(-2px);
    box-shadow: 5px 5px 0px #000;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .cookie-banner {
        padding: 15px;
    }
    
    .cookie-banner-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .cookie-banner-text {
        min-width: auto;
    }
    
    .cookie-banner-actions {
        justify-content: center;
        width: 100%;
    }
    
    .cookie-btn {
        flex: 1;
        min-width: 120px;
    }
}

@media (max-width: 480px) {
    .cookie-banner-actions {
        flex-direction: column;
    }
    
    .cookie-btn {
        width: 100%;
    }
}

/* Animation for retro theme */
.cookie-banner.retro .cookie-banner-text h3 {
    animation: retroBlink 2s infinite;
}

@keyframes retroBlink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.7; }
}

/* Accessibility */
.cookie-banner:focus-within {
    outline: 2px solid #60a5fa;
    outline-offset: 2px;
}

.cookie-btn:focus {
    outline: 2px solid #60a5fa;
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .cookie-banner {
        background: #000000;
        color: #ffffff;
        border-top: 3px solid #ffffff;
    }
    
    .cookie-btn {
        border: 2px solid #ffffff;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .cookie-banner {
        transition: none;
    }
    
    .cookie-btn {
        transition: none;
    }
    
    .cookie-banner.retro .cookie-banner-text h3 {
        animation: none;
    }
    
    .cookie-banner.retro .cookie-btn::before {
        display: none;
    }
}

/* Cookie Modal Styles */
.cookie-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cookie-modal-overlay.show {
    opacity: 1;
}

.cookie-modal-overlay.hide {
    opacity: 0;
}

.cookie-modal {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.cookie-modal-overlay.show .cookie-modal {
    transform: scale(1);
}

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

.cookie-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.cookie-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6b7280;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.cookie-modal-close:hover {
    background: #f3f4f6;
}

.cookie-modal-content {
    padding: 24px;
}

.cookie-modal-content p {
    margin: 0 0 24px 0;
    color: #6b7280;
    line-height: 1.5;
}

.cookie-category {
    margin-bottom: 24px;
    padding: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
}

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

.cookie-category-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}

.cookie-category p {
    margin: 0;
    font-size: 14px;
    color: #6b7280;
    line-height: 1.4;
}

.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: #ccc;
    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: #2563eb;
}

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

.cookie-toggle input:disabled + .cookie-toggle-slider {
    background-color: #9ca3af;
    cursor: not-allowed;
}

.cookie-modal-actions {
    padding: 20px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Retro Modal Styles */
.cookie-modal.retro {
    background: #000000;
    color: #ffffff;
    border: 3px solid #ff6b35;
    font-family: 'Courier New', monospace;
}

.cookie-modal.retro .cookie-modal-header {
    border-bottom: 2px solid #ff6b35;
}

.cookie-modal.retro .cookie-modal-header h3 {
    color: #ff6b35;
    text-shadow: 2px 2px 0px #000;
}

.cookie-modal.retro .cookie-modal-close {
    color: #ff6b35;
    font-weight: bold;
}

.cookie-modal.retro .cookie-modal-close:hover {
    background: #ff6b35;
    color: #000000;
}

.cookie-modal.retro .cookie-category {
    background: #111111;
    border: 2px solid #333333;
}

.cookie-modal.retro .cookie-category-header h4 {
    color: #ff6b35;
    text-shadow: 1px 1px 0px #000;
}

.cookie-modal.retro .cookie-category p {
    color: #cccccc;
}

.cookie-modal.retro .cookie-modal-actions {
    border-top: 2px solid #ff6b35;
}

.cookie-modal.retro .cookie-toggle-slider {
    background-color: #333333;
}

.cookie-modal.retro .cookie-toggle input:checked + .cookie-toggle-slider {
    background-color: #ff6b35;
}

.cookie-modal.retro .cookie-toggle input:disabled + .cookie-toggle-slider {
    background-color: #666666;
}

/* Mobile Modal Responsive */
@media (max-width: 768px) {
    .cookie-modal {
        margin: 10px;
        max-height: 90vh;
    }
    
    .cookie-modal-actions {
        flex-direction: column;
    }
    
    .cookie-modal-actions .cookie-btn {
        width: 100%;
    }
}
