/* ============================================
   Extractor de Horas Extra – All Service
   style.css  |  Dark Mode + Glassmorphism
   ============================================ */

/* --- RESET & BASE --- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0b0e14;
    --bg-card: rgba(255, 255, 255, 0.05);
    --bg-card-hover: rgba(255, 255, 255, 0.08);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.18);
    --text-primary: #e8edf5;
    --text-secondary: #8892a4;
    --text-muted: #5a6270;
    --accent-blue: #4f8cff;
    --accent-green: #34d399;
    --accent-red: #ef4444;
    --accent-amber: #f59e0b;
    --recargo-bg: rgba(239, 68, 68, 0.12);
    --recargo-border: rgba(239, 68, 68, 0.35);
    --font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --radius: 14px;
    --radius-sm: 8px;
    --transition: 0.25s ease;
}

html {
    font-size: 15px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 2rem 1rem;
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(79, 140, 255, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 50%, rgba(52, 211, 153, 0.04) 0%, transparent 60%);
}

/* --- APP CONTAINER --- */
#app {
    width: 100%;
    max-width: 1360px;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* --- GLASS CARD (reutilizable) --- */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: border-color var(--transition), background var(--transition);
}

.glass-card:hover {
    border-color: var(--border-hover);
}

/* --- HEADER --- */
.glass-header {
    text-align: center;
    padding: 1.75rem 1.5rem;
    background: var(--bg-card);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
}

.glass-header h1 {
    font-size: 1.65rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.glass-header .subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* --- BANNER DE AVISO --- */
.banner-aviso {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(239, 68, 68, 0.15));
    border: 1.5px solid rgba(245, 158, 11, 0.75);
    border-left: 6px solid #f59e0b;
    border-radius: var(--radius-sm);
    padding: 1.1rem 1.5rem;
    color: #fbbf24;
    font-size: 0.95rem;
    line-height: 1.65;
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    backdrop-filter: blur(8px);
    box-shadow:
        0 0 24px rgba(245, 158, 11, 0.2),
        inset 0 0 14px rgba(245, 158, 11, 0.06);
    animation: pulseBanner 2.8s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

/* Brillo sutil que recorre el banner */
.banner-aviso::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.04), transparent);
    animation: shineBanner 4s ease-in-out infinite;
    pointer-events: none;
}

.banner-aviso strong {
    color: #ffffff;
    font-weight: 700;
    text-shadow: 0 0 12px rgba(245, 158, 11, 0.3);
}

@keyframes pulseBanner {

    0%,
    100% {
        box-shadow:
            0 0 24px rgba(245, 158, 11, 0.2),
            inset 0 0 14px rgba(245, 158, 11, 0.06);
    }

    50% {
        box-shadow:
            0 0 36px rgba(245, 158, 11, 0.4),
            inset 0 0 20px rgba(245, 158, 11, 0.1);
    }
}

@keyframes shineBanner {

    0%,
    100% {
        left: -100%;
    }

    50% {
        left: 150%;
    }
}

/* --- DROP ZONE --- */
.drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    padding: 3rem 1.5rem;
    cursor: pointer;
    text-align: center;
    transition: border-color var(--transition), background var(--transition), transform 0.2s;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--accent-blue);
    background: rgba(79, 140, 255, 0.06);
    transform: scale(1.01);
}

.drop-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    pointer-events: none;
}

.drop-icon {
    font-size: 2.8rem;
    line-height: 1;
    opacity: 0.7;
}

.drop-zone-content p {
    font-size: 1rem;
    color: var(--text-secondary);
}

.drop-zone-content .drop-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* --- HORARIO CARD --- */
.horario-card {
    padding: 1rem 1.5rem;
}

.horario-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.horario-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.horario-field label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.horario-field input[type="time"] {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.55rem 0.75rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: var(--font-family);
    outline: none;
    transition: border-color var(--transition);
    color-scheme: dark;
}

.horario-field input[type="time"]:focus {
    border-color: var(--accent-blue);
}

/* --- METADATA CARD --- */
.metadata-card {
    transition: opacity 0.35s ease, max-height 0.35s ease, padding 0.35s ease;
    overflow: hidden;
    max-height: 300px;
    opacity: 1;
    padding: 1.5rem;
}

.metadata-card.hidden {
    max-height: 0;
    opacity: 0;
    padding: 0 1.5rem;
    border-width: 0;
    margin: 0;
    pointer-events: none;
}

.metadata-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.metadata-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.metadata-field label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.metadata-field input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.55rem 0.75rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: border-color var(--transition);
}

.metadata-field input:focus {
    border-color: var(--accent-blue);
}

/* --- TABLE SECTION --- */
.table-section {
    padding: 0;
    overflow: hidden;
}

.table-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.table-toolbar h2 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
}

.toolbar-actions {
    display: flex;
    gap: 0.6rem;
}

/* --- BUTTONS --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition), transform 0.15s;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: rgba(79, 140, 255, 0.15);
    border-color: rgba(79, 140, 255, 0.3);
    color: var(--accent-blue);
}

.btn-primary:hover {
    background: rgba(79, 140, 255, 0.25);
    border-color: rgba(79, 140, 255, 0.5);
}

.btn-success {
    background: rgba(52, 211, 153, 0.15);
    border-color: rgba(52, 211, 153, 0.3);
    color: var(--accent-green);
}

.btn-success:hover {
    background: rgba(52, 211, 153, 0.25);
    border-color: rgba(52, 211, 153, 0.5);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--accent-red);
    padding: 0.35rem 0.65rem;
    font-size: 0.8rem;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.5);
}

/* --- TABLE WRAPPER (scroll horizontal) --- */
.table-wrapper {
    overflow-x: auto;
    padding: 0;
}

