/* ==========================================================================
   MedSim IA - Plataforma de Simulación Clínica para Estudiantes de Medicina
   Estética inspirada en la imagen de referencia (Dark Navy + Neon Medical Glow)
   ========================================================================== */

:root {
    --bg-deep: #050f28;
    --bg-panel: #0b193d;
    --bg-card: rgba(14, 30, 70, 0.82);
    --bg-card-hover: rgba(20, 44, 98, 0.95);
    --border-soft: rgba(96, 165, 250, 0.22);
    --border-glow: #38bdf8;
    --accent-cyan: #38bdf8;
    --accent-pink: #f472b6;
    --accent-green: #10b981;
    --accent-amber: #f59e0b;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
}

body {
    background: radial-gradient(circle at 50% 15%, #0d2150 0%, #051029 65%, #03091a 100%);
    color: var(--text-main);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.footer-med {
    margin-top: auto;
    background: rgba(4, 11, 30, 0.94);
    border-top: 1px solid rgba(56, 189, 248, 0.2);
    padding: 1.15rem 0;
    font-size: 0.86rem;
    color: var(--text-muted);
}

.footer-med a {
    color: var(--accent-cyan);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-med a:hover {
    color: #7dd3fc;
    text-decoration: underline;
}

/* Navbar */
.navbar-med {
    background: rgba(5, 15, 40, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(56, 189, 248, 0.2);
    padding: 0.75rem 1.25rem;
}

.brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    font-weight: 700;
    font-size: 1.2rem;
    color: #fff;
    text-decoration: none;
    letter-spacing: 0.3px;
}

.brand-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0ea5e9, #6366f1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.55);
}

/* Grilla de los 12 Sistemas del Cuerpo Humano (Punto de partida) */
.system-card {
    position: relative;
    background: rgba(9, 22, 54, 0.75);
    border: 2px solid rgba(100, 150, 230, 0.2);
    border-radius: 20px;
    padding: 1.35rem 1rem 1.1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
}

.system-card:hover {
    transform: translateY(-5px);
    background: rgba(15, 34, 82, 0.92);
    border-color: rgba(56, 189, 248, 0.55);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45), 0 0 22px rgba(56, 189, 248, 0.22);
}

.system-card.selected {
    background: linear-gradient(180deg, rgba(16, 45, 105, 0.95) 0%, rgba(10, 26, 65, 0.95) 100%);
    border-color: #38bdf8;
    box-shadow: 0 0 28px rgba(56, 189, 248, 0.48), inset 0 0 15px rgba(56, 189, 248, 0.18);
}

.system-check-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.75);
    border: 2px solid rgba(148, 163, 184, 0.45);
    color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.system-card.selected .system-check-badge {
    background: #10b981;
    border-color: #34d399;
    color: #fff;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.7);
}

.system-icon-wrapper {
    width: 126px;
    height: 126px;
    margin: 0 auto 0.75rem;
    border-radius: 50%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s ease, filter 0.25s ease;
    filter: drop-shadow(0 0 12px rgba(96, 165, 250, 0.35));
}

.system-card:hover .system-icon-wrapper,
.system-card.selected .system-icon-wrapper {
    transform: scale(1.06);
    filter: drop-shadow(0 0 20px rgba(56, 189, 248, 0.75));
}

.system-icon-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

.system-title {
    font-size: 1.18rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 0.4rem;
    letter-spacing: 0.2px;
}

.system-pathologies {
    font-size: 0.78rem;
    color: #94a3b8;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.system-card.selected .system-pathologies {
    color: #cbd5e1;
}

/* Barra flotante inferior de inicio de consulta */
.floating-start-bar {
    position: sticky;
    bottom: 16px;
    z-index: 1020;
    background: rgba(8, 22, 56, 0.95);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(56, 189, 248, 0.45);
    border-radius: 16px;
    padding: 0.9rem 1.4rem;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.65), 0 0 25px rgba(56, 189, 248, 0.22);
}

