/* ============================================
   MOBILE-FIRST CSS - MEDIKAL AFRICA
   Base: 390px, Scale: 640px, 768px, 1024px
   Professional YC-level mobile responsiveness
   ============================================ */

/* ============================================
   SPACING SYSTEM (8px base)
   ============================================ */
:root {
    --space-1: 8px;
    --space-2: 16px;
    --space-3: 24px;
    --space-4: 32px;
    --space-5: 48px;
    --space-6: 64px;
    
    /* Original Medikal Colors */
    --primary-blue: #5EC4D5;
    --primary-dark: #4AAFC0;
    --accent-light: #E8F7F9;
    --dark-text: #1a1a1a;
    --light-text: #666666;
    --white: #ffffff;
    --light-bg: #f8fafb;
    --border-light: #e5e7eb;
}

/* ============================================
   TYPOGRAPHY SYSTEM (Stripe-level discipline)
   ============================================ */
:root {
    /* Mobile-first font sizes */
    --font-h1-mobile: 32px;
    --font-h2-mobile: 24px;
    --font-h3-mobile: 18px;
    --font-body-mobile: 16px;
    --font-small-mobile: 14px;
    
    /* Line heights */
    --line-height-tight: 1.4;
    --line-height-normal: 1.6;
    
    /* Font weights */
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
}

/* ============================================
   BASE STYLES (Mobile-first: 390px+)
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: var(--font-body-mobile);
    line-height: var(--line-height-normal);
    color: var(--dark-text);
    background: var(--white);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1 {
    font-size: var(--font-h1-mobile);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    color: var(--dark-text);
    margin-bottom: var(--space-2);
}

h2 {
    font-size: var(--font-h2-mobile);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
    color: var(--dark-text);
    margin-bottom: var(--space-2);
}

h3 {
    font-size: var(--font-h3-mobile);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
    color: var(--dark-text);
    margin-bottom: var(--space-2);
}

p {
    font-size: var(--font-body-mobile);
    line-height: var(--line-height-normal);
    color: var(--light-text);
    margin-bottom: var(--space-2);
}

/* ============================================
   HEADER (Mobile-first)
   ============================================ */
.top-bar {
    background: var(--primary-blue);
    color: var(--white);
    padding: var(--space-1) 0;
    font-size: var(--font-small-mobile);
    display: none; /* Hide on mobile, show on desktop */
}

.medikal-header {
    background: var(--white);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: var(--space-2) 0;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-section img {
    height: 32px;
    width: auto;
}

.nav-menu {
    display: none; /* Hide on mobile */
}

.cta-button {
    display: none; /* Hide on mobile */
}

.mobile-menu-btn {
    display: block;
    background: var(--primary-blue);
    border: none;
    color: var(--white);
    font-size: 18px;
    padding: var(--space-1) var(--space-2);
    cursor: pointer;
    min-width: 44px;
    min-height: 44px;
    -webkit-appearance: none;
    touch-action: manipulation;
    border-radius: 6px;
}

/* Mobile Navigation */
.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 400px;
    height: 100vh;
    background: #ffffff;
    z-index: 1001;
    transition: right 0.3s ease;
    padding: var(--space-4) 0;
    overflow-y: auto;
}

.mobile-nav.active {
    right: 0;
}

.mobile-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 var(--space-3);
    margin-bottom: var(--space-3);
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: var(--space-2);
}

.mobile-nav-logo img {
    height: 32px;
    width: auto;
}

.mobile-close-btn {
    background: transparent;
    border: none;
    font-size: 24px;
    color: #000000;
    cursor: pointer;
    padding: var(--space-1);
    min-width: 44px;
    min-height: 44px;
}

.mobile-nav-list {
    list-style: none;
    padding: 0;
}

.mobile-nav-list li {
    border-bottom: 1px solid #e5e7eb;
}

.mobile-nav-list a {
    display: block;
    padding: var(--space-2) var(--space-3);
    color: var(--dark-text);
    text-decoration: none;
    font-weight: var(--font-weight-medium);
    font-size: var(--font-body-mobile);
    transition: background-color 0.2s ease;
}

.mobile-nav-list a:hover {
    background: var(--light-bg);
    color: var(--primary-blue);
}

.mobile-cta {
    padding: var(--space-3);
    border-top: 1px solid #e5e7eb;
    margin-top: var(--space-2);
}

