/* ========================================
   RENAL COMPANION LANDING PAGE
   Main CSS - Design System & Core Styles
   ======================================== */

/* CSS Variables (Design Tokens) */
:root {
    /* Primary Medical Teal */
    --primary-900: #0A4D4D;
    --primary-700: #0D7373;
    --primary-500: #10A5A5;
    --primary-300: #6BD4D4;

    /* Clinical Blue */
    --clinical-800: #1E3A8A;
    --clinical-600: #2563EB;

    /* Neutrals */
    --neutral-50: #F9FAFB;
    --neutral-100: #F3F4F6;
    --neutral-200: #E5E7EB;
    --neutral-300: #D1D5DB;
    --neutral-600: #4B5563;
    --neutral-700: #374151;
    --neutral-800: #1F2937;
    --neutral-900: #111827;

    /* Status Colors */
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--primary-700), var(--primary-500));
    --gradient-clinical: linear-gradient(135deg, var(--clinical-800), var(--clinical-600));
    --gradient-success: linear-gradient(135deg, #059669, var(--success));
    --gradient-ai: linear-gradient(135deg, #7C3AED, #A78BFA);

    /* Spacing (8px grid) */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-6: 24px;
    --space-8: 32px;
    --space-12: 48px;
    --space-16: 64px;
    --space-24: 96px;
    --space-32: 128px;

    /* Typography */
    --font-heading: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 24px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   RESET & BASE STYLES
   ======================================== */

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    line-height: 1.6;
    color: var(--neutral-900);
    background-color: #FFFFFF;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

a {
    text-decoration: none;
    color: inherit;
    transition: all var(--transition-base);
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

ul,
ol {
    list-style: none;
}

/* ========================================
   TYPOGRAPHY
   ======================================== */

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    color: var(--neutral-900);
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
}

h2 {
    font-size: clamp(2rem, 4vw, 3rem);
}

h3 {
    font-size: clamp(1.5rem, 3vw, 2rem);
}

h4 {
    font-size: clamp(1.25rem, 2vw, 1.5rem);
}

p {
    font-size: clamp(1rem, 1.5vw, 1.125rem);
    line-height: 1.7;
    color: var(--neutral-700);
}

.highlight {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========================================
   LAYOUT UTILITIES
   ======================================== */

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-6);
}

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

.section-padding {
    padding: var(--space-16) 0;
}

@media (min-width: 768px) {
    .section-padding {
        padding: var(--space-24) 0;
    }
}

.bg-light {
    background-color: var(--neutral-50);
}

/* ========================================
   NAVIGATION
   ======================================== */

/* ========================================
   NAVIGATION
   ======================================== */

/* Utility Visibility Classes */
.desktop-only {
    display: flex !important;
}

.mobile-only {
    display: none !important;
}

@media (max-width: 992px) {
    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: flex !important;
    }
}

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--neutral-200);
    transition: all var(--transition-base);
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
    /* Fixed robust height */
}

/* Brand */
.nav-brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    z-index: 1001;
}

.logo {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.brand-name {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-700);
}

/* Desktop Menu */
.nav-menu {
    display: flex;
    align-items: center;
    gap: var(--space-6);
}

.nav-menu a {
    font-size: 0.938rem;
    font-weight: 600;
    color: var(--neutral-600);
    position: relative;
    padding: 8px 0;
    transition: color 0.2s;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary-700);
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width var(--transition-base);
    border-radius: 2px;
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
    width: 100%;
}

/* Nav Actions (Desktop) */
.nav-actions {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

/* Language Button */
.lang-btn {
    padding: var(--space-2) var(--space-4);
    background: var(--neutral-50);
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--neutral-700);
    transition: all var(--transition-base);
}

.lang-btn:hover {
    background: white;
    box-shadow: var(--shadow-md);
    color: var(--primary-700);
    border-color: var(--primary-300);
    transform: translateY(-1px);
}

.lang-btn.small {
    padding: 6px 12px;
    font-size: 0.8rem;
}

/* CTA Button */
.nav-cta {
    padding: var(--space-3) var(--space-6);
    background: var(--gradient-primary);
    color: white !important;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: var(--shadow-md);
}

.nav-cta::after {
    display: none !important;
}

.nav-cta:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Mobile Controls */
.mobile-controls {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    z-index: 1001;
}

.nav-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 10px;
    background: var(--neutral-50);
    border-radius: 8px;
    border: 1px solid var(--neutral-200);
}

