/* ==========================================================================
   custom_styles.css
   Shared custom styles for the clinical control system.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Patient Navigation Tabs (navigator-horizontal.html)
   -------------------------------------------------------------------------- */
.patient-nav-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
    border-bottom: 1px solid #dee2e6;
    padding-left: 10px;
}

.p-tab {
    padding: 10px 20px;
    text-decoration: none;
    color: #555;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.p-tab:hover {
    background: #e9ecef;
    color: #000;
}

.p-tab.active {
    background: #fff;
    color: #2c3e50;
    border-top: 3px solid #3498db;
    margin-top: -2px;
    position: relative;
    z-index: 1;
}

.p-tab i {
    font-size: 1rem;
}

/* --------------------------------------------------------------------------
   Clinical Stepper / Patient Workflow (navigator-horizontal.html)
   -------------------------------------------------------------------------- */
.patient-workflow-card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.08);
    overflow: hidden;
    margin: 10px 10px 20px 10px;
}

.workflow-header {
    background: #f8f9fa;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.workflow-stepper {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.25rem;
    gap: 1rem;
}

.step-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
}

.step-icon-wrapper {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
    z-index: 2;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.step-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.25);
}

.step-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.25);
}

.step-active {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.25);
}

.step-neutral {
    background: #e5e7eb;
    color: #9ca3af;
}

.step-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.2rem;
}

.step-desc {
    font-size: 0.72rem;
    color: #6b7280;
    line-height: 1.25;
}

.step-desc .small-type {
    font-size: 0.65rem;
    font-weight: 500;
    color: #9ca3af;
}

.step-line {
    position: absolute;
    top: 21px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: #e5e7eb;
    z-index: 1;
}

.step-item:last-child .step-line {
    display: none;
}

.step-item.completed .step-line {
    background: #10b981;
}

@media (max-width: 768px) {
    .workflow-stepper {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
    }
    
    .step-item {
        flex-direction: row;
        text-align: left;
        width: 100%;
        gap: 1rem;
    }
    
    .step-icon-wrapper {
        margin-bottom: 0;
    }
    
    .step-line {
        left: 21px;
        top: 42px;
        width: 2px;
        height: calc(100% + 1.5rem);
    }
}

/* --------------------------------------------------------------------------
   Clinical Dashboard Metrics and Styles (home.html)
   -------------------------------------------------------------------------- */
.dashboard-stat-card {
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: #ffffff;
    transition: all 0.25s ease-in-out;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.dashboard-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.06);
}

.stat-blue {
    border-top: 4px solid #2563eb !important;
}
.stat-success {
    border-top: 4px solid #059669 !important;
}
.stat-danger {
    border-top: 4px solid #dc2626 !important;
}

.dashboard-icon-bg {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.search-section {
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
}

.action-card {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 16px;
    padding: 1.5rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03);
}

.action-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px -5px rgba(0, 0, 0, 0.08);
    border-color: #3b82f6;
}

.action-icon-bg {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 1.25rem;
    color: white;
}

