/* 
===============================================
Centro Médico Don Bosco - Stylesheet
===============================================
PALETA DE COLORES basada en el logo corporativo
Colores Turquesa/Teal profesionales
===============================================
*/

:root {
    /* Paleta Principal - Turquesa/Teal del Logo */
    --primary-color: #4a9d9c;      /* Turquesa principal */
    --primary-dark: #3a7d7c;       /* Turquesa oscuro */
    --primary-light: #6db5b4;      /* Turquesa claro */
    --primary-lighter: #e8f5f5;    /* Turquesa muy claro */
    
    /* Colores Complementarios */
    --secondary-color: #5cb8b3;    /* Teal complementario */
    --accent-color: #3a8d8a;       /* Acento turquesa oscuro */
    
    /* Grises */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Tipografía */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-headings: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    
    /* Espaciado */
    --border-radius: 0.75rem;
    --border-radius-lg: 1rem;
    --border-radius-xl: 1.5rem;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Sombras */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --shadow-primary: 0 4px 14px rgba(74, 157, 156, 0.25);
    --shadow-primary-lg: 0 10px 30px rgba(74, 157, 156, 0.3);
}

/* Override Bootstrap - Primary Color */
:root {
    --bs-primary: var(--primary-color);
    --bs-primary-rgb: 74, 157, 156;
    --bs-link-color: var(--primary-color);
    --bs-link-hover-color: var(--primary-dark);
}

/* Override Bootstrap btn-primary */
.btn-primary {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--primary-color);
    --bs-btn-border-color: var(--primary-color);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--primary-dark);
    --bs-btn-hover-border-color: var(--primary-dark);
    --bs-btn-focus-shadow-rgb: 74, 157, 156;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--primary-dark);
    --bs-btn-active-border-color: var(--primary-dark);
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: var(--primary-color);
    --bs-btn-disabled-border-color: var(--primary-color);
}

/* Override Bootstrap btn-outline-primary */
.btn-outline-primary {
    --bs-btn-color: var(--primary-color);
    --bs-btn-border-color: var(--primary-color);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--primary-color);
    --bs-btn-hover-border-color: var(--primary-color);
    --bs-btn-focus-shadow-rgb: 74, 157, 156;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--primary-color);
    --bs-btn-active-border-color: var(--primary-color);
    --bs-btn-checked-color: #fff;
    --bs-btn-checked-bg: var(--primary-color);
    --bs-btn-checked-border-color: var(--primary-color);
}

/* ===== GENERALES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    color: var(--gray-700);
    line-height: 1.7;
    overflow-x: hidden;
    background-color: #ffffff;
}

html {
    scroll-behavior: smooth;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-headings);
    font-weight: 600;
    line-height: 1.2;
    color: var(--gray-900);
}

p {
    margin-bottom: 1rem;
}

a {
    transition: var(--transition);
    color: var(--primary-color);
}

a:hover {
    color: var(--primary-dark);
    opacity: 0.8;
}

/* ===== NAVBAR ===== */
.navbar {
    padding: 1rem 0;
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.95) !important;
    transition: padding 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Logo con transición de tamaño */
.logo-img {
    height: 80px;
    width: auto;
    transition: height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Estado shrink al hacer scroll */
.navbar.scrolled {
    padding: 0.35rem 0;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1) !important;
    background-color: rgba(255, 255, 255, 0.98) !important;
}

.navbar.scrolled .logo-img {
    height: 44px;
}

.navbar.scrolled .nav-link {
    font-size: 0.9rem;
}

.navbar.scrolled .btn-sm {
    padding: 0.3rem 1rem;
    font-size: 0.85rem;
}

.navbar.sticky-top {
    z-index: 1050 !important;
}

.navbar-brand {
    font-family: var(--font-headings);
    font-size: 1.25rem;
    font-weight: 700;
    transition: var(--transition);
}

.navbar-brand:hover {
    transform: scale(1.02);
}

.nav-link {
    position: relative;
    font-weight: 500;
    color: var(--gray-700) !important;
    padding: 0.5rem 1rem !important;
    transition: var(--transition);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition);
    transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 60%;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color) !important;
}

/* ===== HERO SECTION ===== */
.hero-section {
    padding: 5rem 0 3rem;
    background: linear-gradient(135deg, var(--gray-50) 0%, #ffffff 100%);
    position: relative;
    overflow: hidden;
}

.min-vh-75 {
    min-height: 75vh;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, var(--primary-lighter) 0%, transparent 70%);
    opacity: 0.5;
    border-radius: 50%;
}

.hero-image-wrapper {
    position: relative;
}

.hero-image-wrapper img {
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-xl);
    transition: var(--transition);
}

.hero-image-wrapper:hover img {
    transform: scale(1.02);
}