/* --- TABLA RRHH --- */
#tablaRRHH {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    min-width: 1100px;
}

#tablaRRHH thead {
    position: sticky;
    top: 0;
    z-index: 2;
}

#tablaRRHH th {
    background: rgba(0, 0, 0, 0.4);
    padding: 0.7rem 0.6rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    user-select: none;
}

#tablaRRHH td {
    padding: 0.35rem 0.4rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    vertical-align: middle;
}

#tablaRRHH tbody tr {
    transition: background var(--transition);
}

#tablaRRHH tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* --- INPUTS DENTRO DE LA TABLA --- */
#tablaRRHH input,
#tablaRRHH select {
    width: 100%;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 0.4rem 0.5rem;
    color: var(--text-primary);
    font-size: 0.82rem;
    font-family: var(--font-family);
    outline: none;
    transition: border-color var(--transition), background var(--transition);
}

#tablaRRHH input:hover,
#tablaRRHH select:hover {
    background: rgba(0, 0, 0, 0.45);
}

#tablaRRHH input:focus,
#tablaRRHH select:focus {
    border-color: var(--accent-blue);
    background: rgba(0, 0, 0, 0.5);
}

#tablaRRHH input[readonly] {
    cursor: default;
    opacity: 0.85;
}

/* --- COLUMNAS DE RECARGOS (RN, EDF, ENF, ED, EN) --- */
/* Bloque cálido/rojizo translúcido para columnas de cálculo */

/* Columna RN: borde izquierdo más grueso para marcar inicio del bloque */
#tablaRRHH th:nth-child(8),
#tablaRRHH td:nth-child(8) {
    background: var(--recargo-bg);
    border-left: 2px solid var(--recargo-border);
}

#tablaRRHH th:nth-child(9),
#tablaRRHH td:nth-child(9),
#tablaRRHH th:nth-child(10),
#tablaRRHH td:nth-child(10),
#tablaRRHH th:nth-child(11),
#tablaRRHH td:nth-child(11),
#tablaRRHH th:nth-child(12),
#tablaRRHH td:nth-child(12) {
    background: var(--recargo-bg);
}

/* Inputs dentro de las columnas de recargo */
#tablaRRHH td:nth-child(8) input,
#tablaRRHH td:nth-child(9) input,
#tablaRRHH td:nth-child(10) input,
#tablaRRHH td:nth-child(11) input,
#tablaRRHH td:nth-child(12) input {
    background: rgba(0, 0, 0, 0.25);
    text-align: center;
    font-weight: 500;
}

/* --- COLUMNA ACCIONES --- */
#tablaRRHH th:nth-child(13),
#tablaRRHH td:nth-child(13) {
    text-align: center;
    width: 80px;
    min-width: 80px;
}

#tablaRRHH td:nth-child(13) {
    padding: 0.35rem 0.2rem;
}

/* --- TOAST CONTAINER --- */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 9999;
    pointer-events: none;
}

.toast {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.7rem 1.1rem;
    font-size: 0.85rem;
    color: var(--text-primary);
    pointer-events: auto;
    animation: toastIn 0.3s ease forwards;
    max-width: 360px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.toast.toast-success {
    border-color: rgba(52, 211, 153, 0.4);
}

.toast.toast-error {
    border-color: rgba(239, 68, 68, 0.4);
}

.toast.toast-info {
    border-color: rgba(79, 140, 255, 0.4);
}

.toast.toast-out {
    animation: toastOut 0.25s ease forwards;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(40px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(40px);
    }
}

/* --- UTILITY --- */
.hidden {
    display: none !important;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    body {
        padding: 1rem 0.5rem;
    }

    .glass-header h1 {
        font-size: 1.25rem;
    }

    .drop-zone {
        padding: 2rem 1rem;
    }

    .drop-icon {
        font-size: 2.2rem;
    }

    .table-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar-actions {
        justify-content: stretch;
    }

    .toolbar-actions .btn {
        flex: 1;
        justify-content: center;
    }

    .metadata-grid {
        grid-template-columns: 1fr;
    }

    .toast-container {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
    }

    .toast {
        max-width: 100%;
    }
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
    margin-top: 2.5rem;
    padding: 2.5rem 1.5rem 2rem;
    background: var(--bg-card);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    border-top: 2px solid rgba(59, 130, 246, 0.25);
    position: relative;
}

.site-footer::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-blue), transparent);
    border-radius: 2px;
}

.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.25rem;
    max-width: 600px;
    margin: 0 auto;
}

.footer-logo {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--accent-blue), #60a5fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-tagline {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-top: 0.25rem;
}

.footer-social {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    transition: background var(--transition), color var(--transition), transform var(--transition);
    text-decoration: none;
}

.social-link:hover {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
    transform: translateY(-2px);
}

.social-icon {
    width: 20px;
    height: 20px;
}

.footer-copy p {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* --- FOOTER RESPONSIVE --- */
@media (max-width: 480px) {
    .site-footer {
        padding: 2rem 1rem 1.5rem;
    }

    .footer-logo {
        font-size: 1.15rem;
    }

    .footer-tagline {
        font-size: 0.82rem;
    }

    .social-link {
        width: 36px;
        height: 36px;
    }

    .social-icon {
        width: 18px;
        height: 18px;
    }
}