.mobile-cta .cta-button {
    display: block;
    width: 100%;
    background: var(--primary-blue);
    color: var(--white);
    padding: var(--space-2);
    text-align: center;
    text-decoration: none;
    font-weight: var(--font-weight-medium);
    border: none;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.mobile-cta .cta-button:hover {
    background: var(--primary-dark);
    color: var(--white);
}

/* ============================================
   HERO SECTION (Mobile-first)
   ============================================ */
.hero-section,
.features-section {
    background: #ffffff;
    padding: var(--space-5) var(--space-2);
}

.hero-title,
.features-title {
    font-size: var(--font-h1-mobile);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    color: #000000;
    margin-bottom: var(--space-2);
    text-align: left;
}

.hero-subtitle,
.features-subtitle {
    font-size: var(--font-body-mobile);
    line-height: var(--line-height-normal);
    color: #666666;
    margin-bottom: var(--space-4);
    text-align: left;
}

.hero-cta,
.features-cta {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.hero-btn-primary,
.features-btn-primary,
.hero-btn-secondary,
.features-btn-secondary {
    width: 100%;
    padding: var(--space-2);
    font-size: var(--font-body-mobile);
    font-weight: var(--font-weight-medium);
    text-align: center;
    text-decoration: none;
    border: 1px solid #000000;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
}

.hero-btn-primary,
.features-btn-primary {
    background: var(--primary-blue);
    color: var(--white);
    border: none;
    border-radius: 6px;
}

.hero-btn-primary:hover,
.features-btn-primary:hover {
    background: var(--primary-dark);
    color: var(--white);
}

.hero-btn-secondary,
.features-btn-secondary {
    background: var(--white);
    color: var(--dark-text);
    border: 2px solid var(--border-light);
    border-radius: 6px;
}

.hero-btn-secondary:hover,
.features-btn-secondary:hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

/* ============================================
   CARDS (Standardized)
   ============================================ */
.card,
.minimal-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    padding: var(--space-3);
    margin-bottom: var(--space-3);
    transition: border-color 0.2s ease;
}

.card:hover,
.minimal-card:hover {
    border-color: #000000;
}

/* ============================================
   VIDEO SECTION
   ============================================ */
.video-container,
.demo-video-container-inline {
    width: 100%;
    max-width: 100%;
    margin: var(--space-3) 0;
}

.video-wrapper,
.demo-video-wrapper-inline {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    background: #000000;
}

.video-wrapper video,
.demo-video-wrapper-inline video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ============================================
   FOOTER (Mobile-first)
   ============================================ */
.medikal-footer {
    background: var(--primary-blue);
    color: var(--white);
    padding: var(--space-5) var(--space-2) var(--space-3);
    position: relative;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}

.footer-column h3 {
    font-size: var(--font-small-mobile);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-2);
    color: var(--white);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: var(--space-1);
}

.footer-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: var(--font-small-mobile);
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: var(--white);
    opacity: 1;
}

