/*
═══════════════════════════════════════════════════════════════
  TIMEFLOW — Refined Utilitarian Design
  A calm, warm interface that feels like a well-made paper planner.
  Typography-first, generous whitespace, purposeful color.
═══════════════════════════════════════════════════════════════ */

/* ── Google Fonts ──────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=DM+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

/* ── Design Tokens ─────────────────────────────────────────── */
:root {
    /* Warm stone palette */
    --bg: #f6f4f0;
    --bg-warm: #ece8e1;
    --surface: #ffffff;
    --surface-hover: #faf9f7;
    --text: #2c2825;
    --text-secondary: #7a736b;
    --text-tertiary: #a8a099;

    /* Accent: deep teal — confident but not loud */
    --accent: #2a7a6d;
    --accent-hover: #1f5f54;
    --accent-light: #e6f3f0;
    --accent-glow: rgba(42, 122, 109, 0.08);

    /* Semantic colors */
    --success: #3a8c5c;
    --success-bg: #edf7f1;
    --warning: #c47a1a;
    --warning-bg: #fef6e9;
    --danger: #c0392b;
    --danger-bg: #fceeed;
    --info: #2a7a6d;
    --info-bg: #e6f3f0;

    /* Borders & shadows */
    --border: #e2ddd6;
    --border-light: #ece8e1;
    --shadow-xs: 0 1px 2px rgba(44, 40, 37, 0.04);
    --shadow-sm: 0 1px 4px rgba(44, 40, 37, 0.06), 0 1px 2px rgba(44, 40, 37, 0.04);
    --shadow-md: 0 4px 16px rgba(44, 40, 37, 0.08), 0 1px 4px rgba(44, 40, 37, 0.04);
    --shadow-lg: 0 8px 32px rgba(44, 40, 37, 0.1);

    /* Typography */
    --font-display: 'DM Serif Display', Georgia, serif;
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Spacing & shape */
    --radius: 8px;
    --radius-lg: 12px;
    --container: 880px;
}

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

/* ── Base ──────────────────────────────────────────────────── */
body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.15s;
}

a:hover {
    color: var(--accent-hover);
}

/* ── Fade-in animation ─────────────────────────────────────── */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
    flex: 1;
    animation: fadeUp 0.35s ease-out;
}

/* ══════════════════════════════════════════════════════════════
   NAVIGATION
   ══════════════════════════════════════════════════════════════ */
.navbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-xs);
}

.nav-container {
    max-width: var(--container);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 56px;
}

.nav-logo {
    font-family: var(--font-display);
    font-size: 1.25rem;
    color: var(--text);
    letter-spacing: -0.01em;
}

.nav-logo:hover {
    color: var(--accent);
}

.nav-links {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.nav-link {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius);
    transition: all 0.15s;
}

.nav-link:hover {
    color: var(--text);
    background: var(--accent-glow);
    text-decoration: none;
}

.nav-user {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.3rem 0.65rem;
    background: var(--accent-light);
    border-radius: 999px;
    margin: 0 0.15rem;
}

/* ══════════════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 1.4rem;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    line-height: 1.4;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 1px 3px rgba(42, 122, 109, 0.2);
}

.btn-primary:hover {
    background: var(--accent-hover);
    color: #fff;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(42, 122, 109, 0.25);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
    text-decoration: none;
    background: var(--accent-glow);
}

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

.btn-sm {
    padding: 0.35rem 0.9rem;
    font-size: 0.8rem;
}

.btn-full {
    width: 100%;
    text-align: center;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    padding: 0.35rem 0.45rem;
    border-radius: var(--radius);
    text-decoration: none;
    transition: all 0.15s;
    line-height: 1;
    opacity: 0.5;
}

.btn-icon:hover {
    background: var(--bg-warm);
    text-decoration: none;
    opacity: 1;
}

/* ══════════════════════════════════════════════════════════════
   ALERTS / FLASH MESSAGES
   ══════════════════════════════════════════════════════════════ */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-left: 3px solid;
    animation: fadeUp 0.25s ease-out;
}

