/* ==========================================================
   Social Media Posting Guide - dashboard styles
   Light, modern, responsive and accessible.
   ========================================================== */

:root {
    --bg: #f3f4f6;
    --surface: #ffffff;
    --surface-muted: #f8f9fb;
    --border: #e5e7eb;
    --text: #111827;
    --text-muted: #6b7280;

    /* Primary blue for buttons, links and highlights */
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-soft: #eaf1ff;
    --accent-strong: #1e3a8a;

    /* Soft yellow used for the progress highlight card */
    --highlight: #fde68a;
    --highlight-text: #422006;

    --success: #15803d;
    --radius-lg: 20px;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(17, 24, 39, 0.04), 0 8px 24px rgba(17, 24, 39, 0.06);
    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* ---------- Platform colours ----------
   The platform name is always written out, so colour is never the only cue. */
[data-platform="facebook"] {
    --p: #1877f2;
    --p-soft: #e7f0fd;
    --p-text: #0b4fb3;
}

[data-platform="instagram"] {
    --p: #d62976;
    --p-soft: #fdeef5;
    --p-text: #9d1a56;
}

[data-platform="linkedin"] {
    --p: #0a66c2;
    --p-soft: #e8f1fa;
    --p-text: #064f93;
}

[data-platform="youtube"] {
    --p: #e11d1d;
    --p-soft: #fdeeee;
    --p-text: #9f1212;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
}

h1,
h2,
h3 {
    line-height: 1.2;
    margin: 0;
}

h1 {
    font-size: clamp(2rem, 4vw + 0.5rem, 3.1rem);
    font-weight: 600;
    letter-spacing: -0.03em;
}

h2 {
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

h3 {
    font-size: 1.05rem;
    font-weight: 600;
}

p {
    margin: 0;
}

.container {
    width: min(1180px, 100% - 2.5rem);
    margin-inline: auto;
}

/* ---------- Accessibility helpers ---------- */

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: -3rem;
    background: var(--surface);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    z-index: 10;
    transition: top 0.15s ease;
}

.skip-link:focus {
    top: 1rem;
}

:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

/* ---------- Top bar ---------- */

.topbar {
    padding: 1rem 0 0;
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: var(--surface);
    border-radius: 999px;
    box-shadow: var(--shadow);
    padding: 0.55rem 0.6rem 0.55rem 0.9rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
}

.topnav {
    display: flex;
    gap: 0.25rem;
}

.topnav a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.topnav a:hover {
    background: var(--surface-muted);
    color: var(--text);
}

/* ---------- Layout ---------- */

main.dashboard {
    padding: 2rem 0 3rem;
}

.hero {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.25rem;
}

.eyebrow {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.eyebrow-dark {
    color: var(--highlight-text);
    opacity: 0.8;
}

.tagline {
    color: var(--text-muted);
    margin-top: 0.6rem;
    font-size: 1.02rem;
    max-width: 52ch;
}

.layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 1.5rem;
    align-items: start;
}

/* ---------- Controls ---------- */

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 0.9rem;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    flex: 1 1 190px;
}

.field label {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-muted);
    padding-left: 0.3rem;
}

select {
    font: inherit;
    padding: 0.6rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-muted);
    color: var(--text);
    min-height: 44px;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

select:hover {
    border-color: #c7d2fe;
}

select:focus-visible {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Primary blue pill button */
.btn {
    font: inherit;
    font-weight: 600;
    min-height: 44px;
    padding: 0.6rem 1.4rem;
    border-radius: 999px;
    border: 1px solid var(--accent);
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
    transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
    background: var(--accent-hover);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.32);
}

.btn:active {
    transform: translateY(1px);
}

.timezone-note {
    margin: 0 0 0.5rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.timezone-note strong {
    color: var(--text);
}

.offset {
    font-size: 0.9rem;
}

.filter-status {
    display: inline-block;
    margin-bottom: 1.5rem;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--accent-strong);
    background: var(--accent-soft);
    padding: 0.3rem 0.8rem;
    border-radius: 999px;
}

/* ---------- Stat cards ---------- */

.stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1.25rem 1.4rem;
}

.stat-number {
    font-size: clamp(2.2rem, 4vw, 3.2rem);
    font-weight: 500;
    letter-spacing: -0.04em;
    line-height: 1;
    color: var(--text);
}

.stat-of {
    font-size: 1.1rem;
    color: var(--text-muted);
    letter-spacing: 0;
}

.stat-label {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* ---------- Weekly grid ---------- */

.section-head {
    margin-bottom: 0.9rem;
}

.week-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

.day-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1.1rem 1.15rem 1.15rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.day-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(17, 24, 39, 0.04), 0 14px 30px rgba(17, 24, 39, 0.08);
}

