/* GeniusMealPlan - Clean Design System */
/* Following strict design rules for calm, friendly, premium feel */

/* ============================================
   DESIGN TOKENS
   ============================================ */
:root {
    /* Colors - Pastel Palette */
    --primary: #B8E5D5;
    --primary-dark: #8FD4BE;
    --secondary: #FFCDB2;
    --background: #FFF5E6;
    --surface: #FFFFFF;
    --text: #2D3436;
    --text-light: #636E72;

    /* Spacing */
    --space-xs: 8px;
    --space-sm: 12px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;

    /* Typography */
    --font-family: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-headline: 24px;
    --font-body: 16px;
    --font-small: 14px;

    /* Borders */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-soft: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-medium: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-body);
    color: var(--text);
    background-color: var(--background);
    line-height: 1.6;
    min-height: 100vh;
}

/* ============================================
   LAYOUT
   ============================================ */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: var(--space-lg);
}

.container-wide {
    max-width: 900px;
    margin: 0 auto;
    padding: var(--space-lg);
}

main.responsive {
    padding: var(--space-lg);
    padding-top: 80px; /* Account for fixed header */
    min-height: calc(100vh - 60px);
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3 {
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
}

h1 {
    font-size: var(--font-headline);
    margin-bottom: var(--space-md);
}

h2 {
    font-size: 20px;
    margin-bottom: var(--space-md);
}

h3 {
    font-size: 18px;
    margin-bottom: var(--space-sm);
}

p {
    color: var(--text-light);
    margin-bottom: var(--space-md);
}

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

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-lg);
    min-height: 48px;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: var(--font-body);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-soft);
}

.btn-primary {
    background: var(--primary);
    color: var(--text);
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: var(--shadow-medium);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--text);
}

.btn-outline {
    background: transparent;
    color: var(--text);
    border: 2px solid var(--primary);
    box-shadow: none;
}

.btn-outline:hover {
    background: var(--primary);
}

.btn-full {
    width: 100%;
}

.btn-lg {
    min-height: 56px;
    padding: var(--space-md) var(--space-xl);
    font-size: 18px;
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    margin-bottom: var(--space-md);
    box-shadow: var(--shadow-soft);
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: var(--space-sm);
}

/* ============================================
   FORMS
   ============================================ */
.form-group {
    margin-bottom: var(--space-md);
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: var(--space-xs);
    color: var(--text);
}

.form-input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
    width: 100%;
    min-height: 48px;
    padding: var(--space-sm) var(--space-md);
    border: 2px solid #E0E0E0;
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: var(--font-body);
    color: var(--text);
    background: var(--surface);
    transition: border-color 0.2s ease;
}

.form-input:focus,
input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
}

.form-input::placeholder,
input::placeholder {
    color: var(--text-light);
}

/* ============================================
   NAVIGATION (Beer CSS overrides)
   ============================================ */
header.fixed {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--surface);
    box-shadow: var(--shadow-soft);
    padding: var(--space-sm) var(--space-lg);
}

header nav {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

header .brand {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-weight: 700;
    font-size: 18px;
    color: var(--text);
    text-decoration: none;
}

header .brand i {
    color: var(--primary-dark);
}

header .chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-full);
    font-weight: 500;
    font-size: 14px;
    text-decoration: none;
    color: var(--text);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

header .chip i {
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

header .chip span {
    line-height: 1;
}

header .chip:hover {
    background: var(--background);
}

header .chip.primary {
    background: var(--primary);
}

header .chip.primary:hover {
    background: var(--primary-dark);
}

header .btn-filled {
    background: var(--primary);
    color: var(--text);
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-full);
    text-decoration: none;
    font-weight: 600;
}

/* Hide mobile menu button on desktop */
header button[data-ui="#mobile-menu"] {
    display: none;
}

@media (max-width: 768px) {
    header .chip .max,
    header .divider {
        display: none;
    }

    header button[data-ui="#mobile-menu"] {
        display: flex;
    }
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
    background: #F5F5F5;
    margin-top: auto;
}

.footer-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 24px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 32px;
}

/* Brand Section */
.footer-brand {
    flex-shrink: 0;
}

.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 8px;
}

.footer-logo i {
    font-size: 22px;
    color: var(--primary-dark);
}

.footer-tagline {
    font-size: 13px;
    color: #9E9E9E;
    margin: 0;
}

/* Links Section */
.footer-links {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
}

.footer-links a {
    font-size: 14px;
    color: #636E72;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--text);
}

/* Social Section */
.footer-social {
    display: flex;
    gap: 16px;
}

.social-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #E8E8E8;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #636E72;
    transition: all 0.2s;
}

.social-icon:hover {
    background: var(--primary);
    color: var(--text);
}

.social-icon svg {
    width: 18px;
    height: 18px;
}

/* Bottom Section */
.footer-bottom {
    border-top: 1px solid #E0E0E0;
    padding: 20px 24px;
    text-align: center;
}

.footer-bottom p {
    font-size: 13px;
    color: #9E9E9E;
    margin: 0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 24px;
    }

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

    .footer-links {
        justify-content: center;
        gap: 20px;
    }

    .footer-social {
        justify-content: center;
    }
}

