/* ============================================
   SISTEMA DE MARCACIÓN - SENACYT
   Estilos principales (replicando React Expo)
   ============================================ */

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: 'Segoe UI', Helvetica, Arial, sans-serif; background: #f9f9f9; color: #333; }
body { display: flex; flex-direction: column; }

/* ---------- Login Page ---------- */
.login-wrapper {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh; width: 100%;
    background: linear-gradient(to top, #1C75BC, #00AEED);
}
.login-card {
    background: #F4F4F4; border-radius: 20px; width: 90%; max-width: 400px;
    min-height: 490px; max-height: 600px; padding: 30px 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3); display: flex; flex-direction: column;
    align-items: center; overflow-y: auto;
}
.login-card img.logo { width: 80%; max-height: 120px; object-fit: contain; margin-bottom: 10px; }
.login-time { font-size: 30px; font-weight: bold; color: #000; text-align: center; margin-top: 20px; }
.login-date { font-size: 16px; color: #000; text-align: center; margin-bottom: 10px; }
.input-group { display: flex; align-items: center; width: 100%; margin: 15px 0; }
.input-group .icon { margin-right: 10px; font-size: 20px; color: #000; }
.input-group input {
    flex: 1; border: none; border-bottom: 1px solid #B2B4B6; background: transparent;
    height: 36px; padding-left: 10px; font-size: 14px; color: #000; outline: none;
}
.input-group input::placeholder { color: #B2B4B6; }
.btn-login {
    margin-top: 30px; width: 100%; max-width: 200px; height: 40px;
    background: #1C75BC; color: #F4F4F4; border: none; border-radius: 5px;
    font-size: 16px; font-weight: bold; cursor: pointer; display: flex;
    align-items: center; justify-content: center;
}
.btn-login:hover { background: #155a8a; }
.btn-login .spinner { width: 20px; height: 20px; border: 3px solid rgba(255,255,255,0.3); border-top-color: #fff; border-radius: 50%; animation: spin .6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-text { color: red; font-size: 14px; margin-top: 12px; text-align: center; }

/* ---------- Header ---------- */
.header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 20px; width: 100%;
    background: linear-gradient(to right, #9dadb9, #F4F4F4);
    border-bottom-left-radius: 20px; border-bottom-right-radius: 20px;
    border: 1px solid #CCC; min-height: 70px;
}
.header img.logo { width: 200px; height: 80px; object-fit: contain; }
.header .menu-btn {
    background: none; border: none; cursor: pointer; font-size: 32px; color: #1C75BC;
}
/* Dropdown menu */
.dropdown-menu {
    display: none; position: fixed; top: 100px; right: 20px;
    background: #fff; border-radius: 5px; padding: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.25); z-index: 1000; min-width: 200px;
}
.dropdown-menu.active { display: block; }
.dropdown-menu .user-row { display: flex; align-items: center; padding: 10px 15px; }
.dropdown-menu .user-row .user-icon { font-size: 30px; color: #1C75BC; margin-right: 10px; }
.dropdown-menu .user-row .user-name { font-size: 16px; color: #1C75BC; }
.dropdown-menu a {
    display: block; padding: 10px 15px; font-size: 16px; color: #1C75BC;
    text-decoration: none; cursor: pointer;
}
.dropdown-menu a:hover { background: #f0f0f0; }
.dropdown-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 999; }
.dropdown-overlay.active { display: block; }

/* ---------- Dashboard ---------- */
.dashboard-wrapper {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    min-height: 100vh; background: #f9f9f9;
}
.content-area { width: 100%; max-width: 900px; padding: 20px; flex: 1; }
.date-display { font-size: 48px; font-weight: 300; color: #333; text-align: center; margin-top: 20px; }
.time-label { font-size: 24px; font-weight: 200; color: #6d6e6f; text-align: center; margin-top: 20px; }
.time-display { font-size: 28px; font-weight: 200; color: #49494a; text-align: center; margin-top: 20px; margin-bottom: 20px; }
.complete-text { font-size: 37px; color: #000; text-align: center; margin: 20px 0; }

/* ---------- Botones de marcación ---------- */
.marca-card {
    border-radius: 10px; padding: 2px; margin-bottom: 15px;
    box-shadow: 0 2px 6px rgba(128,128,130,0.25); overflow: hidden;
}
.marca-card-inner {
    border-radius: 10px; padding: 30px 20px; display: flex; flex-direction: column;
    align-items: center;
}
/* Entrada */
.marca-entrada .marca-card-inner {
    background: linear-gradient(to right, #00AEED, #1C75BC);
}
/* Salida */
.marca-salida .marca-card-inner {
    background: linear-gradient(to right, #00c6c6, #00ab9d);
}
.marca-card-inner h2 { font-size: 25px; font-weight: bold; color: #FFF; text-align: center; margin-bottom: 10px; }
.btn-marcar {
    margin-top: 30px; background: #f4ad37; color: #FFF; border: none;
    border-radius: 8px; padding: 14px 55px; font-size: 18px; font-weight: bold;
    cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,0.25); transition: background .2s;
}
.btn-marcar:hover { background: #ea9935; }

/* ---------- Lista de marcaciones del día ---------- */
.list-section { padding: 20px 0; }
.list-divider { height: 2px; background: #CCC; width: 100%; margin-bottom: 5px; }
.list-header { display: flex; justify-content: space-between; padding: 0 15px; margin-bottom: 10px; }
.list-header span { font-size: 16px; color: #000; }
.list-item { display: flex; justify-content: space-between; padding: 8px 15px; font-size: 16px; }
.list-item .tipo-entrada { color: #1C75BC; }
.list-item .tipo-salida { color: #00ab9d; }

/* ---------- Footer ---------- */
.footer {
    text-align: center; padding: 10px; background: #e5e5e5;
    border-top: 1px solid #ccc; font-size: 12px; color: #777; width: 100%;
}

/* ---------- Modales ---------- */
.modal-overlay {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.3); z-index: 2000; align-items: center; justify-content: center;
}
.modal-overlay.active { display: flex; }

/* Modal de confirmación de salida */
.modal-confirm {
    background: #fff; border-radius: 8px; padding: 25px; min-height: 150px;
    box-shadow: 0 0 10px rgba(0,0,0,0.25); text-align: center; max-width: 400px; width: 90%;
}
.modal-confirm p { font-size: 20px; font-weight: normal; margin-bottom: 30px; }
.modal-confirm .btn-row { display: flex; gap: 10px; justify-content: center; }
.modal-confirm .btn-cancel { flex: 1; padding: 10px; background: red; color: #fff; border: none; border-radius: 8px; font-size: 16px; cursor: pointer; }
.modal-confirm .btn-accept { flex: 1; padding: 10px; background: #00AEED; color: #fff; border: none; border-radius: 8px; font-size: 16px; cursor: pointer; }

/* Modal de reporte */
.modal-report {
    background: #fff; border-radius: 8px; padding: 3%; width: 90%; max-width: 900px;
    max-height: 80vh; position: relative; box-shadow: 0 0 10px rgba(0,0,0,0.25);
    display: flex; flex-direction: column;
}
.modal-report .close-btn {
    position: absolute; top: 15px; right: 15px; background: none; border: none;
    font-size: 28px; color: #F1502E; cursor: pointer; z-index: 1;
}
.modal-report .report-header { text-align: center; margin-bottom: 15px; }
.modal-report .report-header img { max-width: 400px; width: 80%; height: auto; }
.modal-report .report-header h3 { font-size: 22px; margin: 8px 0; }
.modal-report .user-info { margin-bottom: 15px; font-size: 14px; line-height: 1.8; }

/* Tabla de reportes */
.report-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.report-table thead th {
    background: #d8d8d8; padding: 8px; text-align: center; font-weight: bold;
    border: 1px solid #bdb6b6;
}
.report-table tbody td { padding: 6px; text-align: center; border: 1px solid #bdb6b6; }
.report-table-wrapper { max-height: 250px; overflow-y: auto; border: 1px solid #bdb6b6; }

/* ---------- Histórico (con datepickers) ---------- */
.historico-top { display: flex; flex-wrap: wrap; gap: 20px; margin-bottom: 15px; align-items: flex-start; }
.historico-top .user-info { flex: 1; min-width: 200px; }
.historico-top .date-controls { flex: 1; min-width: 200px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.btn-teal {
    background: #7DCDD1; padding: 10px 20px; border: none; border-radius: 8px;
    font-weight: bold; cursor: pointer; width: 60%; max-width: 220px; text-align: center;
}
.btn-teal:hover { background: #6abfc3; }

/* Sub-modal de rango de fechas */
.modal-daterange {
    background: #fff; border-radius: 8px; padding: 20px; width: 400px; max-width: 95%;
    position: relative; box-shadow: 0 0 10px rgba(0,0,0,0.25); text-align: center;
}
.modal-daterange h4 { font-size: 18px; text-transform: uppercase; margin-bottom: 15px; }
.modal-daterange label { display: block; font-weight: 500; text-transform: uppercase; font-size: 14px; margin: 10px 0 5px; }
.modal-daterange input[type="date"] {
    padding: 8px 12px; border: 2px solid #eee; border-radius: 10px; font-size: 14px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); width: 80%; max-width: 260px;
}
.btn-search {
    background: #007AFF; color: #fff; border: none; border-radius: 5px;
    padding: 12px 25px; font-weight: bold; cursor: pointer; margin-top: 18px;
}
.btn-search:hover { background: #005ecb; }

/* ---------- Modal ubicación desactivada ---------- */
.modal-location {
    background: #fff; border-radius: 20px; padding: 25px; text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25); max-width: 360px; width: 90%;
}
.modal-location .loc-icon { font-size: 48px; color: #f80032; margin-bottom: 15px; }
.modal-location p { margin-bottom: 20px; }

/* ---------- Loading overlay ---------- */
.loading-overlay {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: #00AEED; z-index: 3000; align-items: center; justify-content: center;
    flex-direction: column;
}
.loading-overlay.active { display: flex; }
.loading-overlay .spinner-lg {
    width: 50px; height: 50px; border: 5px solid rgba(255,255,255,0.3);
    border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite;
}
.loading-overlay .loading-text { color: #fff; margin-top: 15px; font-size: 16px; }

/* ---------- Spinner inline ---------- */
.spinner-inline {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.4); z-index: 2500; align-items: center; justify-content: center;
    flex-direction: column;
}
.spinner-inline.active { display: flex; }
.spinner-inline .spinner-lg {
    width: 40px; height: 40px; border: 4px solid rgba(255,255,255,0.3);
    border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite;
}
.spinner-inline .spinner-text { color: #fff; font-weight: bold; margin-top: 10px; }

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
    .date-display { font-size: 32px; }
    .historico-top { flex-direction: column; }
    .modal-report { padding: 15px; }
}