.alert-success { background: var(--success-bg); color: #1a5632; border-color: var(--success); }
.alert-danger, .alert-error { background: var(--danger-bg); color: #8b1a1a; border-color: var(--danger); }
.alert-info { background: var(--info-bg); color: #1a5c52; border-color: var(--info); }

/* ══════════════════════════════════════════════════════════════
   HERO (Home / Landing)
   ══════════════════════════════════════════════════════════════ */
.hero {
    text-align: center;
    padding: 5rem 0 3.5rem;
}

.hero h1 {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 400;
    line-height: 1.15;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    color: var(--text);
}

.highlight {
    color: var(--accent);
}

.hero-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 440px;
    margin: 0 auto 2.5rem;
    line-height: 1.65;
}

.hero-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ── Feature Cards ─────────────────────────────────────────── */
.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    padding: 1rem 0 3rem;
}

.feature-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem 1.5rem;
    text-align: left;
    box-shadow: var(--shadow-xs);
    transition: all 0.25s;
}

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

.feature-icon {
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
    display: inline-block;
    background: var(--accent-light);
    width: 48px;
    height: 48px;
    line-height: 48px;
    text-align: center;
    border-radius: var(--radius);
}

.feature-card h3 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    margin-bottom: 0.4rem;
    font-weight: 400;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.55;
}

/* ══════════════════════════════════════════════════════════════
   FORMS
   ══════════════════════════════════════════════════════════════ */
.form-card {
    max-width: 420px;
    margin: 1.5rem auto;
    background: var(--surface);
    padding: 2.25rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.form-card h2 {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 1.5rem;
    margin-bottom: 1.75rem;
    text-align: center;
}

.form-group {
    margin-bottom: 1.15rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-group input,
.form-group textarea,
.form-group select,
.form-input {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: var(--font-body);
    background: var(--surface);
    color: var(--text);
    transition: all 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus,
.form-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-error {
    color: var(--danger);
    font-size: 0.78rem;
    display: block;
    margin-top: 0.25rem;
    font-weight: 500;
}

.form-footer {
    text-align: center;
    margin-top: 1.25rem;
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-check input[type="checkbox"] { width: auto; }
.form-check label { margin-bottom: 0; font-weight: 400; text-transform: none; letter-spacing: 0; font-size: 0.875rem; color: var(--text); }

.form-row {
    display: flex;
    gap: 1rem;
}

.form-half { flex: 1; }

/* ══════════════════════════════════════════════════════════════
   DASHBOARD
   ══════════════════════════════════════════════════════════════ */
.dashboard {
    padding: 0.5rem 0;
}

.dashboard-header {
    margin-bottom: 2rem;
}

.dashboard-header h1 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 400;
    margin-bottom: 0.15rem;
}

.dashboard-date {
    color: var(--text-tertiary);
    font-size: 0.875rem;
}

/* ── Stats Row ─────────────────────────────────────────────── */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.85rem;
    margin-bottom: 1.75rem;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.1rem 1rem;
    box-shadow: var(--shadow-xs);
    transition: all 0.2s;
}

.stat-card:hover {
    box-shadow: var(--shadow-sm);
}

.stat-number {
    font-family: var(--font-display);
    font-size: 1.75rem;
    line-height: 1;
    margin-bottom: 0.2rem;
}

.stat-label {
    font-size: 0.72rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}

.stat-pending .stat-number { color: var(--warning); }
.stat-done .stat-number { color: var(--success); }
.stat-overdue .stat-number { color: var(--danger); }

/* ── Dashboard Grid ────────────────────────────────────────── */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 1.25rem;
}

.dash-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-xs);
}

.dash-card h3 {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 1.05rem;
    margin-bottom: 0.85rem;
}

.dash-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.85rem;
}

.dash-card-header h3 { margin-bottom: 0; }

.dash-card-footer {
    border-top: 1px solid var(--border-light);
    padding-top: 1rem;
    margin-top: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dash-card-footer h3 { margin-bottom: 0; }

.small-link {
    font-size: 0.8rem;
    font-weight: 500;
}

.badge {
    background: var(--bg-warm);
    color: var(--text-tertiary);
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ── Mini Task List (dashboard preview) ────────────────────── */
.mini-task-list {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.mini-task {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem 0.6rem;
    border-radius: var(--radius);
    transition: background 0.15s;
}

.mini-task:hover {
    background: var(--bg);
}

.mini-task-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.875rem;
}

.mini-task-due {
    color: var(--text-tertiary);
    font-size: 0.78rem;
    flex-shrink: 0;
    font-weight: 500;
}

.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
}

/* ── Priority Dots ─────────────────────────────────────────── */
.priority-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.priority-dot.priority-high { background: var(--danger); }
.priority-dot.priority-medium { background: var(--warning); }
.priority-dot.priority-low { background: var(--success); }

/* ══════════════════════════════════════════════════════════════
   TASK LIST PAGE
   ══════════════════════════════════════════════════════════════ */
.tasks-page { padding: 0.5rem 0; }

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 400;
}