.footer-copyright {
    font-size: var(--font-small-mobile);
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    padding-top: var(--space-3);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */

/* Tablet: 640px+ */
@media (min-width: 640px) {
    .hero-section,
    .features-section {
        padding: var(--space-6) var(--space-3);
    }
    
    .hero-title,
    .features-title {
        font-size: 40px;
    }
    
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Desktop: 768px+ */
@media (min-width: 768px) {
    .top-bar {
        display: block;
    }
    
    .nav-menu {
        display: flex;
        list-style: none;
        gap: var(--space-1);
        align-items: center;
    }
    
    .nav-menu a {
        color: #000000;
        text-decoration: none;
        font-weight: var(--font-weight-medium);
        padding: var(--space-1) var(--space-2);
        font-size: var(--font-body-mobile);
    }
    
    .cta-button {
        display: inline-flex;
        background: var(--primary-blue);
        color: var(--white);
        padding: var(--space-1) var(--space-3);
        text-decoration: none;
        font-weight: var(--font-weight-medium);
        border: none;
        border-radius: 6px;
        transition: background 0.2s ease;
    }
    
    .cta-button:hover {
        background: var(--primary-dark);
    }
    
    .mobile-menu-btn {
        display: none;
    }
    
    .hero-cta,
    .features-cta {
        flex-direction: row;
    }
    
    .hero-btn-primary,
    .features-btn-primary,
    .hero-btn-secondary,
    .features-btn-secondary {
        width: auto;
    }
    
    .footer-grid {
        grid-template-columns: 2fr 1fr 1fr 1fr;
    }
}

/* Large Desktop: 1024px+ */
@media (min-width: 1024px) {
    .hero-title,
    .features-title {
        font-size: 48px;
    }
    
    .hero-subtitle,
    .features-subtitle {
        font-size: 20px;
    }
}

/* ============================================
   TOP BAR (Desktop only)
   ============================================ */
.top-bar-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-bar-left,
.top-bar-right {
    display: flex;
    gap: var(--space-2);
    align-items: center;
}

.top-bar-item {
    color: #ffffff;
    text-decoration: none;
    font-size: var(--font-small-mobile);
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.language-selector {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    padding: var(--space-1) var(--space-2);
    border-radius: 0;
    font-size: var(--font-small-mobile);
    cursor: pointer;
}

/* ============================================
   DESKTOP NAVIGATION (768px+)
   ============================================ */
@media (min-width: 768px) {
    .nav-menu {
        display: flex;
        list-style: none;
        gap: var(--space-1);
        align-items: center;
    }
    
    .nav-menu > li {
        position: relative;
    }
    
    .nav-menu > li > a {
        color: #000000;
        text-decoration: none;
        font-weight: var(--font-weight-medium);
        padding: var(--space-1) var(--space-2);
        font-size: var(--font-body-mobile);
        transition: color 0.2s ease;
    }
    
    .nav-menu > li > a:hover {
        color: #666666;
    }
    
    .dropdown-menu {
        position: absolute;
        top: 100%;
        left: 50%;
        transform: translateX(-50%);
        background: #ffffff;
        border: 1px solid #e5e7eb;
        padding: var(--space-2);
        min-width: 200px;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.2s ease, visibility 0.2s ease;
    }
    
    .nav-menu > li:hover .dropdown-menu {
        opacity: 1;
        visibility: visible;
    }
    
    .dropdown-item {
        display: block;
        padding: var(--space-1) var(--space-2);
        color: #000000;
        text-decoration: none;
        font-size: var(--font-body-mobile);
    }
    
    .dropdown-item:hover {
        background: #f8fafb;
    }
}

/* ============================================
   HERO BADGE
   ============================================ */
.hero-badge-features {
    display: inline-block;
    padding: var(--space-1) var(--space-2);
    font-size: var(--font-small-mobile);
    font-weight: var(--font-weight-medium);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: transparent;
    color: #000000;
    border: 1px solid #000000;
    margin-bottom: var(--space-2);
}

/* ============================================
   STATS SECTION
   ============================================ */
.features-stats {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin-top: var(--space-4);
}

.features-stat {
    display: flex;
    flex-direction: column;
}

.features-stat-number {
    font-size: 28px;
    font-weight: var(--font-weight-semibold);
    color: #000000;
    line-height: 1;
    margin-bottom: var(--space-1);
}

.features-stat-label {
    font-size: var(--font-small-mobile);
    color: #666666;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

@media (min-width: 640px) {
    .features-stats {
        flex-direction: row;
        gap: var(--space-4);
    }
}

/* ============================================
   SECTION SPACING
   ============================================ */
.section {
    padding: var(--space-5) var(--space-2);
}

.section-title {
    font-size: var(--font-h2-mobile);
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--space-3);
    text-align: left;
}

.section-subtitle {
    font-size: var(--font-body-mobile);
    color: #666666;
    margin-bottom: var(--space-4);
    text-align: left;
}

/* ============================================
   CONTAINER
   ============================================ */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-2);
}

@media (min-width: 640px) {
    .container {
        padding: 0 var(--space-3);
    }
}

@media (min-width: 1024px) {
    .container {
        padding: 0 var(--space-4);
    }
}

/* ============================================
   UTILITIES
   ============================================ */
.desktop-only {
    display: none;
}

@media (min-width: 768px) {
    .desktop-only {
        display: block;
    }
}

.mobile-only {
    display: block;
}

@media (min-width: 768px) {
    .mobile-only {
        display: none;
    }
}

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

.text-left {
    text-align: left;
}