.floating-card {
    position: absolute;
    bottom: 2rem;
    left: -1rem;
    background: white;
    padding: 1.25rem 1.5rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.icon-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-card {
    text-align: center;
}

/* ===== BOTONES ===== */
.btn {
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius-lg);
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: var(--shadow-primary);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-primary-lg);
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.rounded-pill {
    border-radius: 50rem !important;
}

/* ===== FEATURE CARDS ===== */
.feature-card {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.icon-box {
    width: 80px;
    height: 80px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.icon-box-large {
    width: 100px;
    height: 100px;
    border-radius: var(--border-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
}

/* ===== ESPECIALIDADES ===== */
.specialty-card {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    text-align: center;
    transition: var(--transition);
    border: 2px solid var(--gray-100);
    height: 100%;
}

.specialty-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, #ffffff 0%, var(--primary-lighter) 100%);
}

.specialty-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    transition: var(--transition);
}

.specialty-card:hover .specialty-icon {
    transform: scale(1.1);
    background: var(--primary-color) !important;
}

.specialty-card:hover .specialty-icon i {
    color: white !important;
}

/* ===== CTA SECTION ===== */
.cta-section {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
}

/* ===== CONTACT CARDS ===== */
.contact-card {
    background: white;
    padding: 2.5rem;
    border-radius: var(--border-radius-lg);
    transition: var(--transition);
    border: 2px solid var(--gray-100);
}

.contact-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

/* ===== DOCTOR PROFILE CARDS ===== */
.doctor-profile-card {
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    transition: var(--transition);
}

.doctor-profile-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl) !important;
}

.doctor-image-wrapper {
    position: relative;
    overflow: hidden;
    height: 280px;
}

.doctor-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.doctor-profile-card:hover .doctor-image-wrapper img {
    transform: scale(1.05);
}

.specialty-badge {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: var(--shadow-md);
}

.coming-soon-card {
    background: linear-gradient(135deg, var(--gray-50) 0%, #ffffff 100%);
    border: 2px dashed var(--gray-300);
    transition: var(--transition);
}

.coming-soon-card:hover {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-lighter) 0%, #ffffff 100%);
}

/* ===== PAGE HEADER ===== */
.page-header {
    padding: 4rem 0;
}

.breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: '›';
    font-size: 1.2rem;
}

/* ===== FILTROS ===== */
#specialtyFilters .btn {
    transition: var(--transition);
}

#specialtyFilters .btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

#specialtyFilters .btn:hover {
    transform: translateY(-2px);
}

/* ===== FOOTER ===== */
footer a:hover {
    color: var(--primary-color) !important;
}

/* ===== BACK TO TOP ===== */
#backToTop {
    position: fixed;
    bottom: 11rem;
    right: 1.75rem;
    width: 50px;
    height: 50px;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1060;
    padding: 0;
    border: none;
    transition: var(--transition);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    font-size: 1.2rem;
}

#backToTop:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-primary-lg) !important;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
}

#backToTop.show {
    display: flex;
    animation: fadeInUp 0.3s ease-in-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== BADGES ===== */
.badge {
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
}

.bg-primary-subtle {
    background-color: var(--primary-lighter) !important;
}

/* ===== TOP BAR ===== */
.top-bar {
    background: var(--primary-color) !important;
}

.top-bar a:hover {
    opacity: 0.8;
}

/* ===== UTILIDADES ===== */
.text-primary {
    color: var(--primary-color) !important;
}

/* NOTE: .bg-primary no se sobreescribe aquí — Bootstrap usa rgba(--bs-primary-rgb, opacity)
   para que bg-opacity-10 funcione correctamente. El valor se controla desde :root */

.border-primary {
    border-color: var(--primary-color) !important;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 991.98px) {
    .hero-section {
        padding: 3rem 0 2rem;
    }
    
    .floating-card {
        position: static;
        margin-top: 2rem;
    }
    
    .display-3 {
        font-size: 2.5rem;
    }
    
    .display-4 {
        font-size: 2rem;
    }
}

@media (max-width: 767.98px) {
    .specialty-card {
        padding: 1.5rem;
    }
    
    .doctor-image-wrapper {
        height: 240px;
    }
    
    .icon-box-large {
        width: 80px;
        height: 80px;
        font-size: 2rem;
    }
}

@media (max-width: 575.98px) {
    .hero-section {
        padding: 2rem 0 1.5rem;
    }
    
    .btn-lg {
        padding: 0.625rem 1.25rem;
        font-size: 1rem;
    }
    
    .display-3 {
        font-size: 2rem;
    }
    
    .lead {
        font-size: 1.1rem;
    }
}

/* ===== ANIMACIONES ===== */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.animate-pulse {
    animation: pulse 2s infinite;
}

.card:hover {
    cursor: pointer;
}

