/* ABOUTME: Design-system CSS for mydailyupdate. Tokens match the 2026-04 homepage redesign. */
/* ABOUTME: Dark theme + lime accent default; light/accent overrides live under [data-theme] / [data-accent]. */

:root {
    --bg: #15181d;
    --bg-2: #1c2027;
    --bg-3: #232833;
    --ink: #ffffff;
    --ink-2: #d4d8e0;
    --ink-3: #8b92a0;
    --rule: #2d333f;
    --rule-2: #262b34;
    --accent: #a3e635;
    --danger: #f87171;
    --success: #86efac;
    /* System fonts — no network fetch, no FOUT. */
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

[data-accent="amber"]   { --accent: #f59e0b; }
[data-accent="cyan"]    { --accent: #22d3ee; }
[data-accent="magenta"] { --accent: #e879f9; }
[data-accent="white"]   { --accent: #f5f5f5; }

[data-theme="light"] {
    --bg: #fafafa;
    --bg-2: #fff;
    --bg-3: #f4f4f4;
    --ink: #111;
    --ink-2: #3a3a3a;
    --ink-3: #6b6b6b;
    --rule: #e2e2e2;
    --rule-2: #ececec;
    --accent: #15803d;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

body { min-height: 100vh; }

a { color: inherit; text-decoration: none; }
a.link { color: var(--ink); border-bottom: 1px solid var(--rule); padding-bottom: 1px; transition: color 100ms, border-color 100ms; }
a.link:hover { color: var(--accent); border-color: var(--accent); }

button { font-family: inherit; cursor: pointer; }

input, textarea, select {
    font-family: var(--font-sans);
    font-size: 15px;
    color: var(--ink);
    background: var(--bg-2);
    border: 1px solid var(--rule);
    border-radius: 4px;
    padding: 10px 12px;
    outline: none;
    transition: border-color 100ms;
    width: 100%;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
textarea { resize: vertical; font-family: var(--font-mono); font-size: 14px; line-height: 1.5; }

label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}
label > span,
label {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--ink-3);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
/* Inline-type labels (checkbox/radio) shouldn't stack vertically */
label.inline {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    text-transform: none;
    letter-spacing: 0;
    font-family: var(--font-sans);
    font-size: 15px;
    color: var(--ink-2);
}
label.inline input[type="checkbox"] { width: auto; }

/* Helpers */
.mono { font-family: var(--font-mono); }
.small { font-size: 14.5px; }
.dim { color: var(--ink-3); }
.accent { color: var(--accent); }

/* Layout */
.app { max-width: 1100px; margin: 0 auto; padding: 0 28px; }
.narrow { max-width: 480px; margin: 0 auto; }

/* ——— Buttons ——— */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 14px;
    border: 1px solid var(--rule);
    background: var(--bg-2);
    color: var(--ink);
    font-family: var(--font-mono);
    font-size: 14px;
    border-radius: 4px;
    transition: border-color 100ms, background 100ms, color 100ms, filter 100ms;
    text-decoration: none;
}
.btn:hover { border-color: var(--ink-3); }
.btn-primary {
    background: #84cc16;
    border-color: #84cc16;
    color: #0a0d11;
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 17px;
    letter-spacing: 0;
}
.btn-primary:hover { filter: brightness(1.08); border-color: #84cc16; }
.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--ink-2);
}
.btn-ghost:hover {
    color: var(--ink);
    border-color: var(--rule);
    background: var(--bg-2);
}
.btn-lg { padding: 14px 20px; font-size: 17px; }
.btn-sm { padding: 6px 10px; font-size: 13px; }
.btn-block { width: 100%; }

/* ——— Action cards (big button-style links with title + subtitle) ——— */
.action-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px 20px;
    border: 1px solid var(--rule);
    background: var(--bg-2);
    color: var(--ink);
    border-radius: 6px;
    text-decoration: none;
    transition: border-color 120ms, background 120ms, filter 120ms;
}
.action-card strong {
    font-family: var(--font-sans);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0;
}
.action-card span {
    font-family: var(--font-sans);
    font-size: 14px;
    color: var(--ink-3);
    line-height: 1.45;
}
.action-card:hover {
    border-color: var(--accent);
}
.action-card-primary {
    background: #3d5a80;
    border-color: #3d5a80;
    color: #f5f5f5;
}
.action-card-primary span { color: #c5d2e3; }
.action-card-primary:hover { background: #486a94; border-color: #486a94; }

/* ——— Nav ——— */
.site-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    gap: 16px;
    font-family: var(--font-mono);
    font-size: 14px;
}
.site-nav .brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink-2);
}
.site-nav .brand .dot { width: 8px; height: 8px; background: var(--accent); border-radius: 50%; }
.site-nav .right { display: inline-flex; gap: 18px; align-items: center; color: var(--ink-3); }
.site-nav .right a { color: var(--ink-3); }
.site-nav .right a:hover { color: var(--ink); }
.site-nav .right form { margin: 0; }
.site-nav .right form button { margin: 0; }

/* ——— Hero ——— */
.hero { padding: 72px 0 64px; }
.hero-tag {
    font-family: var(--font-mono);
    font-size: 15px;
    color: var(--ink-3);
    margin-bottom: 28px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.hero-tag .dot {
    width: 6px; height: 6px; background: var(--accent); border-radius: 50%;
    animation: pulse 2s ease infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.hero-title {
    font-size: clamp(40px, 6vw, 64px);
    line-height: 1.05;
    letter-spacing: -0.03em;
    font-weight: 500;
    margin: 0 0 24px;
    max-width: 30ch;
}
.hero-title .muted { color: var(--ink-3); }
.hero-sub {
    font-size: 18px;
    color: var(--ink-2);
    max-width: 58ch;
    line-height: 1.55;
    margin: 0 0 32px;
}
/* ——— Section ——— */
.section { padding: 56px 0; }
.section-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 28px;
    gap: 24px;
    flex-wrap: wrap;
}
.section-title {
    font-size: 24px;
    letter-spacing: -0.01em;
    font-weight: 500;
    margin: 0;
}
.section-tag {
    font-family: var(--font-mono);
    font-size: 14.5px;
    color: var(--ink-3);
}

/* ——— Pod list (homepage) ——— */
.pods { display: flex; flex-direction: column; border-top: 1px solid var(--rule); }
.pod {
    display: grid;
    grid-template-columns: 52px 1fr auto;
    gap: 20px;
    align-items: center;
    padding: 18px 8px;
    border-bottom: 1px solid var(--rule);
    transition: background 100ms;
}
.pod:hover { background: var(--bg-2); }
.pod-play {
    width: 44px; height: 44px; border-radius: 6px;
    background: var(--bg-2);
    border: 1px solid var(--rule);
    color: var(--ink);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 100ms, border-color 100ms, color 100ms, opacity 100ms;
}
.pod-play:hover:not(:disabled) { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.pod-play:disabled { opacity: 0.4; cursor: not-allowed; }
.pod-play.is-playing { background: var(--accent); border-color: var(--accent); color: var(--bg); }

.pod-main { min-width: 0; }
.pod-top { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; flex-wrap: wrap; }
.pod-name { font-size: 16px; font-weight: 500; color: var(--ink); transition: color 100ms; }
.pod-name a { color: inherit; }
a.pod-name:hover { color: var(--accent); }
.pod-badge {
    font-family: var(--font-mono);
    font-size: 13.5px;
    color: var(--ink-3);
    padding: 2px 6px;
    border: 1px solid var(--rule);
    border-radius: 3px;
}
.pod-latest {
    font-size: 16px;
    color: var(--ink-2);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 60ch;
}
.pod-sources {
    display: flex;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--ink-3);
    margin-top: 6px;
    flex-wrap: wrap;
}
.pod-sources span::before { content: '/ '; color: var(--rule); }
.pod-sources span:first-child::before { content: ''; }

.pod-right { display: flex; align-items: center; gap: 8px; }
.pod-duration {
    font-family: var(--font-mono);
    font-size: 14.5px;
    color: var(--ink-3);
    min-width: 56px;
    text-align: right;
}

.pod-progress {
    grid-column: 1 / -1;
    height: 2px;
    background: var(--rule);
    margin-top: 12px;
    position: relative;
}
.pod-progress-bar {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    background: var(--accent);
    width: 0;
    transition: width 180ms linear;
}

/* ——— Footer ——— */
.footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 32px 0;
    margin-top: 40px;
    border-top: 1px solid var(--rule);
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--ink-3);
}
.footer a:hover { color: var(--ink); }
.footer-right { display: flex; gap: 20px; }

/* ——— Modal ——— */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: fade 160ms ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
    background: var(--bg);
    border: 1px solid var(--rule);
    max-width: 480px;
    width: 100%;
    padding: 28px;
    position: relative;
    border-radius: 6px;
    animation: rise 200ms cubic-bezier(.2, .7, .2, 1);
}
@keyframes rise {
    from { transform: translateY(8px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--ink-3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}
.modal-close:hover { background: var(--bg-2); color: var(--ink); }
.modal-title { font-size: 20px; font-weight: 500; margin: 0 0 6px; color: var(--ink); }
.modal-sub { color: var(--ink-2); font-size: 14.5px; margin: 0 0 20px; }
.rss-row {
    display: flex;
    align-items: stretch;
    gap: 6px;
    margin-bottom: 16px;
}
.rss-url {
    flex: 1;
    padding: 10px 12px;
    background: var(--bg-2);
    border: 1px solid var(--rule);
    font-family: var(--font-mono);
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border-radius: 4px;
    color: var(--ink);
}
.platform-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 8px;
}
.platform-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid var(--rule);
    background: var(--bg-2);
    color: var(--ink);
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 100ms;
}
.platform-btn:hover { border-color: var(--accent); }
.platform-btn .mono { color: var(--ink-3); font-size: 12px; }

