/* ==========================================================
   MY APPS LIST — STABLE CLEAN BUILD v3.0
   PURPOSE:
   - Single source of truth stylesheet
   - Remove patch stacking issues
   - Restore predictable layout behavior
========================================================== */

/* ==========================================================
   ROOT DESIGN SYSTEM
========================================================== */

:root {

    --bg-primary: #050816;
    --bg-secondary: #0f172a;

    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;

    --border-color: rgba(255, 255, 255, 0.08);

    --primary: #3b82f6;
    --accent: #8b5cf6;

    --shadow-lg: 0 10px 30px rgba(0,0,0,0.35);
}

/* ==========================================================
   GLOBAL RESET
========================================================== */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Inter", sans-serif;
    background: linear-gradient(180deg, #050816, #0b1220);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.6;
}

/* Grid background */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    opacity: 0.35;
    z-index: -2;
}

/* ==========================================================
   LAYOUT CONTAINER
========================================================== */

.container {
    width: 90%;
    max-width: 1100px;
    margin: auto;
}

/* ==========================================================
   HEADER (FIXED STABLE NAV)
========================================================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(14px);
    background: rgba(5, 8, 22, 0.75);
    border-bottom: 1px solid var(--border-color);
}

.header-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 75px;
    gap: 1rem;
}

/* LOGO */
.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
    flex-shrink: 0;
}

.logo-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    box-shadow: var(--shadow-lg);
}

/* NAVIGATION */
.desktop-nav {
    display: none;
    margin-left: auto;
    gap: 2rem;
    align-items: center;
}

.desktop-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: 0.2s ease;
    white-space: nowrap;
}

.desktop-nav a:hover {
    color: var(--text-primary);
}

/* MOBILE BUTTON */
.mobile-menu-btn {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.6rem;
    cursor: pointer;
}

/* MOBILE NAV */
.mobile-nav {
    display: none;
    flex-direction: column;
    padding: 1rem;
    gap: 1rem;
    background: rgba(5, 8, 22, 0.95);
    border-bottom: 1px solid var(--border-color);
}

.mobile-nav.active {
    display: flex;
}

.mobile-nav a {
    color: var(--text-primary);
    text-decoration: none;
}

/* ==========================================================
   HERO
========================================================== */

.hero {
    text-align: center;
    padding: 5rem 1rem;
}

.hero-tagline {
    color: #93c5fd;
    margin-top: 1rem;
}

/* ==========================================================
   SECTIONS SPACING SYSTEM
========================================================== */

section {
    padding: 4rem 0;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
}

/* ==========================================================
   FEATURED CARD
========================================================== */

.featured-app-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    padding: 2rem;
    border-radius: 18px;
}

/* ==========================================================
   APPLICATION GRID
========================================================== */

.app-grid {
    display: grid;
    gap: 1.5rem;
}

.app-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    padding: 1.5rem;
    border-radius: 16px;
}

/* ==========================================================
   ROADMAP
========================================================== */

.roadmap {
    display: grid;
    gap: 0.75rem;
    max-width: 500px;
    margin: auto;
}

.roadmap-item {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.02);
}

.roadmap-item.done {
    color: #22c55e;
}

.roadmap-item.active {
    color: #93c5fd;
    border-color: #3b82f6;
}

/* ==========================================================
   PRINCIPLES GRID (FIXED)
========================================================== */

.principles-grid {
    display: grid;
    gap: 1.5rem;
    margin-top: 2rem;
}

.principle-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    padding: 1.5rem;
    border-radius: 16px;
}

/* ==========================================================
   CONTACT FORM (FIXED)
========================================================== */

form {
    display: grid;
    gap: 1rem;
    max-width: 700px;
    margin: 0 auto;
}

input,
textarea {
    width: 100%;
    padding: 1rem;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.05);
    color: white;
    font-family: inherit;
}

input:focus,
textarea:focus {
    outline: 2px solid var(--primary);
}

/* ==========================================================
   BUTTONS
========================================================== */

.btn {
    display: inline-block;
    padding: 0.9rem 1.2rem;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
}

/* ==========================================================
   NUTRITION LABEL (MEAL PLAN ANALYZER)
========================================================== */

.nutrition-label {
    background: white;
    color: #111;
    margin-top: 2rem;
    padding: 1.5rem;
    border-radius: 12px;
    font-family: Arial, sans-serif;
    max-width: 340px;
    box-shadow: var(--shadow-lg);
}

.nutrition-title {
    font-size: 1.5rem;
    font-weight: 900;
    border-bottom: 6px solid #111;
    padding-bottom: 0.5rem;
}

.nutrition-divider {
    border-top: 1px solid #111;
    margin: 0.35rem 0;
}

.nutrition-divider.thick {
    border-top: 6px solid #111;
}

.nutrition-row {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 0;
}

.nutrition-row.strong {
    font-weight: 700;
    font-size: 1.1rem;
}

.nutrition-row.indent {
    padding-left: 1rem;
    font-size: 0.9rem;
}

.nutrition-row.small {
    font-size: 0.85rem;
}

.nutrition-section-title {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    margin-top: 0.5rem;
}

.nutrition-row.highlight {
    background: #f3f4f6;
    padding: 0.3rem;
    font-weight: 700;
}

/* ==========================================================
   FOOTER
========================================================== */

.site-footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

/* ==========================================================
   RESPONSIVE
========================================================== */

@media (min-width: 768px) {

    .desktop-nav {
        display: flex;
    }

    .app-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .principles-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .mobile-menu-btn {
        display: none;
    }
}