.day-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
}

.day-count {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--surface-muted);
    border: 1px solid var(--border);
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    white-space: nowrap;
}

.platform-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.6rem;
}

/* Each platform row: a coloured tag, then its windows */
.platform-row {
    display: grid;
    gap: 0.35rem;
    padding: 0.6rem 0.65rem;
    border-radius: 12px;
    background: var(--surface-muted);
    border-left: 4px solid var(--p, var(--border));
}

.platform-tag {
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--p-text, var(--text-muted));
}

.windows {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.windows li {
    background: var(--p-soft, var(--accent-soft));
    color: var(--p-text, var(--accent-strong));
    border-radius: 999px;
    padding: 0.2rem 0.6rem;
    font-size: 0.86rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.empty {
    color: var(--text-muted);
    font-size: 0.86rem;
    font-style: italic;
}

/* ---------- Platform filter ----------
   Hides the other platforms' rows and emphasises the chosen one. */
.week-grid[data-filter="facebook"] .platform-row:not([data-platform="facebook"]),
.week-grid[data-filter="instagram"] .platform-row:not([data-platform="instagram"]),
.week-grid[data-filter="linkedin"] .platform-row:not([data-platform="linkedin"]),
.week-grid[data-filter="youtube"] .platform-row:not([data-platform="youtube"]) {
    display: none;
}

.week-grid[data-filter="facebook"] .platform-row[data-platform="facebook"],
.week-grid[data-filter="instagram"] .platform-row[data-platform="instagram"],
.week-grid[data-filter="linkedin"] .platform-row[data-platform="linkedin"],
.week-grid[data-filter="youtube"] .platform-row[data-platform="youtube"] {
    background: var(--p-soft);
}

.starter-note {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* ---------- Side column: progress and checklist ---------- */

.side {
    display: grid;
    gap: 1rem;
}

.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1.4rem 1.5rem;
}

.progress-card {
    background: var(--highlight);
    color: var(--highlight-text);
    box-shadow: none;
}

.progress-card h2 {
    color: var(--highlight-text);
    margin-bottom: 1rem;
}

.progress-count {
    font-size: 4rem;
    font-weight: 500;
    letter-spacing: -0.05em;
    line-height: 1;
}

.progress-text {
    font-weight: 600;
    margin: 0.4rem 0 0.9rem;
}

.progress-bar {
    height: 10px;
    background: rgba(255, 255, 255, 0.65);
    border-radius: 999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--highlight-text);
    border-radius: 999px;
    transition: width 0.3s ease;
}

.progress-bar.complete .progress-fill {
    background: var(--success);
}

.checklist-items {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.2rem;
}

.check-label {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.6rem 0.6rem;
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.check-label:hover {
    background: var(--surface-muted);
}

.check-label input[type="checkbox"] {
    width: 19px;
    height: 19px;
    margin-top: 0.12rem;
    accent-color: var(--accent);
    flex-shrink: 0;
    cursor: pointer;
}

.check-label input:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

.check-label input:checked + span {
    color: var(--text-muted);
    text-decoration: line-through;
    text-decoration-color: #9ca3af;
}

.checklist .small-note {
    margin-top: 0.9rem;
    font-size: 0.84rem;
    color: var(--text-muted);
}

/* ---------- Notice / error ---------- */

.notice-error {
    border: 1px solid #fecaca;
    background: #fef2f2;
    margin-top: 1rem;
}

.notice-error h2 {
    color: #991b1b;
    margin-bottom: 0.5rem;
}

/* ---------- Footer ---------- */

.disclaimer {
    margin-top: 2rem;
    padding: 1rem 1.25rem;
    background: var(--accent-soft);
    border-radius: var(--radius);
    color: var(--accent-strong);
    font-size: 0.92rem;
}

/* ---------- Responsive: tablet ---------- */

@media (max-width: 1024px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .side {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }
}

/* ---------- Responsive: mobile ---------- */

@media (max-width: 640px) {
    .container {
        width: min(100%, 100% - 1.25rem);
    }

    .topnav {
        display: none;
    }

    .topbar-inner {
        justify-content: flex-start;
    }

    .controls {
        width: 100%;
    }

    .field {
        flex-basis: 100%;
    }

    .controls .btn {
        width: 100%;
    }

    .stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.6rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-label {
        font-size: 0.78rem;
    }

    .week-grid {
        grid-template-columns: 1fr;
    }

    .side {
        grid-template-columns: 1fr;
    }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
