/* ============================================
   GLOBAL.CSS - MediCare Hospital
   Design System & Base Styles
   ============================================ */

:root {
    /* Brand Colors */
    --navy: #355d73;
    --navy-dark: #264555;
    --navy-light: #4a7a96;
    --sky: #bad2ea;
    --sky-light: #daf7f9;
    --sky-pale: #f0faff;
    --gold: #f9b200;
    --gold-dark: #d99a00;
    --gold-light: #ffd55a;
    --white: #ffffff;

    /* Semantic */
    --text-primary: #1a2e3b;
    --text-secondary: #4a6274;
    --text-muted: #7a97a8;
    --text-light: #a8bcc9;
    --bg-page: #f8fbfe;
    --bg-section: #f0f7fb;
    --border: rgba(53,93,115,0.12);
    --border-light: rgba(53,93,115,0.06);

    /* Shadows */
    --shadow-xs: 0 1px 3px rgba(53,93,115,0.08);
    --shadow-sm: 0 4px 16px rgba(53,93,115,0.10);
    --shadow-md: 0 8px 32px rgba(53,93,115,0.14);
    --shadow-lg: 0 16px 56px rgba(53,93,115,0.18);
    --shadow-xl: 0 32px 80px rgba(53,93,115,0.22);

    /* Typography */
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'DM Sans', system-ui, sans-serif;
    --font-serif: 'DM Serif Display', Georgia, serif;

    /* Spacing */
    --section-pad: clamp(60px, 8vw, 120px);
    --container: 1280px;
    --container-sm: 960px;
    --gutter: clamp(16px, 4vw, 32px);

    /* Radius */
    --radius-sm: 8px;
    --radius: 16px;
    --radius-lg: 24px;
    --radius-xl: 40px;
    --radius-full: 9999px;

    /* Transitions */
    --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --transition: 0.3s var(--ease);
    --transition-fast: 0.15s var(--ease);
}

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    color: var(--text-primary);
    background: var(--bg-page);
    line-height: 1.7;
    overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; transition: var(--transition); }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ─── Typography Scale ─── */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    line-height: 1.2;
    color: var(--text-primary);
}
h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); font-weight: 700; }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.8rem); font-weight: 600; }
h3 { font-size: clamp(1.3rem, 2.5vw, 1.8rem); font-weight: 600; }
h4 { font-size: clamp(1.1rem, 2vw, 1.3rem); font-weight: 500; }
p  { font-size: 1rem; color: var(--text-secondary); line-height: 1.75; }

/* ─── Container ─── */
.container {
    width: min(var(--container), 100% - var(--gutter) * 2);
    margin-inline: auto;
}
.container-sm {
    width: min(var(--container-sm), 100% - var(--gutter) * 2);
    margin-inline: auto;
}

/* ─── Section Label ─── */
.section-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gold-dark);
    background: rgba(249,178,0,0.1);
    border: 1px solid rgba(249,178,0,0.25);
    border-radius: var(--radius-full);
    padding: 6px 16px;
    margin-bottom: 16px;
}
.section-label::before {
    content: '';
    width: 6px; height: 6px;
    background: var(--gold);
    border-radius: 50%;
}

/* ─── Section Title ─── */
.section-title {
    font-size: clamp(1.9rem, 3.5vw, 2.8rem);
    color: var(--navy-dark);
    margin-bottom: 16px;
    position: relative;
}
.section-title span { color: var(--navy); }
.section-title .highlight {
    color: var(--gold-dark);
    font-style: italic;
}

.section-subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 580px;
    line-height: 1.7;
}

.section-header {
    margin-bottom: clamp(40px, 6vw, 72px);
}
.section-header.centered {
    text-align: center;
}
.section-header.centered .section-subtitle { margin-inline: auto; }

/* ─── Buttons ─── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    padding: 14px 28px;
    border-radius: var(--radius-full);
    transition: var(--transition);
    cursor: pointer;
    border: 2px solid transparent;
    white-space: nowrap;
}
.btn-primary {
    background: var(--navy);
    color: var(--white);
    border-color: var(--navy);
}
.btn-primary:hover {
    background: var(--navy-dark);
    border-color: var(--navy-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.btn-gold {
    background: var(--gold);
    color: var(--navy-dark);
    border-color: var(--gold);
}
.btn-gold:hover {
    background: var(--gold-dark);
    border-color: var(--gold-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(249,178,0,0.35);
}
.btn-outline {
    background: transparent;
    color: var(--navy);
    border-color: var(--navy);
}
.btn-outline:hover {
    background: var(--navy);
    color: var(--white);
    transform: translateY(-2px);
}
.btn-outline-white {
    background: transparent;
    color: var(--white);
    border-color: rgba(255,255,255,0.5);
}
.btn-outline-white:hover {
    background: var(--white);
    color: var(--navy);
    border-color: var(--white);
}
.btn-lg { padding: 18px 36px; font-size: 1rem; }
.btn-sm { padding: 10px 20px; font-size: 0.85rem; }

/* ─── Cards ─── */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid var(--border-light);
}
.card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

