/* ==========================================================================
   TomoTurnos Modern Design System - Core Variables
   ========================================================================== */
/* --- MODO DEBUG DE ÁREAS SEGURAS --- */

/* Test del Header (StatusBar / Notch) */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: env(safe-area-inset-top);
  background-color: #ff0000 !important; /* ROJO */
  z-index: 999999;
  display: block;
  opacity: 0.5; /* Semi-transparente para que veas si hay algo debajo */
}

/* Test del Footer (Navegación / Gestos) */
body::after {
  content: '';
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: env(safe-area-inset-bottom);
  background-color: #ff0000 !important; /* ROJO */
  z-index: 999999;
  display: block;
  opacity: 0.5;
}

.standard-list-width {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

:root {
    /* Colors - Brand & UI */
    --color-primary: #3498db;
    --color-success: #2ecc71;
    --color-danger: #e74c3c;
    --color-warning: #f39c12;
    --color-info: #9b59b6;

    /* Colors - Text */
    --color-text-main: #334155;
    /* Slate 700 - Softer than pure dark, very elegant */
    --color-text-body: #475569;
    /* Slate 600 - Great for readable body paragraphs */
    --color-text-muted: #53647a;
    /* Slate 500 dark variant - Darker than before to pass contrast ratio */
    --color-text-light: #718096;
    /* Slate 400 dark variant - For subtle hints with better readability */
    --color-text-link: #0d5a96;
    /* Azul oscuro para texto de enlaces — contraste ~5:1 sobre fondos claros (WCAG AA).
       Usar en lugar de --color-primary cuando el color es de TEXTO, no de fondo. */

    /* Colors - Backgrounds & Borders */
    --color-bg-panel: #ffffff;
    --color-bg-hover: #f8f9fa;
    --color-bg-subtle: #f1f5f9;
    /* Slate 100 - Good for disabled/cancelled states */
    --color-bg-alert-pending: #dbeafe;
    --color-bg-alert-success: #dcfce7;
    --color-bg-alert-danger: #fee2e2;
    --color-bg-alert-info: #f8fbff;
    --color-bg-alert-warning: #fffcf5;
    --color-bg-note: #fff3e0;
    --color-border-subtle: #f1f2f6;
    --color-border-card: #eaeaea;

    /* Fonts */
    --font-family-modern: 'Inter', 'Segoe UI', sans-serif;

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    /* Soft, small lift */
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    /* Medium lift for cards */
    --shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.05);
    /* Dashboard panels */
    --shadow-xl: 0 8px 25px rgba(0, 0, 0, 0.1);
    /* Hover states */
    --shadow-colored-primary: 0 2px 4px rgba(52, 152, 219, 0.1);
    --shadow-colored-success: 0 4px 6px rgba(46, 204, 113, 0.3);

    /* Border Radii */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;
    --radius-pill: 50px;

    /* Typography Sizes */
    --font-size-xs: 11px;
    --font-size-sm: 12px;
    --font-size-md: 14px;
    --font-size-lg: 16px;
    --font-size-xl: 18px;
    --font-size-xxl: 22px;
    --font-size-display-1: 1.25rem;
    /* Panel titles */
    --font-size-display-2: 2.2rem;
    /* Dashboard main title */
    --font-size-display-3: 2.4rem;
    /* Big KPI numbers */
    --font-size-display-4: 26px;
    /* Total badges */

    /* Dialog typography standards
       Usar estas variables en TODOS los CSS de diálogos (turno_dialogo.css, etc.)
       para garantizar legibilidad consistente en modales.
       --dlg-font-body : texto principal legible (alerts, list items, inputs, botones, chips, radio labels)
       --dlg-font-label: metadatos pequeños (labels uppercase, badges, títulos de grupo) */
    --dlg-font-body: 15px;
    --dlg-font-label: 13px;
}

/* ==========================================================================
   Calendar grid — color overrides
   ========================================================================== */

/* Time labels above slots: override Bootstrap link blue */
.turno-time-label a,
.turno-time-label a:hover,
.turno-time-label a:focus {
    color: var(--color-text-main);
    text-decoration: none;
}

/* ==========================================================================
   Mobile Bottom Navigation (uso general)
   ========================================================================== */
.app-mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--color-bg-panel);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    z-index: 1000;
    border-top: 1px solid var(--color-border-card);
}

.app-mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--color-text-muted);
    cursor: pointer;
    flex: 1;
    transition: color 0.2s ease;
}

.app-mobile-nav-item i {
    font-size: 20px;
    margin-bottom: 4px;
}

.app-mobile-nav-item span {
    font-size: 12px;
    font-weight: 500;
}

.app-mobile-nav-item.active {
    color: var(--color-primary);
}

body.capacitor-platform-active .app-mobile-nav {
    padding-bottom: env(safe-area-inset-bottom);
}

/* ── Mobile: diálogos full-width + tipografía más grande ─── */
@media (max-width: 767px) {
    :root {
        --font-size-xs: 12px;
        --font-size-sm: 14px;
        --font-size-md: 15px;
        --font-size-lg: 17px;
        --font-size-xl: 20px;
        --dlg-font-body: 16px;
        --dlg-font-label: 14px;
    }

    /* Bootstrap modal → ancho completo + centrado vertical
       Override de style.css:504 que usa left:50% + padding:12px */
    .modal,
    .modal.in {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0 !important;
        padding-right: 0 !important;
        overflow-y: auto !important;
    }
    .modal-dialog,
    .modal.fade .modal-dialog,
    .modal.in .modal-dialog {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        margin: auto !important;
        padding: 0 !important;
        width: calc(100vw - 4px) !important;
        max-width: calc(100vw - 4px) !important;
        min-width: 0 !important;
        transform: none !important;
        -webkit-transform: none !important;
        -ms-transform: none !important;
        flex-shrink: 0;
    }
    .modal-content {
        width: 100% !important;
    }
    .tt-dlg-body {
        max-height: 75vh;
    }

    /* Bootstrap .container raíz de cada state view → 2px de margen horizontal.
       Se excluye .full y .containerFix (del body.html global) para no afectar
       grillas internas como el calendario de turnos.
       Se zerean los .row internos para que sus -15px negativos no desborden. */
    .container:not(.full):not(.containerFix) {
        padding-left: 2px;
        padding-right: 2px;
    }
    .container:not(.full):not(.containerFix) .row {
        margin-left: 0;
        margin-right: 0;
    }

    /* Bootstrap nav-tabs: scroll horizontal en lugar de wrap */
    .nav-tabs {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-bottom: 1px solid #ddd;
        /* ocultar scrollbar pero mantener funcionalidad */
        scrollbar-width: none;
    }
    .nav-tabs::-webkit-scrollbar { display: none; }
    .nav-tabs > li {
        float: none;
        flex-shrink: 0;
    }
    .nav-tabs > li > a {
        margin-bottom: 0;
        white-space: nowrap;
        padding: 8px 10px;
        font-size: 13px;
    }
}