/**
 * 🎬 ANIMACIONES Y EFECTOS PARA LOGIN ISP MAS FIBRA PRO v3.0
 *
 * ARCHIVO: assets/css/login-animations.css
 * PROPÓSITO: Estilos de animaciones y efectos visuales del login
 *
 * FUNCIONALIDADES:
 * - Animación de gradientes de fondo
 * - Efectos glassmorphism
 * - Estilos responsive optimizados
 * - Botón de cambio de tema
 * - Accesibilidad y alto contraste
 * - Optimizaciones móviles
 */

/* ============================= */
/* 🎨 ANIMACIONES DE FONDO */
/* ============================= */

/* Fondo con animación de gradientes */
.login-bg {
    background: var(--bg-primary);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ============================= */
/* 💎 EFECTOS GLASSMORPHISM */
/* ============================= */

/* Glassmorphism optimizado */
.glass {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    /* Ocultar scrollbar del contenedor */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.glass::-webkit-scrollbar {
    display: none; /* Chrome/Safari/Webkit */
}

/* ============================= */
/* ⚡ ANIMACIONES DE ENTRADA */
/* ============================= */

/* Sin animaciones de entrada para mejor rendimiento */
.fade-in {
    opacity: 1;
}

.slide-up {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

/* ============================= */
/* ✨ EFECTOS DE PARTÍCULAS */
/* ============================= */

/* Sin partículas para mejor rendimiento */
.particle {
    display: none;
}

/* ============================= */
/* 📐 LAYOUT RESPONSIVO */
/* ============================= */

/* Responsive optimizado - SIN SCROLL */
body {
    overflow: hidden;
    margin: 0;
    padding: 0;
    height: 100vh;
}

html {
    overflow: hidden;
    height: 100%;
}

.main-container {
    width: 100vw;
    height: 100vh;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================= */
/* 🎨 VARIABLES DE COLOR DINÁMICAS */
/* ============================= */

.text-dynamic-primary {
    color: var(--text-primary);
}

.text-dynamic-secondary {
    color: var(--text-secondary);
}

.text-dynamic-muted {
    color: var(--text-muted);
}

/* ============================= */
/* 🌗 BOTÓN DE CAMBIO DE TEMA */
/* ============================= */

.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-primary);
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ============================= */
/* 📱 OPTIMIZACIONES MÓVILES */
/* ============================= */

@media (max-width: 768px) {
    .main-container {
        padding: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Panel principal más estrecho en móvil */
    .glass {
        max-width: calc(100vw - 24px);
        margin: 0 12px;
        padding: 20px;
    }

    /* Lista de usuarios más compacta en móvil */
    .users-list {
        max-height: 150px !important;
    }

    .user-item {
        padding: 8px;
    }

    .user-avatar {
        width: 32px;
        height: 32px;
    }

    .user-name {
        font-size: 13px;
    }

    .user-details {
        font-size: 11px;
    }

    .particle {
        display: none;
    }

    .theme-toggle {
        top: 16px;
        right: 16px;
        width: 44px;
        height: 44px;
    }
}

/* ============================= */
/* ♿ ACCESIBILIDAD */
/* ============================= */

/* High contrast mode */
@media (prefers-contrast: high) {
    .glass {
        background: rgba(0, 0, 0, 0.8);
        border: 2px solid #ffffff;
    }

    [data-theme="light"] .glass {
        background: rgba(255, 255, 255, 0.95);
        border: 2px solid #000000;
    }
}

/* ============================= */
/* 🎯 UTILIDADES ESPECÍFICAS LOGIN */
/* ============================= */

/* Eliminar scroll innecesario */
.login-container {
    max-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Contenedor de formulario optimizado */
.login-form-container {
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

/* Estados de foco mejorados */
.login-input:focus {
    outline: none;
    border-color: var(--text-primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

/* Botones con efectos suaves */
.login-button {
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
}

.login-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.login-button:active {
    transform: translateY(0);
}

/* ============================= */
/* 🏷️ NETFLIX-STYLE FLOATING LABELS */
/* ============================= */

.netflix-container {
    position: relative;
    width: 100%;
}

.netflix-input {
    width: 100%;
    padding: 20px 12px 10px 12px;
    font-size: 16px;
    font-weight: 400;
    background: #333333;
    border: 1px solid #8C8C8C;
    border-radius: 4px;
    color: #ffffff;
    transition: all 0.15s ease-in-out;
    position: relative;
    z-index: 1;
}

.netflix-label {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: #8C8C8C;
    font-weight: 400;
    pointer-events: none;
    z-index: 2;
    transition: all 0.15s ease-in-out;
    transform-origin: left center;
    background: transparent;
}

/* Label arriba cuando hay focus o contenido */
.netflix-input:focus + .netflix-label,
.netflix-input.has-content + .netflix-label {
    top: 8px;
    font-size: 13px;
    color: #8C8C8C;
    transform: translateY(0) scale(0.85);
}

.netflix-input:focus {
    background: #454545;
    border-color: #ffffff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}

.netflix-input.valid {
    border-color: #10B981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.1);
}

.netflix-input.invalid {
    border-color: #EF4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.1);
}

.netflix-input:focus + .netflix-label {
    color: #ffffff;
}

/* Sin placeholder visible */
.netflix-input::placeholder {
    color: transparent;
    opacity: 0;
}

/* ============================= */
/* 👥 LISTA DE USUARIOS */
/* ============================= */

/* Lista de usuarios - SIN SCROLLBAR VISIBLE */
.users-list {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    backdrop-filter: blur(8px);
    max-height: 300px;
    overflow-y: auto;
    /* Ocultar scrollbar pero mantener funcionalidad */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.users-list::-webkit-scrollbar {
    display: none; /* Chrome/Safari/Webkit */
}

.user-item {
    padding: 10px 12px;
    border-bottom: 1px solid var(--glass-border);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(4px);
}

.user-item.selected {
    background: rgba(59, 130, 246, 0.2);
    border-left: 3px solid #3B82F6;
    transform: translateX(4px);
}

.user-item:focus {
    outline: 2px solid #3B82F6;
    outline-offset: 2px;
    background: rgba(59, 130, 246, 0.1);
}

.user-item:last-child {
    border-bottom: none;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
}

.user-avatar.placeholder {
    background: linear-gradient(45deg, #4F46E5, #7C3AED);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    font-size: 14px;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-details {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.security-badge {
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 600;
}

.security-1 { background: #FEF3C7; color: #92400E; } /* CEO - Oro */
.security-2 { background: #DBEAFE; color: #1E40AF; } /* Admin - Azul */
.security-3 { background: #D1FAE5; color: #065F46; } /* User - Verde */

/* ============================= */
/* 🔧 OPTIMIZACIONES DE RENDIMIENTO */
/* ============================= */

/* Usar transform3d para activar aceleración de hardware */
.animated-element {
    transform: translate3d(0, 0, 0);
    will-change: transform;
}

/* Reducir repaints en elementos que cambian frecuentemente */
.theme-toggle,
.glass {
    will-change: background, border-color;
}

/* Suavizar transiciones globales */
* {
    transition: background-color 0.3s ease,
                border-color 0.3s ease,
                color 0.3s ease,
                opacity 0.3s ease;
}

/* ============================= */
/* 📏 RESPONSIVE ADICIONAL */
/* ============================= */

/* Tablet (641px - 1023px) */
@media (min-width: 641px) and (max-width: 1023px) {
    .theme-toggle {
        width: 46px;
        height: 46px;
    }

    .glass {
        max-width: 400px;
        padding: 24px;
    }
}

/* Desktop large (≥1024px) */
@media (min-width: 1024px) {
    .theme-toggle {
        width: 50px;
        height: 50px;
    }

    .glass {
        max-width: 420px;
        padding: 28px;
    }

    /* Efectos hover más sutiles en desktop */
    .login-button:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    }
}