/* ─── Badge ─── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: var(--radius-full);
}
.badge-navy { background: rgba(53,93,115,0.1); color: var(--navy); }
.badge-gold { background: rgba(249,178,0,0.15); color: var(--gold-dark); }
.badge-sky  { background: rgba(218,247,249,0.8); color: var(--navy-dark); border: 1px solid rgba(53,93,115,0.15); }
.badge-green { background: rgba(40,167,69,0.1); color: #1a7a35; }

/* ─── Divider ─── */
.divider {
    width: 60px; height: 4px;
    background: linear-gradient(90deg, var(--gold), var(--gold-light));
    border-radius: 2px;
    margin-bottom: 24px;
}
.divider.centered { margin-inline: auto; }

/* ─── Stats Strip ─── */
.stats-strip {
    display: flex;
    gap: 0;
    background: var(--navy);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.stat-item {
    flex: 1;
    padding: 32px 24px;
    text-align: center;
    border-right: 1px solid rgba(255,255,255,0.1);
    position: relative;
}
.stat-item:last-child { border-right: none; }
.stat-number {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    font-weight: 700;
    color: var(--gold);
    line-height: 1;
    margin-bottom: 6px;
}
.stat-label {
    font-size: 0.82rem;
    color: var(--sky);
    letter-spacing: 0.04em;
    font-weight: 500;
}

/* ─── Form Elements ─── */
.form-group { margin-bottom: 20px; }
.form-label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}
.form-control {
    width: 100%;
    padding: 13px 18px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text-primary);
    background: var(--white);
    transition: var(--transition);
    outline: none;
}
.form-control:focus {
    border-color: var(--navy);
    box-shadow: 0 0 0 4px rgba(53,93,115,0.08);
}
.form-control::placeholder { color: var(--text-light); }
textarea.form-control { resize: vertical; min-height: 120px; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23355d73' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; padding-right: 44px; }

/* ─── Animations ─── */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes pulse-ring {
    0% { transform: scale(0.8); opacity: 0.8; }
    100% { transform: scale(1.8); opacity: 0; }
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.animate-up { animation: fadeUp 0.7s var(--ease) both; }
.animate-up.delay-1 { animation-delay: 0.1s; }
.animate-up.delay-2 { animation-delay: 0.2s; }
.animate-up.delay-3 { animation-delay: 0.3s; }
.animate-up.delay-4 { animation-delay: 0.4s; }

/* ─── Page Hero Common ─── */
.page-hero {
    background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 60%, var(--navy-light) 100%);
    padding: clamp(80px, 10vw, 140px) 0 clamp(60px, 8vw, 100px);
    position: relative;
    overflow: hidden;
}
.page-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Ccircle cx='30' cy='30' r='20'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
}
.page-hero .hero-content { position: relative; z-index: 1; }
.page-hero h1 { color: var(--white); margin-bottom: 16px; }
.page-hero .hero-sub { color: var(--sky); font-size: 1.1rem; max-width: 560px; }
.page-hero .breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,0.6);
    font-size: 0.85rem;
    margin-bottom: 20px;
}
.page-hero .breadcrumb a { color: rgba(255,255,255,0.7); }
.page-hero .breadcrumb a:hover { color: var(--gold); }
.page-hero .breadcrumb span { color: var(--gold); }

/* ─── Scroll reveal ─── */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ─── Utility ─── */
.text-center { text-align: center; }
.text-navy { color: var(--navy); }
.text-gold { color: var(--gold-dark); }
.text-white { color: var(--white); }
.bg-navy { background: var(--navy); }
.bg-sky { background: var(--sky-light); }
.bg-white { background: var(--white); }
.mt-auto { margin-top: auto; }
.gap-sm { gap: 12px; }

/* Flex helpers */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { flex-direction: column; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

/* ─── Grid ─── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }

@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .stats-strip { flex-direction: column; }
    .stat-item { border-right: none; border-bottom: 1px solid rgba(255,255,255,0.1); }
    .stat-item:last-child { border-bottom: none; }
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-section); }
::-webkit-scrollbar-thumb { background: var(--sky); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--navy-light); }

/* ─── Selection ─── */
::selection { background: rgba(53,93,115,0.2); color: var(--navy-dark); }

/* ─── Focus visible ─── */
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
