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

/* ===== VARIABLES ===== */
:root {
    --navy:        #03205c;
    --navy-mid:    #0a4fa8;
    --blue:        #1272d4;
    --blue-light:  #e8f1fd;
    --teal:        #0d9488;
    --teal-light:  #e6f7f5;
    --purple:      #7c3aed;
    --purple-light:#f0ebfe;
    --amber:       #d97706;
    --amber-light: #fef3e2;
    --white:       #ffffff;
    --bg:          #f3f7fe;
    --text-dark:   #0f1f3d;
    --text-mid:    #3d5070;
    --text-muted:  #7a8fac;
    --border:      rgba(10, 79, 168, 0.1);
    --shadow-sm:   0 2px 10px rgba(3,32,92,0.06);
    --shadow-md:   0 6px 24px rgba(3,32,92,0.1);
    --shadow-lg:   0 16px 48px rgba(3,32,92,0.14);
    --radius-sm:   8px;
    --radius-md:   14px;
    --radius-lg:   20px;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--text-dark);
    scroll-behavior: smooth;
    background-color: var(--bg);
    background-image:
        linear-gradient(160deg, rgba(232,241,253,0.95) 0%, rgba(230,247,245,0.85) 50%, rgba(240,235,254,0.8) 100%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Cg fill='none' stroke='%230a4fa8' stroke-opacity='0.04' stroke-width='1'%3E%3Crect x='15' y='15' width='70' height='70' rx='6'/%3E%3Ccircle cx='50' cy='50' r='22'/%3E%3Cpath d='M50 28v44M28 50h44'/%3E%3C/g%3E%3C/svg%3E");
    background-size: cover, 100px 100px;
    background-attachment: fixed, fixed;
    position: relative;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at 10% 10%, rgba(10,79,168,0.1) 0%, transparent 45%),
        radial-gradient(ellipse at 90% 90%, rgba(13,148,136,0.08) 0%, transparent 45%),
        radial-gradient(ellipse at 90% 5%,  rgba(124,58,237,0.06) 0%, transparent 35%),
        radial-gradient(ellipse at 5% 95%,  rgba(14,165,233,0.07) 0%, transparent 35%);
    pointer-events: none;
    z-index: 0;
}

body > * { position: relative; z-index: 1; }

main { flex: 1; }

/* ===== HERO HEADER ===== */
header {
    background: linear-gradient(135deg, #03205c 0%, #0a4fa8 55%, #1272d4 100%);
    color: white;
    padding: 80px 24px 70px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-bg-shapes { position: absolute; inset: 0; pointer-events: none; }

.hero-shape {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.07);
}
.shape-1 { width: 400px; height: 400px; top: -160px; right: -120px; }
.shape-2 { width: 260px; height: 260px; bottom: -100px; left: -80px; background: rgba(13,148,136,0.1); }
.shape-3 { width: 180px; height: 180px; top: 20px; left: 10%; border-color: rgba(255,255,255,0.04); }

.hero-cross-icon {
    position: absolute;
    width: 120px;
    height: 120px;
    top: 12px;
    right: 8%;
    opacity: 0.6;
}

.hero-content { position: relative; z-index: 2; }

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 30px;
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 500;
    color: #a8cff8;
    letter-spacing: 0.5px;
    margin-bottom: 20px;
}

.badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 6px rgba(74,222,128,0.6);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 3.2rem;
    font-weight: 700;
    margin: 0 0 10px 0;
    letter-spacing: -0.5px;
    animation: fadeInDown 0.8s ease-out both;
}

.hero-tagline {
    font-size: 1rem;
    font-weight: 400;
    color: #93c5fd;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 0 0 36px 0;
    animation: fadeInDown 0.8s ease-out 0.1s both;
}

.hero-stats {
    display: inline-flex;
    align-items: center;
    gap: 0;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: var(--radius-lg);
    padding: 16px 36px;
    animation: fadeInDown 0.8s ease-out 0.2s both;
}

.hero-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 28px;
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1;
}

.stat-label {
    font-size: 11px;
    color: #93c5fd;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
}

.stat-divider {
    width: 1px;
    height: 40px;
    background: rgba(255,255,255,0.15);
}

