/* ============================================
   Based Evidence - Modern Medical UI 2024
   Inspired by: Mayo Clinic, Cleveland Clinic, Johns Hopkins
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&family=Source+Sans+3:wght@300;400;600;700&display=swap');

:root {
    /* Modern Medical Color System */
    --primary-600: #0A4D8C;
    --primary-500: #0D6EBE;
    --primary-400: #2E8ED6;
    --primary-300: #5AABEB;
    --accent-teal: #00B4D8;
    --accent-green: #06D6A0;
    --success: #00C851;
    --warning: #FFA726;
    --danger: #DC3545;
    
    /* Neutrals */
    --gray-50: #FAFBFC;
    --gray-100: #F3F5F7;
    --gray-200: #E8ECEF;
    --gray-300: #D4DBE1;
    --gray-400: #A8B4BC;
    --gray-500: #6B7885;
    --gray-600: #4A5660;
    --gray-700: #2E3740;
    --gray-800: #1A202C;
    --gray-900: #0F1419;
    
    /* Typography */
    --font-display: 'Poppins', -apple-system, system-ui, sans-serif;
    --font-body: 'Source Sans 3', -apple-system, system-ui, sans-serif;
    
    /* Spacing System (8px base) */
    --space-1: 0.5rem;   /* 8px */
    --space-2: 1rem;     /* 16px */
    --space-3: 1.5rem;   /* 24px */
    --space-4: 2rem;     /* 32px */
    --space-5: 3rem;     /* 48px */
    --space-6: 4rem;     /* 64px */
    --space-8: 6rem;     /* 96px */
    
    /* Shadows - Layered depth */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 2px 4px -1px rgba(0, 0, 0, 0.06), 0 1px 2px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   Global Resets & Base Styles
   ============================================ */

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

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

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--gray-700);
    background: var(--gray-50);
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
    color: var(--gray-900);
    margin-bottom: var(--space-2);
}

h1 { font-size: 3rem; letter-spacing: -0.02em; }
h2 { font-size: 2.25rem; letter-spacing: -0.01em; }
h3 { font-size: 1.875rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1.125rem; }

p { margin-bottom: var(--space-3); }

a {
    color: var(--primary-500);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-600);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ============================================
   Navigation - Modern Glass Effect
   ============================================ */

.navbar {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: var(--shadow-sm);
    padding: var(--space-2) 0 !important;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all var(--transition-base);
}

.navbar-brand {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--primary-600) !important;
    transition: transform var(--transition-base);
}

.navbar-brand:hover {
    transform: translateY(-2px);
    color: var(--primary-500) !important;
}

.nav-link {
    font-family: var(--font-display);
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--gray-700) !important;
    padding: var(--space-1) var(--space-2) !important;
    margin: 0 var(--space-1);
    border-radius: var(--radius-md);
    position: relative;
    transition: all var(--transition-base);
}

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

.nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-500), var(--accent-teal));
    transform: translateX(-50%);
    transition: width var(--transition-base);
}

.nav-link:hover::before {
    width: 60%;
}

/* ============================================
   Hero Section - Modern Gradient
   ============================================ */

.hero-section {
    position: relative;
    background: linear-gradient(135deg, #0A4D8C 0%, #0D6EBE 50%, #00B4D8 100%);
    color: white;
    padding: var(--space-8) 0;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.hero-section .container {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: var(--space-3);
    line-height: 1.1;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.15);
}

.hero-lead {
    font-size: clamp(1.125rem, 2vw, 1.5rem);
    font-weight: 300;
    opacity: 0.95;
    margin-bottom: var(--space-2);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-description {
    font-size: 1.125rem;
    font-weight: 400;
    opacity: 0.9;
    max-width: 700px;
    margin: 0 auto var(--space-4);
    line-height: 1.8;
}

/* ============================================
   Buttons - Modern Styles
   ============================================ */

.btn {
    font-family: var(--font-display);
    font-weight: 600;
    padding: 0.875rem 2rem;
    border-radius: var(--radius-lg);
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width var(--transition-slow), height var(--transition-slow);
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: var(--primary-500);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background: var(--primary-600);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: white;
}

.btn-outline-primary {
    background: transparent;
    color: white;
    border: 2px solid white;
    box-shadow: none;
}

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

.btn-lg {
    padding: 1.125rem 2.5rem;
    font-size: 1.0625rem;
}

/* ============================================
   Cards - Modern Material Design
   ============================================ */

.card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: all var(--transition-base);
    height: 100%;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-300);
}