/* ——— Auth pages (full-page, not slide-in) ——— */
.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}
.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-2);
    border: 1px solid var(--rule);
    border-radius: 6px;
    padding: 36px;
}
.auth-kicker {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--accent);
    margin-bottom: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.auth-title {
    font-size: 28px;
    font-weight: 500;
    letter-spacing: -0.015em;
    margin: 0 0 8px;
    color: var(--ink);
}
.auth-sub {
    color: var(--ink-2);
    font-size: 14.5px;
    margin: 0 0 24px;
}
.auth-switch {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--ink-3);
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--rule);
    text-align: center;
}
.auth-switch a.link { font-size: 12px; }

/* ——— Generic flash messages ——— */
.flash { margin: 0 0 16px; font-size: 14px; }
.flash-error { color: var(--danger); }
.flash-success { color: var(--success); }

/* ——— Dashboard + podcast detail ——— */
.card-list { display: flex; flex-direction: column; gap: 12px; }
.card {
    background: var(--bg-2);
    border: 1px solid var(--rule);
    border-radius: 6px;
    padding: 20px;
}
.card h3 { margin: 0 0 6px; font-size: 17px; font-weight: 500; }
.card p { margin: 0; color: var(--ink-2); font-size: 14.5px; }

.feed-line {
    font-family: var(--font-mono);
    font-size: 13.5px;
    color: var(--ink-2);
    background: var(--bg-2);
    border: 1px solid var(--rule);
    padding: 10px 12px;
    border-radius: 4px;
    overflow-x: auto;
    white-space: nowrap;
}

