/**
 * ==========================================================================
 * ESTILOS PARA LOGIN DE DOCENTES, ESTUDIANTES Y DIRECTORES
 * ==========================================================================
 * Archivo: auth-login.css
 * Descripción: Estilos compartidos para las páginas de login
 * Última actualización: 11/11/2024
 * ==========================================================================
 */

/* ==========================================================================
   1. ESTILOS GLOBALES
   ========================================================================== */

body {
    height: 100vh;
    margin: 0;
    background-color: #f5f5f5;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    overflow: hidden;
    padding-right: 30px;
}

canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* ==========================================================================
   2. CONTENEDORES DE LOGIN
   ========================================================================== */

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 10px;
}

.login-card {
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    background: linear-gradient(300deg, rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0.60));
}

.login-card .card-body {
    padding: 2rem;
}

.login-card .btn-primary {
    background-color: #00b5d7;
    border: none;
}

.login-card .btn-primary:hover {
    background-color: #009bb5;
}

/* Logo estándar para todos los logins */
.login-logo {
    max-width: 250px;
    width: 100%;
    margin-bottom: 1.5rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* ==========================================================================
   3. CONTENEDORES DE BANNERS (Capacitaciones y Campus Virtual)
   ========================================================================== */

.login-container_ban {
    max-width: 200px;
    margin-top: 55%;
    margin-left: -60px;
}

.login-card_ban {
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7);
    background: linear-gradient(300deg, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.7));
}

.login-card_ban .card-body_ban {
    padding: 2rem;
}

.login-card_ban .btn-primary_ban {
    background-color: transparent;
    border: none;
}

.login-card_ban .btn-primary:hover {
    background-color: #00b5d7;
}

/* Campus Virtual Container */
.login-container_cap {
    max-width: 200px;
    margin-top: 55%;
    margin-left: 10%;
}

.login-card_cap {
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7);
    background: linear-gradient(300deg, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.7));
}

.login-card_cap .card-body_cap {
    padding: 2rem;
}

.login-card_cap .btn-primary_cap {
    background-color: #00b5d7;
    border: none;
}

.login-card_cap .btn-primary:hover {
    background-color: #00b5d7;
}

/* ==========================================================================
   4. FORMULARIO Y LABELS
   ========================================================================== */

.input-group-text {
    cursor: pointer;
}

.form-label,
.form-check-label,
.label-cuenta,
.label-iniciar {
    color: #ffffff;
}

.label_2 {
    color: #00b5d7;
    font-weight: bold;
}

.btn-outline-secondary-custom {
    color: #ffffff;
    border-color: #ffffff;
}

.btn-outline-secondary-custom:hover {
    background-color: #ffffff;
    color: #000000;
}

/* ==========================================================================
   5. GRADIENT BACKGROUNDS (Efectos de hover para banners)
   ========================================================================== */

.gradient-background {
    padding: 10px;
    border-radius: 8px;
    background: linear-gradient(800deg, rgba(0, 0, 0, 0.7), rgba(20, 20, 20, 0.95));
    box-shadow: 4px 4px 4px 8px rgba(0, 0, 0, 0.6);
    display: inline-block;
    transition: background 0.3s ease;
}

.gradient-background:hover {
    background: linear-gradient(800deg, rgba(20, 20, 20, 0.85), rgba(40, 40, 40, 0.98));
}

.gradient-background img {
    border-radius: 4px;
    transition: transform 0.3s ease;
}

.gradient-background:hover img {
    transform: scale(1.05);
}

/* ==========================================================================
   6. BOTONES FLOTANTES (WhatsApp y YouTube)
   ========================================================================== */

/* Contenedor apilado para botones flotantes */
.floating-buttons-stack {
    position: fixed;
    bottom: 24px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    gap: 14px;
}

/* Estilos compartidos de cada item */
.floating-buttons-stack .floating-btn-item {
    text-align: center;
}