.card-body {
    padding: var(--space-4);
}

.card-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: var(--space-2);
}

.card-text {
    color: var(--gray-600);
    line-height: 1.7;
    font-size: 1.0625rem;
}

/* Feature Cards with Icons */
.feature-icon {
    font-size: 3rem;
    margin-bottom: var(--space-3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-100), var(--accent-teal-light));
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
}

/* ============================================
   Content Sections
   ============================================ */

.content-section {
    background: white;
    padding: var(--space-6);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--space-5);
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: var(--space-4);
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-500), var(--accent-teal));
    border-radius: var(--radius-full);
}

/* ============================================
   Footer - Modern Dark Theme
   ============================================ */

footer {
    background: linear-gradient(135deg, var(--gray-900) 0%, var(--gray-800) 100%);
    color: var(--gray-300);
    padding: var(--space-6) 0 var(--space-3);
    margin-top: var(--space-8);
}

footer h5 {
    color: white;
    font-weight: 700;
    margin-bottom: var(--space-3);
    font-size: 1.125rem;
}

footer a {
    color: var(--gray-400);
    text-decoration: none;
    transition: color var(--transition-fast);
    display: inline-block;
}

footer a:hover {
    color: var(--accent-teal);
    transform: translateX(4px);
}

footer ul {
    list-style: none;
    padding: 0;
}

footer li {
    margin-bottom: var(--space-2);
}

.copyright {
    background: rgba(0, 0, 0, 0.2);
    padding: var(--space-3) 0;
    margin-top: var(--space-5);
    font-size: 0.9375rem;
    color: var(--gray-400);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* ============================================
   Utilities
   ============================================ */

.text-gradient {
    background: linear-gradient(135deg, var(--primary-500), var(--accent-teal));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-gradient {
    background: linear-gradient(135deg, var(--primary-500), var(--accent-teal));
}

/* ============================================
   Animations
   ============================================ */

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

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

.slide-in-left {
    animation: slideInLeft 0.6s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

/* Stagger animations */
.fade-in-up:nth-child(1) { animation-delay: 0ms; }
.fade-in-up:nth-child(2) { animation-delay: 100ms; }
.fade-in-up:nth-child(3) { animation-delay: 200ms; }
.fade-in-up:nth-child(4) { animation-delay: 300ms; }

/* ============================================
   Forms - Modern Input Styles
   ============================================ */

.form-control,
.form-select {
    font-family: var(--font-body);
    padding: 0.875rem 1.125rem;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    transition: all var(--transition-base);
    background: white;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(13, 110, 190, 0.1);
    outline: none;
}

.form-label {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: var(--space-1);
    font-size: 0.9375rem;
}

/* ============================================
   Alerts
   ============================================ */

.alert {
    border: none;
    border-radius: var(--radius-lg);
    padding: var(--space-3) var(--space-4);
    border-left: 4px solid;
    backdrop-filter: blur(10px);
}

.alert-success {
    background: rgba(0, 200, 81, 0.1);
    border-left-color: var(--success);
    color: #0a5f2f;
}

.alert-info {
    background: rgba(13, 110, 190, 0.1);
    border-left-color: var(--primary-500);
    color: var(--primary-600);
}

.alert-warning {
    background: rgba(255, 167, 38, 0.1);
    border-left-color: var(--warning);
    color: #9a5f00;
}

/* ============================================
   Responsive Breakpoints
   ============================================ */

@media (max-width: 991.98px) {
    .hero-title { font-size: 2.5rem; }
    .hero-lead { font-size: 1.25rem; }
    .section-title { font-size: 2rem; }
    .content-section { padding: var(--space-4); }
}

@media (max-width: 767.98px) {
    :root {
        --space-6: 3rem;
        --space-8: 4rem;
    }
    
    .hero-section { padding: var(--space-6) 0; }
    .hero-title { font-size: 2rem; }
    h1 { font-size: 2.25rem; }
    h2 { font-size: 1.875rem; }
}

@media (max-width: 575.98px) {
    .btn { padding: 0.75rem 1.5rem; }
    .btn-lg { padding: 0.875rem 2rem; }
}

/* ============================================
   Dark Mode Support (Optional)
   ============================================ */

@media (prefers-color-scheme: dark) {
    /* Implement dark mode if needed */
}

/* ============================================
   Accessibility
   ============================================ */

.btn:focus-visible,
.form-control:focus-visible,
.nav-link:focus-visible {
    outline: 2px solid var(--primary-500);
    outline-offset: 2px;
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}