/* ========================================
   SISTEMA DE GESTIÓN DE COOKIES
   ======================================== */

/* Botón Flotante de Configuración */
.btn-flotante-cookies {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-flotante-cookies:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 6px 30px rgba(102, 126, 234, 0.6);
}

.btn-flotante-cookies:active {
    transform: scale(0.95);
}

.btn-flotante-cookies i {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Ocultar el botón flotante cuando el banner está visible */
#panel-cookie:not([style*="display: none"]) ~ .btn-flotante-cookies {
    display: none;
}

/* Banner de Cookies */
.cookie-wrapper {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.aviso-cookie {
    padding: 20px 0;
}

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

.cookie-icon {
    font-size: 40px;
    color: #ffc107;
    flex-shrink: 0;
}

.cookie-icon i {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.cookie-text {
    flex: 1;
    min-width: 250px;
    color: #fff;
}

.cookie-text h4 {
    margin: 0 0 8px 0;
    font-size: 20px;
    font-weight: 600;
    color: #fff;
}

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

.cookie-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

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

.btn-config-cookies {
    background-color: transparent;
    color: #fff;
    border: 2px solid #fff !important;
}

.btn-config-cookies:hover {
    background-color: #fff;
    color: #333;
    transform: translateY(-2px);
}

.btn-config-cookies i {
    margin-right: 5px;
}

.btn-rechazar-cookies {
    background-color: #6c757d;
    color: #fff;
}

.btn-rechazar-cookies:hover {
    background-color: #5a6268;
    transform: translateY(-2px);
}

.btn-aceptar-cookies {
    background-color: #28a745;
    color: #fff;
}

.btn-aceptar-cookies:hover {
    background-color: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

/* Modal de Configuración de Cookies */
.cookies-config-content {
    padding: 10px 0;
}

.cookies-intro {
    font-size: 15px;
    line-height: 1.6;
    color: #555;
    margin-bottom: 25px;
    padding: 15px;
    background-color: #f8f9fa;
    border-left: 4px solid #007bff;
    border-radius: 4px;
}

.cookie-category {
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    background-color: #fff;
    transition: all 0.3s ease;
}

.cookie-category:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #007bff;
}

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

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

.cookie-category-info h5 {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cookie-category-info h5 i {
    color: #007bff;
}

.cookie-category-desc {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #666;
}

.cookie-category-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.status-text {
    font-size: 12px;
    color: #28a745;
    font-weight: 600;
}

/* Switch Toggle */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 30px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked + .slider {
    background-color: #28a745;
}

input:checked + .slider:before {
    transform: translateX(30px);
}

.switch.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.switch.disabled .slider {
    cursor: not-allowed;
    background-color: #28a745;
}

.cookie-policy-link {
    margin-top: 25px;
    padding: 15px;
    background-color: #e7f3ff;
    border-radius: 6px;
    border-left: 4px solid #007bff;
}

.cookie-policy-link p {
    margin: 0;
    font-size: 14px;
    color: #333;
}

.cookie-policy-link i {
    color: #007bff;
    margin-right: 5px;
}

.cookie-policy-link a {
    color: #007bff;
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
}

.cookie-policy-link a:hover {
    border-bottom-color: #007bff;
}

/* Modal Header Personalizado */
#modal-config-cookies .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 6px 6px 0 0;
    border-bottom: none;
}

#modal-config-cookies .modal-title {
    font-size: 22px;
    font-weight: 600;
}

#modal-config-cookies .modal-title i {
    margin-right: 10px;
    animation: rotate 3s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

#modal-config-cookies .close {
    color: white;
    opacity: 1;
    text-shadow: none;
}

#modal-config-cookies .close:hover {
    opacity: 0.8;
}

/* Botones del Modal */
#modal-config-cookies .modal-footer {
    background-color: #f8f9fa;
    border-top: 1px solid #e0e0e0;
    padding: 15px 20px;
}

#modal-config-cookies .modal-footer .btn {
    padding: 10px 20px;
    font-weight: 500;
    transition: all 0.3s ease;
}

#modal-config-cookies .modal-footer .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Responsive Design */
@media (max-width: 768px) {
    .cookie-content {
        flex-direction: column;
        text-align: center;
    }

    .cookie-icon {
        font-size: 35px;
    }

    .cookie-actions {
        width: 100%;
        justify-content: center;
    }

    .cookie-actions .btn {
        flex: 1;
        min-width: 120px;
    }
    
    .cookie-category-header {
        flex-direction: column;
    }

    .cookie-category-toggle {
        flex-direction: row;
        justify-content: space-between;
        width: 100%;
    }

    #modal-config-cookies .modal-footer {
        flex-direction: column;
        gap: 10px;
    }

    #modal-config-cookies .modal-footer .btn {
        width: 100%;
    }

    /* Botón flotante más pequeño en móvil */
    .btn-flotante-cookies {
        width: 50px;
        height: 50px;
        font-size: 20px;
        bottom: 15px;
        right: 15px;
    }
}

@media (max-width: 576px) {
    .cookie-text h4 {
        font-size: 18px;
    }

    .cookie-text p {
        font-size: 13px;
    }

    .cookie-actions .btn {
        font-size: 13px;
        padding: 8px 15px;
    }

    .btn-flotante-cookies {
        width: 45px;
        height: 45px;
        font-size: 18px;
        bottom: 10px;
        right: 10px;
    }
}

/* Estilos adicionales para el enlace en el footer */
#link-configurar-cookies {
    color: inherit;
    text-decoration: none;
    transition: all 0.3s ease;
}

#link-configurar-cookies:hover {
    color: #ffc107;
    text-decoration: none;
}

#link-configurar-cookies i {
    margin-right: 5px;
    animation: rotate-subtle 3s ease-in-out infinite;
}

@keyframes rotate-subtle {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-10deg);
    }
    75% {
        transform: rotate(10deg);
    }
}

