/**
 * Estilos del Sistema de Control de Cookies
 * Comedia Para Eventos
 *
 * Paleta de colores:
 * - Coral: #FC4A1A
 * - Fresh (verde): #4ABDAC
 * - Negro: #000000
 * - Blanco: #FFFFFF
 */

/* ============================================
   OVERLAY
   ============================================ */
.cookie-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(3px);
}

.cookie-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   BANNER DE COOKIES
   ============================================ */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1a1a1a;
    color: #ffffff;
    z-index: 99999;
    box-shadow: 0 -5px 30px rgba(0, 0, 0, 0.3);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 90vh;
    overflow-y: auto;
}

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

.cookie-banner-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

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

.cookie-banner-text h3 {
    font-size: 1.3rem;
    margin: 0 0 0.5rem 0;
    color: #FC4A1A;
    font-weight: 700;
}

.cookie-banner-text p {
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0 0 0.5rem 0;
    color: #cccccc;
}

.cookie-link {
    color: #4ABDAC;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.cookie-link:hover {
    color: #5fd4c4;
    text-decoration: underline;
}

.cookie-banner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

/* ============================================
   BOTONES
   ============================================ */
.cookie-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    white-space: nowrap;
}

.cookie-btn-accept {
    background: #4ABDAC;
    color: #000000;
}

.cookie-btn-accept:hover {
    background: #000000;
    color: #ffffff;
    transform: translateY(-2px);
}

.cookie-btn-reject {
    background: #ffffff;
    color: #000000;
    border: 2px solid #555555;
}

.cookie-btn-reject:hover {
    background: #000000;
    border-color: #000000;
    color: #ffffff;
}

.cookie-btn-config {
    background: transparent;
    color: #4ABDAC;
    border: 2px solid #4ABDAC;
}

.cookie-btn-config:hover {
    background: #4ABDAC;
    color: #000000;
}

.cookie-btn-save {
    background: #FC4A1A;
    color: #ffffff;
}

.cookie-btn-save:hover {
    background: #e03d10;
    transform: translateY(-2px);
}

/* ============================================
   MODAL DE CONFIGURACIÓN
   ============================================ */
.cookie-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: #ffffff;
    border-radius: 20px;
    width: 90%;
    max-width: 650px;
    max-height: 90vh;
    overflow: hidden;
    z-index: 100000;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.cookie-modal.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.cookie-modal-header {
    background: #FC4A1A;
    color: #ffffff;
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    border-radius: 20px 20px 0 0;
}

.cookie-modal-header h2 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
}

.cookie-modal-close {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.cookie-modal-close:hover {
    opacity: 1;
    transform: scale(1.1);
}

.cookie-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    max-height: calc(90vh - 180px);
}

.cookie-modal-intro {
    color: #555555;
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0 0 1.5rem 0;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eeeeee;
}

.cookie-categories {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cookie-category {
    background: #f8f8f8;
    border-radius: 12px;
    padding: 1.25rem;
    border: 1px solid #eeeeee;
    transition: border-color 0.2s ease;
}

.cookie-category:hover {
    border-color: #dddddd;
}

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

.cookie-category-info {
    flex: 1;
}

.cookie-category-info h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.05rem;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.cookie-category-info p {
    margin: 0;
    font-size: 0.9rem;
    color: #666666;
    line-height: 1.5;
}

.cookie-badge-required {
    background: #FC4A1A;
    color: #ffffff;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
}

.cookie-category-cookies {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px dashed #dddddd;
    font-size: 0.85rem;
    color: #888888;
}

.cookie-category-cookies strong {
    color: #666666;
}

/* ============================================
   TOGGLE SWITCH
   ============================================ */
.cookie-toggle {
    position: relative;
    display: inline-block;
    width: 56px;
    height: 30px;
    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: #cccccc;
    transition: 0.3s;
    border-radius: 30px;
}

.cookie-toggle-slider:before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: 3px;
    bottom: 3px;
    background-color: #ffffff;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

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

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

.cookie-toggle input:disabled + .cookie-toggle-slider {
    background-color: #4ABDAC;
    opacity: 0.7;
    cursor: not-allowed;
}

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

/* ============================================
   FOOTER DEL MODAL
   ============================================ */
.cookie-modal-footer {
    padding: 1.25rem 1.5rem;
    background: #f5f5f5;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.75rem;
    border-top: 1px solid #eeeeee;
    flex-shrink: 0;
    border-radius: 0 0 20px 20px;
}

/* ============================================
   BOTÓN FLOTANTE
   ============================================ */
.cookie-floating-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 50px;
    height: 50px;
    background: #4ABDAC;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 9997;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(74, 189, 172, 0.4);
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
}