/* ── Filter Bar ────────────────────────────────────────────── */
.filter-bar {
    display: flex;
    gap: 0.35rem;
    margin-bottom: 1.5rem;
    background: var(--bg-warm);
    padding: 0.25rem;
    border-radius: var(--radius);
    width: fit-content;
}

.filter-btn {
    padding: 0.35rem 0.9rem;
    border-radius: calc(var(--radius) - 2px);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    text-decoration: none;
    transition: all 0.15s;
}

.filter-btn:hover {
    color: var(--text);
    text-decoration: none;
}

.filter-btn.active {
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-xs);
}

/* ── Task List ─────────────────────────────────────────────── */
.task-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.task-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 0.9rem 1.1rem;
    transition: all 0.2s;
}

.task-item:hover {
    border-color: var(--border);
    box-shadow: var(--shadow-xs);
}

.task-item:hover .btn-icon {
    opacity: 0.7;
}

.task-item.task-completed {
    opacity: 0.5;
}

.task-item.task-completed .task-title {
    text-decoration: line-through;
    color: var(--text-tertiary);
}

.task-main {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    flex: 1;
    min-width: 0;
}

/* ── Checkbox ──────────────────────────────────────────────── */
.task-check-form { flex-shrink: 0; }

.task-check {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    color: #fff;
    transition: all 0.2s;
    padding: 0;
    margin-top: 2px;
}

.task-check:hover {
    border-color: var(--accent);
    background: var(--accent-glow);
}

.task-check.checked {
    background: var(--success);
    border-color: var(--success);
}

/* ── Task Info ─────────────────────────────────────────────── */
.task-info { flex: 1; min-width: 0; }

.task-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.15rem;
    line-height: 1.4;
}

.task-desc {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-bottom: 0.3rem;
    line-height: 1.5;
}

.task-meta {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    font-size: 0.78rem;
}

.task-due { color: var(--text-tertiary); font-weight: 500; }

/* ── Priority Badges ───────────────────────────────────────── */
.priority-badge {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.priority-high { background: var(--danger-bg); color: var(--danger); }
.priority-medium { background: var(--warning-bg); color: var(--warning); }
.priority-low { background: var(--success-bg); color: var(--success); }

/* ── Task Actions ──────────────────────────────────────────── */
.task-actions {
    display: flex;
    gap: 0.15rem;
    flex-shrink: 0;
    margin-left: 0.5rem;
}

.inline-form { display: inline; }

/* ── Empty State ───────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--text-tertiary);
}

.empty-state p {
    margin-bottom: 1.25rem;
    font-size: 1rem;
}

/* ══════════════════════════════════════════════════════════════
   ABOUT PAGE
   ══════════════════════════════════════════════════════════════ */
.about-page { padding: 1.5rem 0; }

.about-page h1 {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 400;
    margin-bottom: 0.75rem;
}

.about-page h2 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 400;
    margin: 2rem 0 0.75rem;
}

.about-page p {
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    max-width: 560px;
    line-height: 1.65;
}

.about-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.about-item {
    background: var(--surface);
    padding: 0.85rem 1.1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    font-size: 0.9rem;
}

/* ══════════════════════════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════════════════════════ */
.footer {
    text-align: center;
    padding: 1.25rem;
    color: var(--text-tertiary);
    font-size: 0.78rem;
    border-top: 1px solid var(--border-light);
    margin-top: auto;
}

/* ══════════════════════════════════════════════════════════════
   HELPERS
   ══════════════════════════════════════════════════════════════ */
.text-light { color: var(--text-secondary); }

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 700px) {
    .hero h1 { font-size: 2rem; }
    .hero-subtitle { font-size: 0.95rem; }
    .container { padding: 1.5rem 1rem; }
    .features { grid-template-columns: 1fr; }
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .dashboard-grid { grid-template-columns: 1fr; }
    .form-row { flex-direction: column; gap: 0; }
    .page-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
    .task-actions { flex-direction: column; }
}