.bg-blue-gradient {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

.bg-indigo-gradient {
    background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
}

.bg-purple-gradient {
    background: linear-gradient(135deg, #a855f7 0%, #7e22ce 100%);
}

.bg-rose-gradient {
    background: linear-gradient(135deg, #f43f5e 0%, #be123c 100%);
}

.recent-patient-item {
    transition: background 0.2s;
    border-radius: 10px;
}

.recent-patient-item:hover {
    background: #f8fafc;
}

/* --------------------------------------------------------------------------
   HTMX Autocomplete Search Dropdown
   -------------------------------------------------------------------------- */
.patient-search-dropdown-list {
    max-height: 380px;
    overflow-y: auto;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
}

.patient-search-item {
    transition: background-color 0.2s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
}

.patient-search-item:hover {
    background-color: #f8fafc !important;
}

/* --------------------------------------------------------------------------
   Soft UI Action Pills (Clínico Moderno)
   -------------------------------------------------------------------------- */
.btn-soft-success {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.85rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #047857 !important;
    background-color: #ecfdf5 !important;
    border: 1px solid #a7f3d0 !important;
    border-radius: 50rem !important;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-soft-success:hover {
    color: #065f46 !important;
    background-color: #d1fae5 !important;
    border-color: #6ee7b7 !important;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.25);
    transform: translateY(-1px);
}

.btn-soft-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.85rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #1d4ed8 !important;
    background-color: #eff6ff !important;
    border: 1px solid #bfdbfe !important;
    border-radius: 50rem !important;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-soft-primary:hover {
    color: #1e40af !important;
    background-color: #dbeafe !important;
    border-color: #93c5fd !important;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.25);
    transform: translateY(-1px);
}

.btn-soft-purple {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.85rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #4f46e5 !important;
    background-color: #f5f3ff !important;
    border: 1px solid #c7d2fe !important;
    border-radius: 50rem !important;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-soft-purple:hover {
    color: #3730a3 !important;
    background-color: #ede9fe !important;
    border-color: #a5b4fc !important;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.25);
    transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   Patient Detail Views Sidebar and Anchors (historyinformation, optorecorddetail, medicalrecordinformation)
   -------------------------------------------------------------------------- */
.section-anchor {
    scroll-margin-top: 100px;
}

#menu .nav-link.active,
.sidebar .nav-link.active {
    background-color: #0d6efd !important;
    color: white !important;
    border-left: 4px solid #ffc107 !important;
}

/* Estilo premium personalizado para el Navbar principal */
.navbar-custom {
    background-color: rgba(15, 23, 42, 0.95) !important; /* Slate oscuro semi-transparente */
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.navbar-custom .navbar-brand {
    font-weight: 700;
    letter-spacing: 0.5px;
    background: linear-gradient(45deg, #60a5fa, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.navbar-custom .nav-link {
    font-weight: 500;
    transition: color 0.2s ease;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

.navbar-custom .nav-link:hover {
    color: #60a5fa !important;
}

.navbar-custom .nav-link.active {
    color: #3b82f6 !important;
    font-weight: 600;
}

.navbar-custom .dropdown-menu {
    background-color: #0f172a !important; /* Slate sólido */
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    margin-top: 10px;
}

.navbar-custom .dropdown-item {
    font-weight: 500;
    padding: 0.5rem 1.25rem;
    transition: all 0.2s ease;
}

.navbar-custom .dropdown-item:hover {
    background-color: rgba(59, 130, 246, 0.1) !important;
    color: #60a5fa !important;
}

.navbar-custom .dropdown-divider {
    border-color: rgba(255, 255, 255, 0.08) !important;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.section-anchor.container-fluid {
    padding-top: 30px;
    padding-bottom: 30px;
}

.listing .row.align-items-center.mb-4 {
    display: none !important;
}

.listing .card.mb-4 {
    display: none !important;
}

#menu .nav-item {
    margin-bottom: 5px;
}

#menu .nav-link {
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
    padding-left: 20px;
}

#menu .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
    padding-left: 25px;
}

/* Estilo premium para el Footer */
.footer-custom {
    background-color: #0b0f19 !important; /* Deep Slate oscuro */
    color: #94a3b8 !important; /* Slate grisáceo suave */
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.9rem;
}

.footer-custom h5, .footer-custom h6 {
    letter-spacing: 0.5px;
}

.footer-custom a {
    color: #94a3b8;
    transition: all 0.2s ease;
}

.footer-custom a:hover {
    color: #60a5fa !important;
    text-decoration: none;
    padding-left: 4px; /* sutil efecto de movimiento */
}


/* --------------------------------------------------------------------------
   Select2 Bootstrap 5 Integration & Height Alignment
   -------------------------------------------------------------------------- */
.select2-container {
    width: 100% !important;
}

.select2-container--default .select2-selection--single {
    height: 38px !important;
    min-height: 38px !important;
    padding: 0.375rem 0.75rem !important;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da !important;
    border-radius: 0.375rem !important;
    display: flex !important;
    align-items: center !important;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: normal !important;
    padding-left: 0 !important;
    padding-right: 1.5rem !important;
    color: #212529 !important;
    width: 100%;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #6c757d !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px !important;
    position: absolute !important;
    top: 1px !important;
    right: 8px !important;
    width: 20px !important;
}

.select2-container--default .select2-selection--single .select2-selection__clear {
    margin-right: 18px !important;
    font-size: 1.1rem !important;
    color: #6c757d !important;
}

.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: #86b7fe !important;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25) !important;
}

/* =========================================================
   Select2 Multiple Choice Styling (Especialidades Médicas)
   ========================================================= */
.select2-container--default .select2-selection--multiple {
    background-color: #fff !important;
    border: 1px solid #ced4da !important;
    border-radius: 0.375rem !important;
    min-height: 42px !important;
    padding: 4px 8px !important;
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 4px !important;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default.select2-container--open .select2-selection--multiple {
    border-color: #86b7fe !important;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25) !important;
}

/* Badges / Chips de Especialidades (Estilo Pastilla Azul Bootstrap 5) */
.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: #e7f1ff !important;
    border: 1px solid #b6d4fe !important;
    color: #084298 !important;
    border-radius: 50rem !important;
    padding: 3px 12px 3px 26px !important;
    margin: 2px !important;
    font-size: 0.85rem !important;
    font-weight: 500 !important;
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
}

/* Botón 'X' de remover en cada pastilla */
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: #084298 !important;
    border: none !important;
    background: transparent !important;
    position: absolute !important;
    left: 8px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    font-size: 1rem !important;
    font-weight: bold !important;
    line-height: 1 !important;
    cursor: pointer !important;
    padding: 0 !important;
    margin: 0 !important;
    transition: color 0.15s ease-in-out;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: #dc3545 !important;
    background: transparent !important;
}

/* Campo de entrada/búsqueda dentro de la caja múltiple */
.select2-container--default .select2-selection--multiple .select2-search--inline {
    flex-grow: 1 !important;
    display: inline-block !important;
}

.select2-container--default .select2-selection--multiple .select2-search--inline .select2-search__field {
    margin-top: 0 !important;
    font-family: inherit !important;
    font-size: 0.95rem !important;
    height: 30px !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

/* --------------------------------------------------------------------------
   Agenda Inteligente del Doctor (Citas de Hoy: Atendiendo AHORA & Siguiente Turno)
   -------------------------------------------------------------------------- */
.active-consultation-card {
    background-color: #f0f9ff !important;
    border: 2px solid #0284c7 !important;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.15) !important;
    border-radius: 12px !important;
}

.next-turn-card {
    border-left: 4px solid #f59e0b !important;
    background-color: #ffffff !important;
    border-radius: 10px !important;
}

.completed-turn-card {
    background-color: #f8fafc !important;
    opacity: 0.78;
    border-radius: 10px !important;
}

@keyframes statusPulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.85; }
    100% { transform: scale(1); opacity: 1; }
}

.pulse-badge {
    animation: statusPulse 2s infinite ease-in-out;
}

/* --------------------------------------------------------------------------
   Inputs Numéricos y Steppers Clínicos: Ocultar Spinners Nativos del Navegador
   -------------------------------------------------------------------------- */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}

input[type="number"] {
    -moz-appearance: textfield !important;
}

/* Micro-animación y apariencia premium para botones de incremento/decremento */
.input-group > .btn-outline-secondary {
    border-color: #cbd5e1;
    color: #475569;
    background-color: #f8fafc;
    transition: all 0.15s ease-in-out;
}

.input-group > .btn-outline-secondary:hover {
    background-color: #e2e8f0;
    color: #1e293b;
    border-color: #94a3b8;
}

.input-group > .btn-outline-secondary:active {
    background-color: #cbd5e1;
    transform: scale(0.96);
}

/* --------------------------------------------------------------------------
   Pills de Checklist / Multiselect con Checkmark Dinámico
   -------------------------------------------------------------------------- */
.checklist-pill-group .btn-check + .btn {
    transition: all 0.18s ease-in-out;
    border-width: 1.5px;
    cursor: pointer;
}

.checklist-pill-group .btn-check:not(:checked) + .btn .check-icon {
    display: none;
}

.checklist-pill-group .btn-check:not(:checked) + .btn:hover {
    background-color: #e7f1ff;
    color: #0d6efd;
    border-color: #0d6efd;
}

.checklist-pill-group .btn-check:checked + .btn {
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(13, 110, 253, 0.35) !important;
}

.checklist-pill-group .btn-check:checked + .btn .check-icon {
    display: inline-block !important;
}