/* Episode article cards */
article.episode {
    background: var(--bg-2);
    border: 1px solid var(--rule);
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 14px;
}
article.episode header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
article.episode audio { width: 100%; margin-top: 12px; }
article.episode details { margin-top: 10px; }
article.episode summary { cursor: pointer; font-family: var(--font-mono); font-size: 13px; color: var(--ink-3); }
article.episode summary:hover { color: var(--ink); }

/* Status badges */
.badge {
    font-family: var(--font-mono);
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 3px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.badge-ready { background: var(--accent); color: var(--bg); }
.badge-failed { background: var(--danger); color: var(--bg); }
.badge-progress {
    background: var(--bg-3);
    color: var(--ink-2);
    border: 1px solid var(--rule);
    animation: pulse 1.4s ease-in-out infinite;
}
.badge-progress::before {
    content: "";
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    margin-right: 6px;
    vertical-align: middle;
    animation: pulse 1.4s ease-in-out infinite;
}

/* Indeterminate progress bar at the top of in-progress episode cards */
article.episode[hx-get] {
    position: relative;
    overflow: hidden;
}
article.episode[hx-get]::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    height: 2px;
    width: 40%;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    animation: indeterminate 1.6s ease-in-out infinite;
}
@keyframes indeterminate {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(350%); }
}

/* Series list */
.series-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.series-list li {
    font-family: var(--font-mono);
    font-size: 13.5px;
    color: var(--ink-2);
    padding: 10px 12px;
    background: var(--bg-2);
    border: 1px solid var(--rule);
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

/* ——— Icons (inline) ——— */
.icon { display: inline-block; vertical-align: middle; }

/* ——— Responsive ——— */
@media (max-width: 760px) {
    .pod { grid-template-columns: 44px 1fr; }
    .pod-right { grid-column: 2; grid-row: 2; padding-left: 0; margin-top: 8px; }
    .footer { flex-direction: column; gap: 12px; align-items: flex-start; }
    .site-nav { flex-wrap: wrap; gap: 12px; }
}
