﻿/* ===================================================
   Acceso — Modo claro (original) + Modo oscuro (.dark-mode)
   =================================================== */

.fade-transition { transition: all .5s ease-in-out; }
.scanner-input { position: absolute; left: -9999px; opacity: 0; width: 1px; height: 1px; }

/* ---------- Waiting ---------- */
.waiting-state { min-height: 100vh; }
.waiting-state .card {
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,.2);
}

/* ============================================
   LIGHT THEME (original)
   ============================================ */
.verification-state {
    background: #f8f9fa;
    min-height: 100vh;
    transition: background .3s, color .3s;
}

/* Navbar */
.verif-navbar {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 60%, #084298 100%);
    transition: background .3s;
}
.verif-navbar .navbar-brand { font-weight: 600; color: #fff; }
.verif-navbar .navbar-text { color: rgba(255,255,255,.9) !important; }

/* Theme toggle */
/* Notifications */
.notification-overlay {
    position: fixed; top: 0; left: 0; right: 0;
    z-index: 1050; padding: 1rem; pointer-events: none;
}
.notification-overlay .alert {
    pointer-events: auto; max-width: 500px; margin: 0 auto;
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
}

/* Foto */
.foto-empleado {
    width: 150px; height: 150px; object-fit: cover; border-radius: 50%;
    border: 4px solid #007bff; display: block;
}
.foto-placeholder {
    width: 150px; height: 150px; background: #f8f9fa; border: 4px solid #dee2e6;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    color: #6c757d; text-align: center;
    transition: background .3s, border-color .3s, color .3s;
}

/* Info card */
.info-card { border-left: 4px solid #007bff; transition: background .3s, border-color .3s; }
.info-card .card-body { transition: background .3s, color .3s; }

/* Employee card header */
.emp-card-header { background: #0d6efd; transition: background .3s; }

/* Cards */
.empleado-info-card {
    height: calc(100vh - 120px); overflow-y: auto;
    transition: background .3s, border-color .3s, color .3s;
}
.historial-info-card {
    height: calc(100vh - 120px); display: flex; flex-direction: column; overflow: hidden;
    transition: background .3s, border-color .3s, color .3s;
}
.historial-info-card .card-body {
    flex: 1; display: flex; flex-direction: column; overflow: hidden; padding: 0;
    transition: background .3s;
}

/* Historial card header */
.hist-card-header { background: #6c757d; transition: background .3s; }

/* Historial table */
.historial-table { font-size: .9rem; transition: color .3s; }
.historial-table thead th {
    position: sticky; top: 0; z-index: 10;
    border-bottom: 2px solid #dee2e6;
    transition: background .3s, color .3s;
}

/* Scroll container */
.historial-scroll-container {
    flex: 1; overflow-y: auto; overflow-x: hidden; min-height: 0;
    border: 1px solid #dee2e6; border-radius: .375rem;
    transition: border-color .3s;
}

/* Scrollbar — light */
.historial-scroll-container::-webkit-scrollbar { width: 8px; }
.historial-scroll-container::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 4px; }
.historial-scroll-container::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 4px; }
.historial-scroll-container::-webkit-scrollbar-thumb:hover { background: #a8a8a8; }

/* Animations */
.updating { animation: pulse 1s infinite; }
@keyframes pulse { 0%,100%{opacity:1;} 50%{opacity:.7;} }
.spinner-border { animation: spin 1s linear infinite; }
@keyframes spin { 0%{transform:rotate(0)} 100%{transform:rotate(360deg)} }

/* Loading */
.loading { opacity: .6; pointer-events: none; }

/* ============================================
   DARK THEME — Acceso-specific overrides
   (Generic dark rules are in site.css)
   ============================================ */
body.dark-mode .verification-state { background: #0d1117 !important; color: #e6edf3; }
body.dark-mode .verif-navbar {
    background: linear-gradient(135deg, #161b22 0%, #0d1117 100%) !important;
    border-bottom: 1px solid #30363d;
}
body.dark-mode .emp-card-header { background: #21262d !important; border-bottom: 1px solid #30363d !important; }
body.dark-mode .hist-card-header { background: #21262d !important; border-bottom: 1px solid #30363d !important; }
body.dark-mode .info-card { border-left-color: #0d6efd !important; }
body.dark-mode .info-card .fw-bold { color: #8b949e !important; }
body.dark-mode .info-card small { color: #8b949e !important; }
body.dark-mode .foto-empleado { border-color: #0d6efd; box-shadow: 0 0 20px rgba(13,110,253,.25); }
body.dark-mode .foto-placeholder { background: #21262d !important; border-color: #30363d !important; color: #484f58 !important; }
body.dark-mode .historial-scroll-container { border-color: #30363d !important; }
body.dark-mode .historial-scroll-container::-webkit-scrollbar-track { background: #0d1117; }
body.dark-mode .historial-scroll-container::-webkit-scrollbar-thumb { background: #30363d; }
body.dark-mode .historial-table tbody td small { color: #8b949e; }
body.dark-mode .historial-table tbody td strong { color: #e6edf3; }

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
    .empleado-info-card, .historial-info-card { max-height: none; }
    .empleado-info-card { height: auto; max-height: 500px; }
    .historial-info-card { height: calc(100vh - 120px); min-height: 400px; }
    .historial-scroll-container { max-height: 300px; }
}
@media (max-width: 767.98px) {
    .historial-scroll-container { height: calc(100vh - 120px); }
    .historial-info-card { height: auto; min-height: 300px; }
}

    .status-indicator.connected {
        background-color: #28a745;
    }

    .status-indicator.disconnected {
        background-color: #dc3545;
    }

    .status-indicator.reconnecting {
        background-color: #ffc107;
    }

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(40, 167, 69, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
    }
}


/*---------------------------------------------------------------------------------------------------------------*/

/* Notificación Success Flotante */
.success-notification-float {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    animation: slideInFromTop 0.6s ease-out;
}

.success-card-float {
    background: linear-gradient(135deg, #28a745, #20c997);
    padding: 1.5rem 2rem;
    border-radius: 15px;
    color: white;
    box-shadow: 0 15px 35px rgba(40, 167, 69, 0.4), 0 5px 15px rgba(0, 0, 0, 0.12);
    position: relative;
    overflow: hidden;
    min-width: 350px;
    max-width: 500px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

    .success-card-float::before {
        content: '';
        position: absolute;
        top: -50%;
        left: -50%;
        width: 200%;
        height: 200%;
        background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.15), transparent);
        transform: rotate(45deg);
        animation: shine 2s ease-in-out infinite;
    }

.success-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    z-index: 2;
}

.success-icon-container {
    flex-shrink: 0;
}

.success-icon-float {
    font-size: 2.5rem;
    color: white;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    animation: iconPulse 1.5s ease-in-out infinite;
}

.success-text {
    flex-grow: 1;
}

.success-title-float {
    font-size: 1.4rem;
    font-weight: bold;
    margin: 0 0 0.3rem 0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    animation: textGlow 2s ease-in-out infinite alternate;
}

.success-message-float {
    font-size: 0.95rem;
    margin: 0;
    opacity: 0.95;
    font-weight: 500;
}

.success-animation-float {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    pointer-events: none;
}

.pulse-ring-float {
    position: absolute;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    height: 60px;
    width: 60px;
    top: -30px;
    left: -30px;
    animation: pulsateFloat 2s ease-out infinite;
}

.pulse-ring-delay {
    animation-delay: 1s;
}

/* Animaciones */
@keyframes slideInFromTop {
    0% {
        transform: translateX(-50%) translateY(-100px);
        opacity: 0;
    }

    100% {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

@keyframes iconPulse {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

@keyframes textGlow {
    0% {
        text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    }

    100% {
        text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3), 0 0 10px rgba(255, 255, 255, 0.3);
    }
}

@keyframes pulsateFloat {
    0% {
        transform: scale(0.3);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 0;
    }
}

@keyframes shine {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }

    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .success-notification-float {
        top: 10px;
        left: 10px;
        right: 10px;
        transform: none;
    }

    .success-card-float {
        min-width: unset;
        padding: 1rem 1.5rem;
    }

    .success-content {
        gap: 0.8rem;
    }

    .success-icon-float {
        font-size: 2rem;
    }

    .success-title-float {
        font-size: 1.2rem;
    }

    .success-message-float {
        font-size: 0.9rem;
    }

    .pulse-ring-float {
        height: 50px;
        width: 50px;
        top: -25px;
        left: -25px;
    }
}