@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&family=Outfit:wght@300;400;600;800&display=swap');

:root {
    /* Color Palette - Premium Hospital Vibes */
    --primary-h: 210;
    --primary-s: 100%;
    --primary-l: 25%;
    --primary: hsl(var(--primary-h), var(--primary-s), var(--primary-l));

    --accent-h: 160;
    --accent-s: 80%;
    --accent-l: 45%;
    --accent: hsl(var(--accent-h), var(--accent-s), var(--accent-l));

    --bg-light: #f8fafc;
    --text-dark: #0f172a;
    --text-muted: #64748b;
    --white: #ffffff;

    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

h1,
h2,
h3,
.logo {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
}

/* Header & Nav */
header {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

nav a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 600;
    transition: color 0.3s ease;
}

nav a:hover {
    color: var(--accent);
}

/* Hero Section */
.hero {
    height: 80vh;
    background: linear-gradient(rgba(15, 23, 42, 0.6), rgba(15, 23, 42, 0.6)), url('assets/images/hero.png');
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--white);
    padding: 0 1rem;
}

.hero h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
    background: linear-gradient(to right, #fff, var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.25rem;
    max-width: 600px;
    margin-bottom: 2rem;
}

.btn {
    padding: 1rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background-color: var(--accent);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(20, 184, 166, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 25px rgba(20, 184, 166, 0.5);
}

.btn-primary:active {
    transform: translateY(-1px);
}

/* Sections */
section {
    padding: 5rem 5%;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--primary);
}

/* Cards & Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.card {
    background: var(--white);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: var(--shadow);
    border: 1px solid #edf2f7;
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card,
.hero h1,
.hero p,
.hero .btn {
    animation: fadeIn 0.8s ease-out forwards;
}

.hero h1 {
    animation-delay: 0.2s;
}

.hero p {
    animation-delay: 0.4s;
}

.hero .btn {
    animation-delay: 0.6s;
}

/* Schedules Section */
#schedules {
    background-color: #f1f5f9;
}

#password-prompt {
    animation: fadeIn 0.5s ease-out;
    border: 2px solid var(--accent);
}

#password-prompt h3 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

#password-prompt input {
    text-align: center;
    font-size: 1.1rem;
    letter-spacing: 0.2rem;
}

#schedules-title-trigger {
    cursor: pointer;
    user-select: none;
}

.day-selector {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.day-btn {
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: var(--white);
    color: var(--text-muted);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.day-btn:hover {
    background: #f1f5f9;
    color: var(--primary);
}

.day-btn.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
}

.schedule-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.schedule-table th,
.schedule-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.schedule-table input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.3s;
}

.schedule-table input:focus {
    border-color: var(--accent);
}

.active-schedule {
    background-color: #ecfdf5 !important;
    border-left: 4px solid #10b981;
}

.active-schedule td {
    color: #064e3b;
    font-weight: 500;
}

.finished-schedule {
    background-color: #fef2f2 !important;
    border-left: 4px solid #f87171;
    opacity: 0.8;
}

.finished-schedule td {
    color: #7f1d1d;
}

.status-badge {
    background: #10b981;
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: pulse 2s infinite;
    display: inline-block;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* Footer */
footer {
    background: var(--primary);
    color: var(--white);
    padding: 3rem 5%;
    text-align: center;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background-color: var(--white);
    margin: 5% auto;
    padding: 0;
    border-radius: 20px;
    width: 80%;
    max-width: 900px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow);
    position: relative;
    animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 1.5rem 2rem;
    background: var(--primary);
    color: var(--white);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.modal-header h2 {
    margin: 0;
}

.close-modal {
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close-modal:hover {
    color: var(--accent);
}

.modal-body {
    padding: 2rem;
}

.modal-body h3 {
    color: var(--primary);
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 0.5rem;
}

.lab-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.lab-category {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 15px;
    border-left: 4px solid var(--accent);
}

.lab-category h4 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-weight: 700;
}

.lab-category ul {
    list-style: none;
    padding-left: 0;
}

.lab-category li {
    margin-bottom: 0.5rem;
    position: relative;
    padding-left: 1.2rem;
}

.lab-category li::before {
    content: "•";
    color: var(--accent);
    position: absolute;
    left: 0;
    font-weight: bold;
}

.contact-grid {
    max-width: 900px;
    margin: 0 auto;
    gap: 2rem;
}

.location-card.compact,
.social-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2rem;
    gap: 1rem;
}

.location-icon.small,
.social-icon-header {
    color: var(--accent);
    background: rgba(20, 184, 166, 0.1);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.btn-sm {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
}

.social-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 0.5rem;
}

.btn-facebook,
.btn-instagram {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    font-size: 0.9rem;
    color: white;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.3s, filter 0.3s;
}

.btn-facebook {
    background-color: #1877F2;
}

.btn-instagram {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

.btn-facebook:hover,
.btn-instagram:hover {
    transform: translateY(-3px);
    filter: brightness(1.1);
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.2rem;
    }

    header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    nav ul {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    section {
        padding: 3rem 1rem;
    }

    .section-title {
        font-size: 2rem;
    }

    /* Tablas responsivas */
    #schedules-container {
        overflow-x: auto;
        padding: 1rem;
    }

    .schedule-table {
        min-width: 600px;
        /* Para asegurar que no se aplaste y se pueda hacer scroll horizontal */
    }

    /* Modales responsivos */
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }

    .modal-header h2 {
        font-size: 1.2rem;
    }

    .modal-body {
        padding: 1rem;
    }

    .lab-category {
        padding: 1rem;
    }

    .lab-category p {
        font-size: 1.2rem !important;
        /* Ajuste para textos grandes en modales PAI/UMT */
    }

    .day-btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
}