/* ===== NAV ===== */
nav {
    background: var(--white);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 0 var(--border), var(--shadow-sm);
}

.nav-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.nav-logo { font-size: 20px; }

.nav-brand-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--navy);
    letter-spacing: -0.2px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
    justify-content: center;
}

.nav-link {
    color: var(--text-mid);
    padding: 16px 14px;
    text-decoration: none;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    display: inline-block;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
    white-space: nowrap;
}

.nav-link:hover { color: var(--navy-mid); }

.nav-link.active {
    color: var(--navy-mid);
    border-bottom-color: var(--navy-mid);
}

.search-wrapper {
    position: relative;
    flex-shrink: 0;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

#hospitalSearch {
    width: 240px;
    padding: 9px 16px 9px 36px;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    border: 1.5px solid var(--border);
    border-radius: 30px;
    outline: none;
    background: #f4f7fd;
    color: var(--text-dark);
    transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}

#hospitalSearch::placeholder { color: var(--text-muted); }

#hospitalSearch:focus {
    border-color: var(--navy-mid);
    box-shadow: 0 0 0 3px rgba(10,79,168,0.1);
    background: var(--white);
}

/* ===== SECTIONS ===== */
section {
    max-width: 1280px;
    margin: 0 auto;
    padding: 20px 24px 40px;
    transition: opacity 0.3s;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 40px 0 8px;
}

.section-accent {
    width: 5px;
    height: 36px;
    border-radius: 3px;
    flex-shrink: 0;
}

.accent-public    { background: var(--blue); }
.accent-patient   { background: var(--teal); }
.accent-equipment { background: var(--purple); }
.accent-supplies  { background: var(--amber); }

h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--navy);
    margin: 0;
    letter-spacing: -0.3px;
}

/* ===== CARD CONTAINER ===== */
.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 22px;
    padding: 20px 0 0;
}

/* ===== CARDS ===== */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    opacity: 0;
    transform: translateY(20px);
    transition: transform 0.4s cubic-bezier(0.165,0.84,0.44,1), box-shadow 0.4s ease, opacity 0.4s ease;
}

.card.reveal {
    opacity: 1;
    transform: translateY(0);
}

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

.card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card-img-wrap {
    position: relative;
    overflow: hidden;
}

.card-img-wrap img {
    width: 100%;
    height: 185px;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.card:hover .card-img-wrap img {
    transform: scale(1.06);
}

.card-tag {
    position: absolute;
    top: 12px;
    left: 12px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(3,32,92,0.75);
    color: #e0eaff;
    backdrop-filter: blur(4px);
}

#public    .card-tag { background: rgba(18,114,212,0.8); }
#patient   .card-tag { background: rgba(13,148,136,0.85); }
#equipment .card-tag { background: rgba(124,58,237,0.85); }
#supplies  .card-tag { background: rgba(217,119,6,0.85); }

.card-body {
    padding: 18px 18px 10px;
    flex: 1;
}

.card-body h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--navy);
    margin: 0 0 6px 0;
    line-height: 1.3;
}

.card-desc {
    font-size: 13px;
    color: var(--text-mid);
    margin: 0 0 4px 0;
    line-height: 1.5;
}

.card-detail {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
}

.card-footer-row {
    padding: 12px 18px 16px;
    border-top: 1px solid rgba(10,79,168,0.06);
    margin-top: 8px;
}

.card-view-btn {
    font-size: 12px;
    font-weight: 600;
    color: var(--navy-mid);
    letter-spacing: 0.3px;
    transition: gap 0.2s;
}

.card:hover .card-view-btn {
    color: var(--blue);
}

/* Section card top accents */
#public    .card { border-top: 3px solid var(--blue); }
#patient   .card { border-top: 3px solid var(--teal); }
#equipment .card { border-top: 3px solid var(--purple); }
#supplies  .card { border-top: 3px solid var(--amber); }

/* ===== NO RESULTS ===== */
.no-results-icon { font-size: 48px; margin-bottom: 16px; }

#no-results-message h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 6px;
}

#no-results-message p {
    font-size: 14px;
    color: var(--text-muted);
}