/* ===== ACCESIBILIDAD ===== */
*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

button:focus-visible {
    outline: 2px solid var(--primary-color);
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* ===== FORMS ===== */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(74, 157, 156, 0.25);
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* ===== ALERTS ===== */
.alert-primary {
    background-color: var(--primary-lighter);
    border-color: var(--primary-light);
    color: var(--primary-dark);
}

/* ===== PROGRESS ===== */
.progress-bar {
    background-color: var(--primary-color);
}


/* ===== DOCTOR AVATAR (sin foto — ícono de especialidad) ===== */
.doctor-avatar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--av-1, var(--primary-color)) 0%, var(--av-2, var(--primary-dark)) 100%);
}

.doctor-avatar::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 28% 22%, rgba(255, 255, 255, 0.20), transparent 58%);
    pointer-events: none;
}

.doctor-avatar .doctor-avatar-icon {
    position: relative;
    z-index: 1;
    font-size: 5.5rem;
    color: #ffffff;
    opacity: 0.96;
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.18));
    transition: var(--transition);
}

.doctor-profile-card:hover .doctor-avatar .doctor-avatar-icon {
    transform: scale(1.08);
}

.doctor-image-wrapper.doctor-avatar .specialty-badge {
    z-index: 2;
}

/* Acentos de color por especialidad (armónicos con la marca) */
.doctor-avatar--traumatologia     { --av-1: #3b82f6; --av-2: #2563eb; }
.doctor-avatar--cirugia           { --av-1: #4a9d9c; --av-2: #3a7d7c; }
.doctor-avatar--ginecologia       { --av-1: #ec4899; --av-2: #be2d72; }
.doctor-avatar--cardiologia       { --av-1: #f05252; --av-2: #dc2626; }
.doctor-avatar--ecografia         { --av-1: #06b6d4; --av-2: #0e7490; }
.doctor-avatar--clinica           { --av-1: #10b981; --av-2: #047857; }
.doctor-avatar--mastologia        { --av-1: #a855f7; --av-2: #7c3aed; }
.doctor-avatar--dermatologia      { --av-1: #f97316; --av-2: #c2410c; }
.doctor-avatar--endocrinologia    { --av-1: #14b8a6; --av-2: #0f766e; }
.doctor-avatar--gastroenterologia { --av-1: #84cc16; --av-2: #4d7c0f; }
.doctor-avatar--reumatologia      { --av-1: #64748b; --av-2: #334155; }
.doctor-avatar--nutricion         { --av-1: #22c55e; --av-2: #15803d; }
.doctor-avatar--kinesiologia      { --av-1: #f59e0b; --av-2: #d97706; }
.doctor-avatar--cabeza-cuello     { --av-1: #6366f1; --av-2: #4f46e5; }
.doctor-avatar--neumonologia      { --av-1: #0ea5e9; --av-2: #0369a1; }


/* ===== BLOQUE ILUSTRATIVO (reemplazo de foto stock decorativa) ===== */
.illus-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    min-height: 320px;
    padding: 2rem;
    text-align: center;
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
}

.illus-card i {
    font-size: 4.5rem;
    opacity: 0.95;
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.18));
}

.illus-card span {
    font-family: var(--font-headings);
    font-weight: 600;
    font-size: 1.15rem;
    max-width: 22ch;
}

/* Las animaciones laterales de AOS (fade-left/right) y la fila .g-5 del perfil se salían del
   ancho en el celular y la página se corría de costado. clip (no hidden): no crea un contenedor
   de scroll, así el navbar sticky-top sigue funcionando. */
html, body { overflow-x: clip; }

/* Filtros de especialidad en el celular: una fila que se desliza de costado (con 15
   especialidades, apilados ocupaban más de una pantalla antes del primer médico).
   !important porque .flex-wrap / .justify-content-center de Bootstrap lo llevan. */
@media (max-width: 767.98px) {
    #specialtyFilters {
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: .25rem;
    }
    #specialtyFilters::-webkit-scrollbar { display: none; }
    #specialtyFilters .btn { flex: 0 0 auto; white-space: nowrap; }
}

/* Footer simple (médicos / perfil) sobre fondo oscuro: los títulos heredaban --gray-900 y
   .text-muted de Bootstrap 5.3 es gris oscuro → quedaba todo invisible. */
footer.bg-dark h5 { color: #fff; }
footer.bg-dark .text-muted { color: rgba(255, 255, 255, .72) !important; }
footer.bg-dark a.text-muted:hover { color: #fff !important; }

/* Galería: el título de cada foto siempre visible (antes aparecía sólo con hover, que no
   existe en el celular). */
.gallery-item .gallery-overlay { transform: none; padding: 2.5rem 1.25rem 1rem; }
.gallery-item .gallery-overlay h5 { margin: 0; }
