:root {
    --background: hsl(45, 30%, 98%);
    --foreground: hsl(220, 20%, 20%);
    --primary: hsl(200, 80%, 45%);
    --destructive: hsl(0, 70%, 55%);
    
    --child-day: hsl(160, 50%, 45%);
    --child-bg: hsl(160, 50%, 92%);
    --free-day: hsl(200, 80%, 45%);
    --free-bg: hsl(200, 80%, 92%);

    --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--background); color: var(--foreground); font-family: sans-serif; min-height: 100vh; display: flex; flex-direction: column; }
.container { max-width: 800px; margin: 0 auto; padding: 20px; width: 100%; flex: 1; }
.hidden { display: none !important; }

/* Header & Footer */
.header { background: white; padding: 1rem; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #eee; }
.logo-container { display: flex; gap: 0.5rem; align-items: center; font-weight: bold; }
.header-logo { width: 40px; height: 40px; object-fit: contain; }
footer { text-align: center; padding: 2rem; color: #999; font-size: 0.8rem; }

/* Components */
.card { background: white; border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.5rem; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.btn-primary { background: var(--primary); color: white; width: 100%; padding: 12px; border-radius: var(--radius); border: none; font-weight: bold; cursor: pointer; display: flex; justify-content: center; gap: 8px; }
.btn-dark { background: var(--foreground); color: white; padding: 8px 20px; border-radius: 8px; border: none; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.btn-icon { background: none; border: none; cursor: pointer; }
.input-std { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 8px; margin-top: 4px; }
.text-child { color: var(--child-day); }

/* Setup & Inputs */
.weekday-selector { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: 5px; }
.weekday-selector button { padding: 8px 2px; border: 1px solid #eee; background: white; border-radius: 4px; font-size: 0.8rem; cursor: pointer; }
.weekday-selector button.selected { background: var(--primary); color: white; border-color: var(--primary); }
.mode-selector { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 10px; margin-bottom: 15px; }
.mode-btn { padding: 6px 14px; border-radius: 20px; border: none; background: #eee; cursor: pointer; white-space: nowrap; }
.mode-btn.active { background: var(--foreground); color: white; }
.inputs-container { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.input-group { display: flex; gap: 8px; align-items: center; width: 100%; }

/* --- HERO CARD (Today) --- */
.hero-status { padding: 1rem; border-radius: 1.5rem; text-align: center; position: relative; border: 1px solid transparent; }
.hero-status.child { background: var(--child-bg); border-color: var(--child-day); }
.hero-status.free { background: var(--free-bg); border-color: var(--free-day); }
.today-label { padding: 9px; font-size: 1.1rem; font-weight: bold; }
.hero-status.split-green-blue { background: linear-gradient(135deg, var(--child-bg) 50%, var(--free-bg) 50%); border-color: #888; }
.hero-status.split-blue-green { background: linear-gradient(135deg, var(--free-bg) 50%, var(--child-bg) 50%); border-color: #888; }
.hero-title { font-size: 1.5rem; font-weight: 800; margin-top: 10px; }

/* --- CALENDAR GRID --- */
.calendar-header { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 0.8rem; font-weight: bold; margin-bottom: 5px; color: #666; }
.results-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.results-grid.single-view { grid-template-columns: 1fr; }
.day-cell { aspect-ratio: 1/1; border-radius: 8px; position: relative; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 0.8rem; transition: transform 0.1s; border: 1px solid rgba(0,0,0,0.05); }
.day-cell:active { transform: scale(0.95); }
.day-cell.empty { background: transparent !important; border: 1px dashed rgba(0,0,0,0.12); box-shadow: none; cursor: default; pointer-events: none; }
.day-cell.is-outside { opacity: 0.3; filter: grayscale(100%); }

.bg-child { background-color: var(--child-bg); color: #0f3d2e; }
.bg-free { background-color: var(--free-bg); color: #0f283d; }
.bg-split-green-blue { background: linear-gradient(135deg, var(--child-bg) 50%, var(--free-bg) 50%); }
.bg-split-blue-green { background: linear-gradient(135deg, var(--free-bg) 50%, var(--child-bg) 50%); }

.cell-date { font-weight: bold; font-size: 0.9rem; z-index: 1; }
.cell-icon { width: 20px; height: 20px; z-index: 1; }
.cell-text { font-size: 0.7rem; margin-top: 2px; z-index: 1; }
.red-badge { position: absolute; top: 2px; right: 2px; width: 8px; height: 8px; background: var(--destructive); border-radius: 50%; }

@media (max-width: 600px) {
    .cell-text { display: none; }
    .cell-date { font-size: 0.8rem; }
    .day-cell { padding: 2px; }
    .inputs-container { flex-direction: column; }
}
@media (min-width: 601px) {
    .inputs-container { flex-direction: row; }
    .day-cell { aspect-ratio: auto; padding: 1rem; min-height: 80px; }
}

.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 1000; display: flex; justify-content: center; align-items: center; -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.modal-content { background: white; padding: 2rem; border-radius: 1.5rem; width: 90%; max-width: 400px; position: relative; box-shadow: 0 10px 25px rgba(0,0,0,0.2); text-align: center; }
.close-btn { position: absolute; top: 10px; right: 10px; background: none; border: none; cursor: pointer; padding: 5px; }

/* --- SEO & CONTENT STYLING --- */
.content-section { max-width: 800px; margin: 3rem auto; padding: 0 1rem; line-height: 1.6; color: var(--foreground); }
.content-section h2 { font-size: 1.5rem; margin-top: 2rem; margin-bottom: 1rem; color: var(--primary); }
.content-section h3 { font-size: 1.2rem; margin-top: 1.5rem; margin-bottom: 0.5rem; font-weight: 700; }
.content-section p, .content-section ul, .content-section ol { margin-bottom: 1rem; }
.content-section ul, .content-section ol { padding-left: 1.5rem; }
.content-section li { margin-bottom: 0.5rem; }

/* Artikel-navigering (Cards) */
.article-nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 3rem; }
.article-link { text-decoration: none; color: var(--foreground); padding: 1.5rem; background: white; border-radius: var(--radius); box-shadow: 0 2px 5px rgba(0,0,0,0.05); transition: transform 0.2s, box-shadow 0.2s; display: flex; flex-direction: column; align-items: center; text-align: center; }
.article-link:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
.article-icon { color: var(--primary); margin-bottom: 0.5rem; }
.article-title { font-weight: bold; font-size: 1.1rem; color: var(--primary); }

/* Källor & Breadcrumbs */
.sources-section { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid #eee; font-size: 0.85rem; color: #666; background: #f9f9f9; padding: 1.5rem; border-radius: 8px; }
.sources-section h3 { margin-top: 0; font-size: 1rem; }
.sources-section ul { list-style: none; padding-left: 0; }
.sources-section li { margin-bottom: 0.5rem; }
.sources-section a { color: var(--primary); text-decoration: underline; }
.breadcrumbs { font-size: 0.9rem; margin-bottom: 1.5rem; color: #666; }
.breadcrumbs a { color: var(--primary); text-decoration: none; }