/* ===== FOOTER ===== */
footer {
    background: var(--navy);
    margin-top: 60px;
}

.footer-top {
    max-width: 1280px;
    margin: 0 auto;
    padding: 50px 24px 40px;
    display: grid;
    grid-template-columns: 2fr 1fr 1.2fr;
    gap: 48px;
    align-items: start;
}

.footer-logo {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 12px;
}

.footer-desc {
    font-size: 13px;
    color: #7fa8d4;
    line-height: 1.7;
    margin: 0 0 20px 0;
}

.footer-contact { display: flex; flex-direction: column; gap: 10px; }

.contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #a8c4e0;
}

.contact-icon { font-size: 14px; }

.footer-links-col h4 {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #4a8ec2;
    margin: 0 0 16px 0;
}

.footer-links-col a {
    display: block;
    font-size: 13px;
    color: #a8c4e0;
    text-decoration: none;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: color 0.2s;
}

.footer-links-col a:hover { color: var(--white); }

.emergency-card {
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.25);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
}

.emergency-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #fca5a5;
    margin-bottom: 10px;
}

.emergency-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    animation: pulse 1.5s infinite;
}

.emergency-time {
    font-size: 12px;
    color: #f87171;
    margin-bottom: 6px;
}

.emergency-number {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 16px;
}

.back-to-top {
    background: rgba(255,255,255,0.1);
    color: #cbd5e1;
    border: 1px solid rgba(255,255,255,0.15);
    padding: 9px 20px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 600;
    transition: background 0.2s, color 0.2s;
    width: 100%;
}

.back-to-top:hover {
    background: rgba(255,255,255,0.18);
    color: var(--white);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.07);
    padding: 16px 24px;
    text-align: center;
    font-size: 12px;
    color: #3d5a7a;
}

/* ===== DETAILS PAGE ===== */
.details-body {
    background-color: var(--bg);
    margin: 0;
    padding: 0;
}

.details-container {
    max-width: 900px;
    margin: 50px auto;
    padding: 36px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    display: flex;
    gap: 40px;
    align-items: flex-start;
    border: 1px solid var(--border);
}

.details-image {
    width: 45%;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    object-fit: cover;
}

.details-content { width: 55%; }

.details-title {
    font-family: 'Playfair Display', serif;
    color: var(--navy);
    font-size: 1.9rem;
    margin-bottom: 10px;
    border-bottom: 3px solid var(--blue);
    display: inline-block;
    padding-bottom: 6px;
}

.info-row {
    margin: 16px 0;
    padding: 10px 0;
    border-bottom: 1px solid #f0f4fb;
}

.info-label {
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 4px;
}

.info-value {
    color: var(--text-mid);
    font-size: 15px;
}

.back-btn {
    display: inline-block;
    margin-top: 28px;
    padding: 12px 26px;
    background: var(--navy-mid);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s, transform 0.2s;
}

.back-btn:hover {
    background: var(--navy);
    transform: translateY(-2px);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-18px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .footer-top { grid-template-columns: 1fr 1fr; }
    .footer-brand-col { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
    header { padding: 60px 16px 50px; }
    header h1 { font-size: 2.2rem; }
    .hero-stats { padding: 14px 20px; }
    .hero-stat { padding: 0 16px; }
    .stat-number { font-size: 1.4rem; }

    .nav-inner { flex-wrap: wrap; padding: 8px 16px; gap: 8px; }
    .nav-brand { display: none; }
    .nav-links { order: 2; width: 100%; justify-content: center; gap: 0; }
    .nav-link { padding: 10px 10px; font-size: 10px; }
    .search-wrapper { order: 1; flex: 1; }
    #hospitalSearch { width: 100%; }

    .card-container { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }

    .footer-top { grid-template-columns: 1fr; gap: 28px; }

    .details-container { flex-direction: column; margin: 20px; padding: 22px; }
    .details-image, .details-content { width: 100%; }
}

@media (max-width: 480px) {
    header h1 { font-size: 1.8rem; }
    .hero-stats { flex-direction: column; gap: 12px; }
    .stat-divider { width: 60px; height: 1px; }
    .card-container { grid-template-columns: 1fr; }
}