.nav-toggle span {
    width: 22px;
    height: 2px;
    background: var(--neutral-800);
    transition: all var(--transition-base);
    border-radius: 2px;
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Menu Drawer */
@media (max-width: 992px) {
    .nav-menu {
        position: fixed;
        top: 0;
        right: 0;
        width: 100%;
        height: 100vh;
        flex-direction: column;
        background: white;
        padding: 110px var(--space-6) var(--space-8);
        gap: var(--space-2);
        /* Smaller gap, handled by padding on items */
        transform: translateX(100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
        z-index: 1000;
        align-items: stretch;
        /* Full width items */
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
        overflow-y: auto;
        /* Allow scrolling if menu is tall */
    }

    [dir="rtl"] .nav-menu {
        transform: translateX(-100%);
        left: 0;
        right: auto;
    }

    .nav-menu.active {
        transform: translateX(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-menu li {
        width: 100%;
        opacity: 0;
        transform: translateY(10px);
        transition: all 0.3s ease-out;
    }

    .nav-menu.active li {
        opacity: 1;
        transform: translateY(0);
    }

    /* Stagger animation for items */
    .nav-menu.active li:nth-child(1) {
        transition-delay: 0.1s;
    }

    .nav-menu.active li:nth-child(2) {
        transition-delay: 0.15s;
    }

    .nav-menu.active li:nth-child(3) {
        transition-delay: 0.2s;
    }

    .nav-menu.active li:nth-child(4) {
        transition-delay: 0.25s;
    }

    .nav-menu.active li:nth-child(5) {
        transition-delay: 0.3s;
    }

    .nav-menu.active li:nth-child(6) {
        transition-delay: 0.35s;
    }

    .nav-menu a {
        font-size: 1.15rem;
        font-weight: 600;
        color: var(--neutral-700);
        display: flex;
        align-items: center;
        width: 100%;
        padding: 16px 20px;
        border-radius: var(--radius-lg);
        background: transparent;
        border-bottom: 1px solid var(--neutral-100);
        transition: all 0.2s ease;
    }

    .nav-menu a:hover,
    .nav-menu a.active {
        background: var(--neutral-50);
        color: var(--primary-700);
        padding-left: 28px;
        /* Slide effect */
        border-color: transparent;
    }

    [dir="rtl"] .nav-menu a:hover,
    [dir="rtl"] .nav-menu a.active {
        padding-left: 20px;
        padding-right: 28px;
    }

    .nav-menu a::after {
        display: none;
        /* Remove bottom line underline from desktop */
    }

    /* Mobile CTA (Download) */
    .nav-menu .mobile-only {
        margin-top: var(--space-6);
        border-top: 1px solid var(--neutral-200);
        padding-top: var(--space-6);
        display: block !important;
        /* Ensure visibility */
    }

    .nav-menu .mobile-only a {
        background: var(--gradient-primary);
        color: white !important;
        justify-content: center;
        text-align: center;
        font-weight: 700;
        padding: 18px;
        border: none;
        box-shadow: var(--shadow-lg);
        transform: translateY(0);
    }

    .nav-menu .mobile-only a:hover {
        padding-left: 18px;
        /* No slide for button */
        transform: translateY(-2px);
        box-shadow: var(--shadow-xl);
    }

    [dir="rtl"] .nav-menu .mobile-only a:hover {
        padding-right: 18px;
    }
}

/* ========================================
   BUTTONS
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.938rem;
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
    cursor: pointer;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.btn-secondary {
    background: white;
    color: var(--primary-700);
    border: 2px solid var(--primary-700);
}

.btn-secondary:hover {
    background: var(--primary-700);
    color: white;
}

.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: 1rem;
}

/* ========================================
   HERO SECTION
   ======================================== */

.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 140px;
    /* Increased from 80px for new header clearance */
    overflow: hidden;
}

.hero-background {
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg, #FFFFFF 0%, var(--neutral-50) 100%);
}

.gradient-orb {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.5;
}

.gradient-orb-1 {
    top: -200px;
    right: -200px;
    background: var(--gradient-primary);
}

.gradient-orb-2 {
    bottom: -200px;
    left: -200px;
    background: var(--gradient-clinical);
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-12);
    align-items: center;
}

@media (min-width: 1024px) {
    .hero-content {
        grid-template-columns: 1fr 1fr;
    }
}

.trust-badges {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-bottom: var(--space-6);
}

.badge {
    padding: var(--space-2) var(--space-4);
    background: rgba(16, 165, 165, 0.1);
    color: var(--primary-700);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--radius-full);
    border: 1px solid var(--primary-300);
}

.hero-title {
    margin-bottom: var(--space-6);
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--neutral-600);
    margin-bottom: var(--space-8);
}

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    margin-bottom: var(--space-12);
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: var(--space-6);
    padding: var(--space-6);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-xl);
    border: 1px solid var(--neutral-200);
}

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

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    font-family: var(--font-heading);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    display: block;
    font-size: 0.875rem;
    color: var(--neutral-600);
    font-weight: 500;
    margin-top: var(--space-1);
}

.phone-mockup {
    position: relative;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-20px);
    }
}

/* ========================================
   SECTIONS
   ======================================== */

.section-header {
    margin-bottom: var(--space-12);
}

.section-header.centered {
    text-align: center;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.section-title {
    margin-bottom: var(--space-4);
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--neutral-600);
}

/* Problem Section */
.problem-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-12);
    align-items: center;
}