.cookie-floating-btn.visible {
    opacity: 1;
    transform: scale(1);
}

.cookie-floating-btn:hover {
    background: #000000;
    transform: scale(1.1);
}

.cookie-floating-btn svg {
    width: 24px;
    height: 24px;
    color: #ffffff;
}

/* Tooltip del botón flotante */
.cookie-floating-btn::before {
    content: 'Configuración de cookies';
    position: absolute;
    left: 60px;
    top: 50%;
    transform: translateY(-50%);
    background: #1a1a1a;
    color: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.cookie-floating-btn::after {
    content: '';
    position: absolute;
    left: 52px;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-right-color: #1a1a1a;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.cookie-floating-btn:hover::before,
.cookie-floating-btn:hover::after {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .cookie-banner {
        max-height: 85vh;
    }

    .cookie-banner-content {
        padding: 1rem;
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .cookie-banner-text {
        min-width: auto;
        text-align: center;
    }

    .cookie-banner-text h3 {
        font-size: 1.1rem;
        margin-bottom: 0.4rem;
    }

    .cookie-banner-text p {
        font-size: 0.85rem;
        line-height: 1.5;
        margin-bottom: 0.3rem;
    }

    .cookie-link {
        font-size: 0.8rem;
    }

    .cookie-banner-actions {
        justify-content: center;
        flex-direction: column;
        gap: 0.5rem;
    }

    .cookie-btn {
        width: 100%;
        text-align: center;
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .cookie-modal {
        width: 95%;
        max-height: 95vh;
        border-radius: 15px;
        top: 50%;
        transform: translate(-50%, -50%) scale(0.9);
    }

    .cookie-modal.active {
        transform: translate(-50%, -50%) scale(1);
    }

    .cookie-modal-header {
        padding: 1rem 1.25rem;
        flex-shrink: 0;
    }

    .cookie-modal-header h2 {
        font-size: 1.2rem;
    }

    .cookie-modal-body {
        padding: 1.25rem;
        max-height: calc(95vh - 160px);
    }

    .cookie-category {
        padding: 1rem;
    }

    .cookie-category-header {
        flex-direction: column;
        gap: 0.75rem;
    }

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

    .cookie-modal-footer {
        padding: 1rem 1.25rem;
        flex-direction: column;
    }

    .cookie-modal-footer .cookie-btn {
        width: 100%;
    }

    .cookie-floating-btn {
        bottom: 15px;
        left: 15px;
        width: 45px;
        height: 45px;
    }

    .cookie-floating-btn svg {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    .cookie-banner {
        max-height: 80vh;
    }

    .cookie-banner-content {
        padding: 0.85rem;
        gap: 0.75rem;
    }

    .cookie-banner-text h3 {
        font-size: 1rem;
    }

    .cookie-banner-text p {
        font-size: 0.8rem;
        line-height: 1.4;
    }

    .cookie-link {
        font-size: 0.75rem;
    }

    .cookie-banner-actions {
        gap: 0.4rem;
    }

    .cookie-btn {
        font-size: 0.85rem;
        padding: 0.65rem 0.75rem;
    }

    .cookie-category-info h4 {
        font-size: 1rem;
    }

    .cookie-category-info p {
        font-size: 0.85rem;
    }

    .cookie-modal-body {
        max-height: calc(80vh - 140px);
    }
}

/* ============================================
   ANIMACIONES ADICIONALES
   ============================================ */
@keyframes cookiePulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(74, 189, 172, 0.4);
    }
    50% {
        box-shadow: 0 4px 25px rgba(74, 189, 172, 0.6);
    }
}

.cookie-floating-btn.visible {
    animation: cookiePulse 3s ease-in-out infinite;
    animation-delay: 2s;
}

.cookie-floating-btn:hover {
    animation: none;
}
