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

:root {
    --color-bg: #F0F8FF;
    --color-surface: #FFFFFF;
    --color-primary: #0288D1;
    --color-primary-dark: #01579B;
    --color-accent: #FF6F00;
    --color-text: #1A1A2E;
    --color-text-muted: #546E7A;
    --color-border: #B0BEC5;
    --color-green: #2E7D32;
    --color-yellow: #F9A825;
    --color-red: #C62828;
    --color-frost: #E1F5FE;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --font-sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --max-width: 960px;
}

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

body {
    font-family: var(--font-sans);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== Skip Link ===== */
.skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    background: var(--color-primary);
    color: #fff;
    padding: 8px 16px;
    z-index: 1000;
    border-radius: 0 0 var(--radius-sm) 0;
    font-weight: 600;
    text-decoration: none;
}

.skip-link:focus {
    top: 0;
}

/* ===== Container ===== */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== Header ===== */
.site-header {
    background: var(--color-surface);
    border-bottom: 2px solid var(--color-frost);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 12px;
    padding-bottom: 12px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--color-primary-dark);
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.3px;
}

.logo svg {
    flex-shrink: 0;
}

.nav-list {
    list-style: none;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.nav-list a {
    text-decoration: none;
    color: var(--color-text-muted);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
    padding: 4px 0;
    border-bottom: 2px solid transparent;
}

.nav-list a:hover,
.nav-list a:focus {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

/* ===== Hero ===== */
.hero {
    background: linear-gradient(135deg, #E1F5FE 0%, #B3E5FC 100%);
    padding: 48px 0 40px;
    text-align: center;
    border-bottom: 1px solid #B3E5FC;
}

.hero h1 {
    font-size: 2.2rem;
    color: var(--color-primary-dark);
    margin-bottom: 16px;
    letter-spacing: -0.5px;
    line-height: 1.25;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--color-text-muted);
    max-width: 640px;
    margin: 0 auto;
}

/* ===== Tracker Section ===== */
.tracker-section {
    padding: 40px 0;
}

.tracker-section h2 {
    font-size: 1.6rem;
    color: var(--color-primary-dark);
    margin-bottom: 20px;
}

.add-item-form {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-md);
    margin-bottom: 24px;
    border: 1px solid var(--color-border);
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 160px;
}

.form-group label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select {
    padding: 10px 12px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: var(--font-sans);
    background: #FAFAFA;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(2, 136, 209, 0.15);
}

.btn {
    padding: 10px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    font-family: var(--font-sans);
    white-space: nowrap;
}

.btn:active {
    transform: scale(0.97);
}

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

.btn-primary:hover,
.btn-primary:focus {
    background: var(--color-primary-dark);
    outline: none;
}

.btn-danger {
    background: transparent;
    color: var(--color-red);
    border: 1.5px solid var(--color-red);
    padding: 6px 14px;
    font-size: 0.85rem;
}

.btn-danger:hover,
.btn-danger:focus {
    background: #FFEBEE;
}

.inventory-status {
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

/* ===== Inventory Grid ===== */
.inventory-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 640px) {
    .inventory-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.inventory-card {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    position: relative;
    transition: box-shadow 0.2s;
}

.inventory-card:hover {
    box-shadow: var(--shadow-md);
}

.inventory-card h3 {
    font-size: 1.15rem;
    margin-bottom: 4px;
    color: var(--color-text);
}

.inventory-card .food-type-badge {
    display: inline-block;
    background: var(--color-frost);
    color: var(--color-primary-dark);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 20px;
    margin-bottom: 10px;
}

.inventory-card .dates {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-bottom: 8px;
}

.inventory-card .dates span {
    display: block;
}

.progress-bar-container {
    height: 8px;
    background: #ECEFF1;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s, background 0.3s;
}

.progress-bar-fill.safe {
    background: linear-gradient(90deg, #66BB6A, #43A047);
}

.progress-bar-fill.warning {
    background: linear-gradient(90deg, #FFA726, #F9A825);
}

.progress-bar-fill.expiring {
    background: linear-gradient(90deg, #EF5350, #C62828);
}

.status-text {
    font-weight: 600;
    font-size: 0.85rem;
}

.status-text.safe {
    color: var(--color-green);
}

.status-text.warning {
    color: var(--color-yellow);
}

.status-text.expiring {
    color: var(--color-red);
}

.card-actions {
    position: absolute;
    top: 16px;
    right: 16px;
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--color-text-muted);
}

.empty-state svg {
    margin-bottom: 16px;
    opacity: 0.6;
}

.empty-state p {
    font-size: 1.05rem;
}

.hidden {
    display: none !important;
}

/* ===== Guidelines Section ===== */
.guidelines-section {
    padding: 40px 0;
    background: var(--color-surface);
    border-top: 1px solid var(--color-frost);
    border-bottom: 1px solid var(--color-frost);
}

.guidelines-section h2 {
    font-size: 1.6rem;
    color: var(--color-primary-dark);
    margin-bottom: 12px;
}

.section-intro {
    color: var(--color-text-muted);
    margin-bottom: 24px;
    max-width: 700px;
}

.guidelines-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

@media (min-width: 540px) {
    .guidelines-grid {
        grid-template-columns: 1fr 1fr;
    }
}

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

.guideline-card {
    background: var(--color-frost);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    border-left: 4px solid var(--color-primary);
}

.guideline-card h4 {
    font-size: 0.95rem;
    color: var(--color-primary-dark);
    margin-bottom: 4px;
}

.guideline-card p {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

/* ===== Tips Section ===== */
.tips-section {
    padding: 40px 0;
}

.tips-section h2 {
    font-size: 1.6rem;
    color: var(--color-primary-dark);
    margin-bottom: 20px;
}

.tips-list {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

@media (min-width: 640px) {
    .tips-list {
        grid-template-columns: 1fr 1fr;
    }
}

.tips-list li {
    background: var(--color-surface);
    padding: 16px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    font-size: 0.95rem;
    line-height: 1.5;
}

.tips-list li strong {
    color: var(--color-primary-dark);
}

/* ===== Footer ===== */
.site-footer {
    margin-top: auto;
    background: var(--color-primary-dark);
    color: #B3E5FC;
    padding: 24px 0;
    font-size: 0.9rem;
}

.site-footer .container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.footer-nav {
    list-style: none;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.footer-nav a {
    color: #B3E5FC;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-nav a:hover {
    color: #fff;
}

/* ===== Responsive ===== */
@media (max-width: 540px) {
    .hero h1 {
        font-size: 1.6rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .form-row {
        flex-direction: column;
    }

    .form-group {
        min-width: 100%;
    }

    .site-header .container {
        flex-direction: column;
        align-items: flex-start;
    }

    .nav-list {
        gap: 12px;
    }
}

/* ===== About / Legal Pages ===== */
.content-page {
    padding: 40px 0;
    min-height: 60vh;
}

.content-page h1 {
    font-size: 1.8rem;
    color: var(--color-primary-dark);
    margin-bottom: 20px;
}

.content-page .prose {
    max-width: 720px;
    line-height: 1.7;
    color: var(--color-text);
}

.content-page .prose p {
    margin-bottom: 16px;
}

.content-page .prose h2 {
    font-size: 1.3rem;
    color: var(--color-primary-dark);
    margin-top: 28px;
    margin-bottom: 12px;
}



/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