@media (min-width: 1024px) {
    .problem-grid {
        grid-template-columns: 1.1fr 0.9fr;
    }
}

.problem-visual {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-6);
}

.stat-card {
    position: relative;
    padding: var(--space-8);
    background: white;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--neutral-200);
    overflow: hidden;
    transition: transform var(--transition-base);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--error-500);
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-glow {
    position: absolute;
    top: -20px;
    right: -20px;
    width: 100px;
    height: 100px;
    background: var(--error-500);
    filter: blur(40px);
    opacity: 0.1;
}

.big-stat {
    display: block;
    font-size: 4.5rem;
    font-weight: 900;
    line-height: 1;
    margin-bottom: var(--space-4);
    font-family: var(--font-heading);
    color: var(--neutral-900);
    background: linear-gradient(135deg, var(--error-600), var(--error-400));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-card p {
    font-weight: 600;
    color: var(--neutral-700);
    font-size: 1.1rem;
    line-height: 1.5;
}

.problem-content h3 {
    margin-bottom: var(--space-6);
}

.problem-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.problem-list li {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    font-size: 1.063rem;
}

.icon-error {
    flex-shrink: 0;
    color: var(--danger);
}

/* Solution Section */
.solution-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-8);
}

@media (min-width: 768px) {
    .solution-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

.solution-card {
    padding: var(--space-8);
    background: white;
    border-radius: var(--radius-2xl);
    border: 1px solid var(--neutral-200);
    transition: all var(--transition-base);
}

.solution-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-2xl);
}

.card-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-xl);
    margin-bottom: var(--space-6);
}

.primary-gradient {
    background: var(--gradient-primary);
    color: white;
}

.success-gradient {
    background: var(--gradient-success);
    color: white;
}

.ai-gradient {
    background: var(--gradient-ai);
    color: white;
}

.card-title {
    margin-bottom: var(--space-4);
}

.card-description {
    color: var(--neutral-600);
    margin-bottom: var(--space-6);
}

.card-features {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.card-features li {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.938rem;
    color: var(--neutral-700);
}

.card-features li::before {
    content: '✓';
    color: var(--success);
    font-weight: 700;
}

/* ========================================
   FOOTER
   ======================================== */

.footer {
    background: var(--neutral-900);
    color: var(--neutral-300);
    padding: var(--space-16) 0 var(--space-8);
}

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

@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: 2fr 1fr 1fr 1fr;
    }
}

.footer-col h4 {
    color: white;
    font-size: 1rem;
    margin-bottom: var(--space-4);
}

.footer-col p {
    font-size: 0.938rem;
    line-height: 1.7;
}

.footer-disclaimer {
    margin-top: var(--space-4);
    padding: var(--space-4);
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    font-size: 0.813rem;
    line-height: 1.5;
}

.footer-col ul {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.footer-col a {
    color: var(--neutral-300);
    font-size: 0.938rem;
    transition: color var(--transition-base);
}

.footer-col a:hover {
    color: var(--primary-300);
}

.footer-bottom {
    border-top: 1px solid var(--neutral-800);
    padding-top: var(--space-6);
    text-align: center;
}

/* ========================================
   RESPONSIVE REFINEMENTS
   ======================================== */

@media (max-width: 1024px) {
    :root {
        --space-12: 32px;
        --space-16: 48px;
        --space-24: 64px;
    }

    .hero-content {
        gap: var(--space-8);
        text-align: center;
    }

    .hero-cta {
        justify-content: center;
    }

    .hero-stats {
        justify-content: center;
    }

    .problem-grid,
    .solution-grid,
    .tech-grid,
    .validation-grid,
    .footer-grid {
        gap: var(--space-6);
    }

    .section-header.centered {
        max-width: 100%;
        padding: 0 var(--space-4);
    }
}

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

    .hero {
        padding-top: 100px;
        min-height: auto;
        padding-bottom: var(--space-12);
    }

    .hero-title {
        font-size: 2.25rem;
    }

    .problem-grid,
    .feature-showcase,
    .download-container {
        grid-template-columns: 1fr;
    }

    .feature-tabs .tab-buttons {
        overflow-x: auto;
        justify-content: flex-start;
        padding-bottom: var(--space-2);
        -webkit-overflow-scrolling: touch;
    }

    .tab-btn {
        flex: 0 0 auto;
    }

    .feature-visual {
        order: -1;
        /* Show image before text on mobile if desired, or remove to keep text first */
    }

    .stat-card,
    .solution-card,
    .tech-card {
        padding: var(--space-6);
    }

    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-col {
        align-items: center;
    }

    .footer-col ul {
        align-items: center;
    }

    .logo {
        width: 32px;
        height: 32px;
    }

    .brand-name {
        font-size: 1.1rem;
    }
}

/* Fix for broken images/missing assets */
img {
    max-width: 100%;
    height: auto;
    background-color: var(--neutral-100);
    /* Placeholder background */
    border-radius: var(--radius-md);
    object-fit: cover;
}