/* ============================================
   HOME PAGE
   ============================================ */
.home-container {
    max-width: 500px;
    margin: 0 auto;
    padding: var(--space-2xl) var(--space-lg);
    text-align: center;
}

.home-icon {
    width: 80px;
    height: 80px;
    background: var(--primary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-lg);
}

.home-icon i {
    font-size: 40px;
    color: var(--text);
}

.home-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: var(--space-sm);
    color: var(--text);
}

.home-subtitle {
    font-size: var(--font-body);
    color: var(--text-light);
    margin-bottom: var(--space-xl);
    line-height: 1.6;
}

.home-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.home-features {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-top: var(--space-xl);
}

.feature-item {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    text-align: left;
    box-shadow: var(--shadow-soft);
}

.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.feature-icon.primary {
    background: var(--primary);
}

.feature-icon.secondary {
    background: var(--secondary);
}

.feature-icon.tertiary {
    background: #E2D1F9;
}

.feature-text h3 {
    font-size: var(--font-body);
    font-weight: 600;
    margin-bottom: 4px;
}

.feature-text p {
    font-size: var(--font-small);
    color: var(--text-light);
    margin: 0;
}

/* ============================================
   AUTH PAGES
   ============================================ */
.auth-container {
    max-width: 400px;
    margin: 0 auto;
    padding: var(--space-xl) var(--space-lg);
}

.auth-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.auth-icon {
    width: 64px;
    height: 64px;
    background: var(--primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-md);
}

.auth-icon i {
    font-size: 32px;
    color: var(--text);
}

.auth-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-soft);
}

.auth-footer {
    text-align: center;
    margin-top: var(--space-lg);
    color: var(--text-light);
}

.auth-footer a {
    color: var(--text);
    font-weight: 600;
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* ============================================
   DASHBOARD
   ============================================ */
.dashboard-container {
    max-width: 600px;
    margin: 0 auto;
    padding: var(--space-lg);
}

.dashboard-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.dashboard-greeting {
    font-size: var(--font-headline);
    font-weight: 700;
    margin-bottom: var(--space-xs);
}

.dashboard-subtext {
    color: var(--text-light);
}

.dashboard-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.action-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    text-decoration: none;
    color: var(--text);
    box-shadow: var(--shadow-soft);
    transition: all 0.2s ease;
}

.action-card:hover {
    box-shadow: var(--shadow-medium);
    transform: translateY(-2px);
}

.action-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.action-icon i {
    font-size: 28px;
}

.action-icon.generate {
    background: var(--primary);
}

.action-icon.meals {
    background: var(--secondary);
}

.action-icon.shopping {
    background: #E2D1F9;
}

.action-content h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.action-content p {
    font-size: var(--font-small);
    color: var(--text-light);
    margin: 0;
}

/* ============================================
   SETTINGS PAGE
   ============================================ */
.settings-container {
    max-width: 500px;
    margin: 0 auto;
    padding: var(--space-lg);
}

.settings-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.settings-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: var(--space-sm);
}

.settings-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-md);
    border: 2px solid #E0E0E0;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    background: var(--surface);
}

.settings-option:hover {
    border-color: var(--primary);
}

.settings-option.selected {
    border-color: var(--primary);
    background: var(--primary);
}

.settings-option .option-icon {
    font-size: 24px;
    margin-bottom: var(--space-xs);
}

.settings-option .option-text {
    font-size: var(--font-small);
    font-weight: 500;
}

/* Pill options for multi-select */
.pill-options {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.pill-option {
    padding: var(--space-xs) var(--space-md);
    border: 2px solid #E0E0E0;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-size: var(--font-small);
    font-weight: 500;
    transition: all 0.2s;
    background: var(--surface);
}

.pill-option:hover {
    border-color: var(--primary);
}

.pill-option.selected {
    border-color: var(--primary);
    background: var(--primary);
}

/* ============================================
   MEAL GENERATOR
   ============================================ */
.generator-container {
    max-width: 500px;
    margin: 0 auto;
    padding: var(--space-lg);
}

.generator-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

/* ============================================
   SNACKBAR / ALERTS
   ============================================ */
.snackbar {
    position: fixed;
    bottom: var(--space-lg);
    left: 50%;
    transform: translateX(-50%);
    background: var(--text);
    color: var(--surface);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-medium);
    display: none;
    align-items: center;
    gap: var(--space-sm);
    z-index: 1000;
}

.snackbar.active {
    display: flex;
}

.snackbar.success {
    background: #2E7D32;
}

.snackbar.error {
    background: #C62828;
}

/* ============================================
   UTILITIES
   ============================================ */
.mt-1 { margin-top: var(--space-xs); }
.mt-2 { margin-top: var(--space-md); }
.mt-3 { margin-top: var(--space-lg); }
.mb-1 { margin-bottom: var(--space-xs); }
.mb-2 { margin-bottom: var(--space-md); }
.mb-3 { margin-bottom: var(--space-lg); }
.ml-1 { margin-left: var(--space-xs); }

.text-light { color: var(--text-light); }
.hidden { display: none; }

/* ============================================
   LOADING
   ============================================ */
.loading {
    display: flex;
    justify-content: center;
    padding: var(--space-xl);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #E0E0E0;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
