/* ------------------------------------------------------------------
   Sticky footer: el footer siempre queda al fondo de la pagina
   independientemente del alto del contenido. Tecnica flexbox
   recomendada oficialmente por Materialize.
   ------------------------------------------------------------------ */
body {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    background-image: url('../img/admin_bg_hospital.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

main {
    flex: 1 0 auto;
}

/* Margen superior por defecto del container de contenido */
main .main-container {
    margin-top: 2rem;
}

/* ------------------------------------------------------------------
   Pagina de login: centrar el formulario vertical y horizontalmente
   ------------------------------------------------------------------ */
body.body-login {
    background-image: url('../img/medical_bg_minimalist.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

body.body-login main {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

body.body-login main .main-container {
    margin-top: 0;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

/* ------------------------------------------------------------------
   Landing page
   ------------------------------------------------------------------ */

/* Hero: Parallax Text Container */
.hero {
    position: relative;
    min-height: 520px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-align: center;
    padding: 3rem 1rem;
    background-color: rgba(0, 77, 64, 0.4); /* Teal transparent overlay */
}

.hero h1 {
    font-weight: 300;
    font-size: 3.8rem;
    margin-bottom: 1rem;
    letter-spacing: 2px;
}

.hero .hero-tagline {
    font-size: 1.4rem;
    font-weight: 300;
    max-width: 760px;
    margin: 0 auto 2.5rem auto;
    line-height: 1.6;
}

.hero .btn-large {
    padding: 0 2.5rem;
}

@media (max-width: 600px) {
    .hero h1 { font-size: 2.4rem; }
    .hero .hero-tagline { font-size: 1.1rem; }
}

/* Seccion con titulo centrado */
.section-title {
    text-align: center;
    margin: 3.5rem 0 0.5rem 0;
    font-weight: 400;
    color: #00695c;
}

.section-subtitle {
    text-align: center;
    color: #546e7a;
    margin-bottom: 2.5rem;
    font-size: 1.1rem;
}

/* Cards de caracteristicas con imagen */
.feature-card {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.feature-card:hover {
    transform: translateY(-6px);
}

.feature-card .card-image img {
    height: 200px;
    object-fit: cover;
}

/* Cards de workflow (pasos numerados) */
.workflow-step {
    text-align: center;
    padding: 1.5rem 1rem;
}

.workflow-step .step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background-color: #00796b;
    color: #fff;
    font-size: 2rem;
    font-weight: 300;
    margin-bottom: 1rem;
    box-shadow: 0 4px 12px rgba(0, 121, 107, 0.3);
}

.workflow-step h5 {
    color: #00695c;
    font-weight: 500;
}

/* Card panel CTA final */
.cta-panel {
    background: linear-gradient(135deg, #00695c 0%, #26a69a 100%) !important;
    color: #fff;
    text-align: center;
    padding: 3rem 2rem !important;
    margin-top: 3rem;
    border-radius: 8px;
}

.cta-panel h4 {
    color: #fff;
    font-weight: 300;
    margin-bottom: 1rem;
}

.cta-panel p {
    font-size: 1.15rem;
    margin-bottom: 2rem;
}

/* ------------------------------------------------------------------
   Border-radius global: tarjetas y tablas
   ------------------------------------------------------------------ */

/* Cards y card-panels de Materialize */
.card,
.card-panel {
    border-radius: 8px !important;
}

/* El card-action hereda las esquinas inferiores del card */
.card .card-action {
    border-radius: 0 0 8px 8px !important;
}

/* Tablas: contenedor responsive y tabla en sí */
.responsive-table,
table.striped,
table.highlight,
table.bordered,
table {
    border-radius: 8px;
    overflow: hidden;   /* recorta las celdas de las esquinas */
}

/* ------------------------------------------------------------------
   Transiciones suaves al cambiar de tema
   ------------------------------------------------------------------ */
body,
body .card,
body .card-panel,
body nav,
body .page-footer,
body input,
body textarea,
body select {
    transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

/* ------------------------------------------------------------------
   TEMA OSCURO (se activa anadiendo la clase .theme-dark al <body>)
   ------------------------------------------------------------------ */

/* Fondo general y texto */
.theme-dark body {
    background-color: #121212;
    color: #e0e0e0;
    background-image: linear-gradient(rgba(18, 18, 18, 0.85), rgba(18, 18, 18, 0.85)), url('../img/admin_bg_hospital.png');
}

.theme-dark body main {
    background-color: #121212;
}

/* Tipografia general */
.theme-dark body h1,
.theme-dark body h2,
.theme-dark body h3,
.theme-dark body h4,
.theme-dark body h5,
.theme-dark body h6 {
    color: #e0f2f1;
}

.theme-dark body p,
.theme-dark body span,
.theme-dark body li,
.theme-dark body label {
    color: #cfd8dc;
}

/* Navbar: un teal mas oscuro */
.theme-dark body nav.teal.darken-2 {
    background-color: #00363a !important;
}

/* Footer */
.theme-dark body footer.page-footer {
    background-color: #00252a !important;
}

/* Cards */
.theme-dark body .card {
    background-color: #1e1e1e;
    color: #e0e0e0;
    box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.4),
                0 1px 5px 0 rgba(0, 0, 0, 0.3),
                0 3px 1px -2px rgba(0, 0, 0, 0.5);
}

.theme-dark body .card .card-content {
    color: #e0e0e0;
}

.theme-dark body .card .card-title {
    color: #ffffff !important;
}

.theme-dark body .card .card-content p,
.theme-dark body .card .card-content span {
    color: #b0bec5;
}

.theme-dark body .card .card-action {
    background-color: #181818;
    border-top-color: rgba(255, 255, 255, 0.08);
}

.theme-dark body .card .card-action a:not(.btn):not(.btn-large):not(.btn-floating) {
    color: #4db6ac !important;
}

/* Card panels */
.theme-dark body .card-panel {
    background-color: #1e1e1e;
    color: #e0e0e0;
}

/* Card panels de colores claros: oscurecerlos */
.theme-dark body .card-panel.teal.lighten-5 {
    background-color: #0d332f !important;
    color: #b2dfdb !important;
}

.theme-dark body .card-panel.teal.lighten-5 h4,
.theme-dark body .card-panel.teal.lighten-5 h5 {
    color: #80cbc4 !important;
}

.theme-dark body .card-panel.teal.lighten-5 p {
    color: #b2dfdb !important;
}

.theme-dark body .card-panel.orange.lighten-4 {
    background-color: #3d2a15 !important;
}

.theme-dark body .card-panel.orange.lighten-4 h5,
.theme-dark body .card-panel.orange.lighten-4 p {
    color: #ffcc80 !important;
}

.theme-dark body .card-panel.green.lighten-4 {
    background-color: #14361c !important;
    color: #a5d6a7 !important;
}

.theme-dark body .card-panel.red.lighten-4 {
    background-color: #3b1616 !important;
    color: #ef9a9a !important;
}

.theme-dark body .card-panel.blue.lighten-4 {
    background-color: #0d253f !important;
    color: #90caf9 !important;
}

/* Inputs */
.theme-dark body .input-field input[type=text],
.theme-dark body .input-field input[type=email],
.theme-dark body .input-field input[type=password],
.theme-dark body .input-field input[type=number],
.theme-dark body .input-field input[type=search],
.theme-dark body .input-field textarea {
    color: #e0e0e0;
    border-bottom: 1px solid #546e7a;
    box-shadow: none;
}

.theme-dark body .input-field input[type=text]:focus,
.theme-dark body .input-field input[type=email]:focus,
.theme-dark body .input-field input[type=password]:focus,
.theme-dark body .input-field input[type=number]:focus,
.theme-dark body .input-field input[type=search]:focus,
.theme-dark body .input-field textarea:focus {
    border-bottom: 1px solid #4db6ac !important;
    box-shadow: 0 1px 0 0 #4db6ac !important;
}

.theme-dark body .input-field input[disabled] {
    color: #78909c !important;
    border-bottom-style: dashed;
}

.theme-dark body .input-field label {
    color: #90a4ae;
}

.theme-dark body .input-field input:focus + label,
.theme-dark body .input-field label.active {
    color: #4db6ac !important;
}

.theme-dark body .input-field .prefix {
    color: #90a4ae;
}

.theme-dark body .input-field .prefix.active {
    color: #4db6ac;
}

.theme-dark body .helper-text {
    color: #78909c;
}

/* Colores "teal-text text-darken-X" -> aclararlos en dark */
.theme-dark body .teal-text,
.theme-dark body .teal-text.text-darken-1,
.theme-dark body .teal-text.text-darken-2,
.theme-dark body .teal-text.text-darken-3,
.theme-dark body .teal-text.text-darken-4 {
    color: #4db6ac !important;
}

/* Texto secundario gris */
.theme-dark body .grey-text.text-darken-1,
.theme-dark body .grey-text.text-darken-2,
.theme-dark body .grey-text.text-darken-3 {
    color: #90a4ae !important;
}

/* Landing: section titles y subtitles */
.theme-dark body .section-title {
    color: #4db6ac;
}

.theme-dark body .section-subtitle {
    color: #90a4ae;
}

.theme-dark body .workflow-step h5 {
    color: #4db6ac;
}

/* Login: mantener el card bien legible */
.theme-dark body.body-login .card {
    background-color: #1e1e1e;
}

/* ------------------------------------------------------------------
   Badges de estado para Citas
   ------------------------------------------------------------------ */
.estado-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: capitalize;
    white-space: nowrap;
}

.estado-programada  { background-color: #bbdefb; color: #0d47a1; }
.estado-confirmada  { background-color: #b2ebf2; color: #006064; }
.estado-en_curso    { background-color: #ffe0b2; color: #e65100; }
.estado-finalizada  { background-color: #c8e6c9; color: #1b5e20; }
.estado-completada  { background-color: #c8e6c9; color: #1b5e20; }
.estado-cancelada   { background-color: #eceff1; color: #455a64; }
.estado-no_asistio  { background-color: #ffcdd2; color: #b71c1c; }

/* Variantes en modo oscuro con mejor contraste */
.theme-dark body .estado-programada  { background-color: #0d2a4a; color: #90caf9; }
.theme-dark body .estado-confirmada  { background-color: #0d3a3f; color: #80deea; }
.theme-dark body .estado-en_curso    { background-color: #3d2a15; color: #ffcc80; }
.theme-dark body .estado-finalizada  { background-color: #14361c; color: #a5d6a7; }
.theme-dark body .estado-completada  { background-color: #14361c; color: #a5d6a7; }
.theme-dark body .estado-cancelada   { background-color: #263238; color: #b0bec5; }
.theme-dark body .estado-no_asistio  { background-color: #3b1616; color: #ef9a9a; }

/* Botones del tema: el boton de toggle usa estos colores */
.theme-toggle-btn {
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 0 15px;
    height: 64px;
    display: inline-flex;
    align-items: center;
    font-size: 1.5rem;
}

.theme-toggle-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.theme-toggle-btn i {
    font-size: 1.6rem;
}

/* Mostrar el icono correcto segun el tema activo */
.theme-toggle-btn .icon-dark { display: inline-block; }
.theme-toggle-btn .icon-light { display: none; }
.theme-dark .theme-toggle-btn .icon-dark { display: none; }
.theme-dark .theme-toggle-btn .icon-light { display: inline-block; }

/* ------------------------------------------------------------------
   Mejoras Responsivas (Moviles)
   ------------------------------------------------------------------ */

/* Ajustar altura del hero en moviles */
@media (max-width: 600px) {
    .parallax-container {
        height: 350px !important;
    }
    
    main .main-container {
        margin-top: 1rem;
    }

    h4 {
        font-size: 1.8rem;
    }

    .brand-logo {
        font-size: 1.4rem !important;
    }
}

/* Tablas responsivas: mejorar legibilidad de las cabeceras generadas */
.responsive-table thead tr th {
    color: #4db6ac;
}

/* Estilos para SideNav en Modo Oscuro */
.theme-dark body .sidenav {
    background-color: #1e1e1e;
}

.theme-dark body .sidenav li a {
    color: #cfd8dc;
}

.theme-dark body .sidenav li a i.material-icons {
    color: #4db6ac;
}

.theme-dark body .sidenav li a:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.theme-dark body .sidenav .divider {
    background-color: rgba(255, 255, 255, 0.1);
}

.theme-dark body .sidenav li .user-view .name,
.theme-dark body .sidenav li .user-view .email {
    color: #fff;
}

/* Ajustes finales de espaciado en moviles para formularios */
@media only screen and (max-width: 600px) {
    .input-field .prefix ~ input,
    .input-field .prefix ~ textarea,
    .input-field .prefix ~ label,
    .input-field .prefix ~ .helper-text {
        margin-left: 2.5rem;
        width: calc(100% - 2.5rem);
    }

    .input-field .prefix {
        font-size: 1.5rem;
    }
}

/* ------------------------------------------------------------------
   Dashboard del medico
   ------------------------------------------------------------------ */

/* Encabezado del dashboard */
.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    background: var(--card-bg, #fff);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.12);
}

/* Tarjetas de estadisticas */
.dashboard-stats .card.stat-card {
    border-radius: 8px;
}

.dashboard-stats .card.stat-card .card-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
}

.stat-icon-wrap {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon-wrap .material-icons {
    font-size: 2rem;
}

.stat-body {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.85rem;
    color: #757575;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Encabezado de la agenda */
.agenda-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

/* Columna de hora en la agenda */
.agenda-time {
    white-space: nowrap;
}

/* Badges de estado en la agenda */
.badge-estado {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
}

/* Scroll horizontal en tablas de agenda en moviles */
.agenda-table-wrap {
    overflow-x: auto;
}

/* Dark mode: dashboard */
.theme-dark .dashboard-header {
    background: var(--card-bg-dark, #2a2a2a);
}

@media only screen and (max-width: 600px) {
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .stat-number {
        font-size: 2rem;
    }
}


