/*
 * Cookie Banner - Compliant with Google requirements
 * Author: Rodrigo Sánchez
 * Copyright (c) 2025 Rodrigo Sánchez
 */

/* Cookie Banner Container */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(17, 17, 17, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px;
    z-index: 10000;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    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 */
.cookie-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

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

.cookie-banner-text h3 {
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cookie-banner-text p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

.cookie-banner-text a {
    color: #00d4ff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.cookie-banner-text a:hover {
    color: #ffffff;
    text-decoration: underline;
}

/* Cookie Banner Actions */
.cookie-banner-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.cookie-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    white-space: nowrap;
}

.cookie-btn-accept {
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 212, 255, 0.3);
}

.cookie-btn-accept:hover {
    background: linear-gradient(135deg, #0099cc 0%, #007aa3 100%);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.4);
    transform: translateY(-1px);
}

.cookie-btn-decline {
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.cookie-btn-decline:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
}

.cookie-btn-settings {
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 13px;
    padding: 8px 16px;
    min-width: auto;
}

.cookie-btn-settings:hover {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.8);
}

/* Cookie Icon */
.cookie-icon {
    font-size: 20px;
    color: #00d4ff;
}

/* Cookie Settings Modal */
.cookie-settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.cookie-settings-modal.show {
    opacity: 1;
    visibility: visible;
}

.cookie-settings-content {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

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

.cookie-settings-header h3 {
    color: #ffffff;
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.cookie-settings-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.cookie-settings-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.cookie-category {
    margin-bottom: 25px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.cookie-category h4 {
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 10px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cookie-category p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

.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: rgba(255, 255, 255, 0.2);
    transition: 0.3s;
    border-radius: 26px;
}

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

.cookie-toggle input:checked + .cookie-toggle-slider {
    background: #00d4ff;
}

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

.cookie-toggle.disabled .cookie-toggle-slider {
    background: rgba(0, 212, 255, 0.5);
    cursor: not-allowed;
}

.cookie-settings-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

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

@media (max-width: 480px) {
    .cookie-banner-text h3 {
        font-size: 16px;
    }
    
    .cookie-banner-text p {
        font-size: 13px;
    }
    
    .cookie-btn {
        padding: 12px 16px;
        font-size: 13px;
    }
    
    .cookie-banner-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
        gap: 10px;
        width: 100%;
    }
    
    /* Configure button spans both columns (full width) and goes on top */
    .cookie-btn-settings {
        grid-column: 1 / -1;
        grid-row: 1;
        width: 100%;
    }
    
    /* Decline button goes on second row, first column */
    .cookie-btn-decline {
        grid-column: 1;
        grid-row: 2;
    }
    
    /* Accept button goes on second row, second column */
    .cookie-btn-accept {
        grid-column: 2;
        grid-row: 2;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cookie-banner.show {
    animation: fadeInUp 0.4s ease-out;
}

/* Accessibility */
.cookie-btn:focus,
.cookie-toggle:focus-within,
.cookie-settings-close:focus {
    outline: 2px solid #00d4ff;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .cookie-banner,
    .cookie-btn,
    .cookie-toggle-slider,
    .cookie-settings-modal {
        transition: none;
    }
    
    .cookie-banner.show {
        animation: none;
    }
}