/* Tarjetas generales y formularios oscuros */
.glass-panel {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-soft);
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.form-control-dark,
.form-select-dark {
    background-color: rgba(6, 15, 38, 0.85) !important;
    border: 1px solid rgba(100, 150, 230, 0.35) !important;
    color: #f8fafc !important;
    border-radius: 10px;
}

.form-control-dark:focus,
.form-select-dark:focus {
    border-color: #38bdf8 !important;
    box-shadow: 0 0 0 0.2rem rgba(56, 189, 248, 0.25) !important;
    color: #fff !important;
}

.form-control-dark::placeholder {
    color: #64748b !important;
}

/* ==========================================================================
   Simulador de Chat con Paciente IA
   ========================================================================== */

.chat-container {
    height: 540px;
    display: flex;
    flex-direction: column;
    background: rgba(6, 15, 38, 0.9);
    border: 1px solid rgba(56, 189, 248, 0.28);
    border-radius: 18px;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.chat-bubble {
    max-width: 82%;
    padding: 0.85rem 1.1rem;
    border-radius: 16px;
    font-size: 0.95rem;
    line-height: 1.48;
    position: relative;
    word-wrap: break-word;
}

.chat-bubble.estudiante {
    align-self: flex-end;
    background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
    color: #ffffff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.chat-bubble.paciente {
    align-self: flex-start;
    background: rgba(20, 38, 82, 0.95);
    border: 1px solid rgba(96, 165, 250, 0.3);
    color: #f1f5f9;
    border-bottom-left-radius: 4px;
}

.chat-bubble.laboratorio {
    align-self: flex-start;
    max-width: 90%;
    background: rgba(6, 46, 46, 0.92);
    border: 1px solid #10b981;
    border-left: 5px solid #10b981;
    color: #ecfdf5;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.88rem;
}

.chat-sender-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
    opacity: 0.85;
}

/* Botones laterales del Simulador: Examen Físico y Lamparita (Pistas) */
.btn-side-tool {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    width: 100%;
    padding: 0.9rem 1.1rem;
    border-radius: 14px;
    text-align: left;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-examen-fisico {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.2) 0%, rgba(37, 99, 235, 0.25) 100%);
    border: 1px solid rgba(56, 189, 248, 0.5);
    color: #e0f2fe;
}

.btn-examen-fisico:hover {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.38) 0%, rgba(37, 99, 235, 0.42) 100%);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 0 18px rgba(56, 189, 248, 0.35);
}

.btn-lamparita {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(217, 119, 6, 0.25) 100%);
    border: 1px solid rgba(251, 191, 36, 0.55);
    color: #fef3c7;
}

.btn-lamparita:hover {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.38) 0%, rgba(217, 119, 6, 0.42) 100%);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 0 18px rgba(245, 158, 11, 0.45);
}

.lamparita-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(245, 158, 11, 0.25);
    border: 1px solid #fbbf24;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #fde047;
    box-shadow: 0 0 14px rgba(250, 204, 21, 0.45);
}

.timer-badge {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(56, 189, 248, 0.45);
    border-radius: 12px;
    padding: 0.45rem 0.95rem;
    font-family: 'Consolas', monospace;
    font-size: 1.15rem;
    font-weight: 700;
    color: #38bdf8;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Ficha de Estudio (Ver Resumen) */
.study-sheet {
    background: #ffffff;
    color: #1e293b;
    border-radius: 14px;
    padding: 2rem;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.45);
}

.study-sheet h3,
.study-sheet h4,
.study-sheet h5 {
    color: #0f172a;
}

.study-section-box {
    background: #f8fafc;
    border-left: 4px solid #0284c7;
    border-radius: 8px;
    padding: 1rem 1.2rem;
    margin-bottom: 1rem;
}

@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
    }
    .no-print {
        display: none !important;
    }
    .study-sheet {
        box-shadow: none !important;
        padding: 0 !important;
    }
}
