/* Estilos para el botón de cambio de tema */

/* Botón flotante */
.theme-toggle {
    position: fixed;
    bottom: 100px;
    right: 30px;
    z-index: 9999;
    cursor: pointer;
}

.theme-toggle-button {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #1a1a1a 0%, #333333 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* Estado del botón en tema claro */
.light-theme .theme-toggle-button {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    border: 2px solid #dee2e6;
}

/* Hover effects */
.theme-toggle-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.light-theme .theme-toggle-button:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

/* Iconos */
.theme-toggle-button i {
    font-size: 20px;
    color: #ffffff;
    position: absolute;
    transition: all 0.3s ease;
}

.light-theme .theme-toggle-button i {
    color: #333333;
}

#dark-icon {
    opacity: 1;
}

#light-icon {
    opacity: 1;
    display: none;
}

/* Animación de rotación */
.theme-toggle-button.rotating {
    animation: rotate 0.3s ease-in-out;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Efecto ripple al hacer click */
.theme-toggle-button::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.theme-toggle-button:active::after {
    opacity: 1;
}

/* Tooltip */
.theme-toggle::before {
    content: 'Cambiar tema';
    position: absolute;
    right: 70px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

.theme-toggle:hover::before {
    opacity: 1;
    right: 60px;
}

/* Ajuste para móviles */
@media (max-width: 576px) {
    .theme-toggle {
        bottom: 80px;
        right: 20px;
    }
    
    .theme-toggle-button {
        width: 45px;
        height: 45px;
    }
    
    .theme-toggle-button i {
        font-size: 18px;
    }
    
    .theme-toggle::before {
        display: none;
    }
}

/* Transición suave entre temas */
body,
body * {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease !important;
}

/* Ajustes específicos para elementos que no deben transicionar */
.theme-toggle-button,
.theme-toggle-button * {
    transition: all 0.3s ease !important;
}

/* Estado del botón según el tema */
.dark-theme .theme-toggle-button {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.dark-theme .theme-toggle-button i {
    color: #f39c12;
}

/* Posición alternativa para evitar conflicto con back-to-top */
.theme-toggle {
    bottom: 160px; /* Ajustado para estar arriba del botón back-to-top */
}

/* Animación de entrada */
.theme-toggle {
    animation: slideInRight 0.5s ease-out 1s both;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}