/* WhatsApp Button */
.floating-whatsapp-button {
    background-color: #4bcb59;
    color: white;
    border-radius: 50%;
    width: 54px;
    height: 54px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    text-decoration: none;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

/* YouTube Button */
.floating-youtube-button {
    background-color: #ff0024;
    color: white;
    border-radius: 50%;
    width: 54px;
    height: 54px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    text-decoration: none;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    cursor: pointer;
}

/* Hover Effect */
.floating-whatsapp-button:hover,
.floating-youtube-button:hover {
    transform: scale(1.12);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Button Images */
.floating-whatsapp-button img,
.floating-youtube-button img {
    width: 44px;
    height: auto;
}

/* Button Text */
.floating-whatsapp-text,
.floating-youtube-text {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    font-weight: 500;
    color: white;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
}

/* ==========================================================================
   7. VERSIÓN DE LA APLICACIÓN
   ========================================================================== */

.app-version {
    position: fixed;
    bottom: 10px;
    right: 10px;
    background: rgba(239, 237, 237, 0);
    color: rgba(249, 246, 246, 0.918);
    padding: 5px 15px;
    border-radius: 5px;
    font-size: 14px;
    font-family: Arial, sans-serif;
    opacity: 0.8;
}

/* ==========================================================================
   8. MODAL PARA VIDEOS
   ========================================================================== */

.video-modal-overlay {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-modal-overlay.active {
    opacity: 1;
}

.video-modal-box {
    position: relative;
    margin: 6% auto;
    padding: 0;
    width: 90%;
    max-width: 780px;
    background-color: #1a1a2e;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.video-modal-overlay.active .video-modal-box {
    transform: scale(1) translateY(0);
}

.video-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
}

.video-modal-header .video-modal-title {
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.video-modal-header .video-modal-title i {
    font-size: 18px;
    color: #ff4444;
}

.video-modal-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #ffffff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    transition: background 0.2s ease;
}

.video-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.video-modal-body {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    background-color: #000;
}

.video-modal-body iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Responsive: modal más alto en móvil */
@media (max-width: 576px) {
    .video-modal-box {
        width: 95%;
        margin: 15% auto;
        border-radius: 10px;
    }

    .video-modal-header {
        padding: 12px 16px;
    }

    .video-modal-header .video-modal-title {
        font-size: 13px;
    }
}

/* ==========================================================================
   9. RESPONSIVE DESIGN
   ========================================================================== */

/* Tablets y móviles */
@media (max-width: 768px) {
    body {
        justify-content: center;
        padding-right: 0;
    }

    .login-container {
        width: 100%;
        max-width: 600px;
    }

    .serv {
        display: none !important;
    }
}

/* ==========================================================================
   10. ANIMACIONES Y ESTILOS DE ERROR EN LOGIN
   ========================================================================== */

/* Sacudida horizontal sutil para el card */
@keyframes shakeCard {
    0%, 100% { transform: translateX(0); }
    15% { transform: translateX(-4px); }
    30% { transform: translateX(4px); }
    45% { transform: translateX(-4px); }
    60% { transform: translateX(4px); }
    75% { transform: translateX(-2px); }
    90% { transform: translateX(2px); }
}

/* Deslizar hacia abajo + fade in para el mensaje de error */
@keyframes slideDownFadeIn {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Card con error: aplica shake */
.login-card.has-error {
    animation: shakeCard 0.5s ease-in-out;
}

/* Contenedor estilizado del mensaje de error */
.login-error-message {
    background: rgba(220, 38, 38, 0.15);
    border: 1px solid rgba(220, 38, 38, 0.4);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 16px;
    animation: slideDownFadeIn 0.4s ease-out;
}

.login-error-message p {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 2px 0;
    color: #fca5a5;
    font-size: 0.85rem;
}

.login-error-message p i {
    color: #f87171;
    font-size: 1rem;
    flex-shrink: 0;
}

/* Borde rojo + glow en el input con error */
.form-control.input-error {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.25) !important;
}

/* Transición suave en los form-control del login card */
.login-card .form-control {
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Estado de carga del botón de login */
.login-card .btn-primary.btn-loading {
    pointer-events: none;
    opacity: 0.85;
}

.login-card .btn-primary.btn-loading .spinner-border {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

/* Landscape en dispositivos pequeños */
@media (max-height: 500px) and (orientation: landscape) {
    body {
        overflow: auto !important;
        padding-right: 0;
    }

    .container {
        margin-top: 35%;
        height: 100vh !important;
        min-height: 100vh !important;
        display: flex;
        justify-content: center;
        align-items: center;
    }
}
