@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

:root {
    --bg:        #f5f7fa;
    --surface:   #ffffff;
    --surface2:  #f0f4f8;
    --blue:      #5a8fc4;
    --blue-soft: #d4e4f7;
    --green:     #5ac49e;
    --green-soft:#d4f5e4;
    --pink:      #e47ba8;
    --pink-soft: #f5d4e4;
    --amber:     #e8a857;
    --amber-soft:#f9e5c8;
    --text:      #1a1a2e;
    --text-muted:#6b7280;
    --border:    #e5e7eb;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.05);
    --radius:    16px;
    --radius-sm: 10px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    background-image:
        radial-gradient(ellipse at 0% 0%, rgba(90,143,196,0.07) 0%, transparent 55%),
        radial-gradient(ellipse at 100% 100%, rgba(92,196,154,0.07) 0%, transparent 55%);
    padding: 24px 20px;
    min-height: 100vh;
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

.container { max-width: 1400px; margin: 0 auto; }

/* ── Header ── */
.header { text-align: center; margin-bottom: 32px; }
.header-info { margin-bottom: 16px; }
.main-title { font-size: 40px; font-weight: 800; color: var(--text); letter-spacing: -0.5px; margin-bottom: 8px; }
.subtitle { font-size: 10.5px; letter-spacing: 3px; color: var(--text-muted); text-transform: uppercase; font-weight: 700; margin: 6px 0; }
.current-date { font-size: 14px; color: var(--text-muted); font-weight: 500; margin-top: 4px; }

/* ── Controls ── */
.controls {
    display: flex; gap: 8px; justify-content: center;
    margin: 20px 0; flex-wrap: wrap; padding: 0 10px;
}
.select-box {
    padding: 10px 14px; border: 1.5px solid var(--border);
    border-radius: var(--radius-sm); font-size: 13px;
    font-weight: 600; background: var(--surface);
    color: var(--text); font-family: inherit; cursor: pointer;
    transition: 0.2s;
    box-shadow: var(--shadow-sm);
}

/* ── Dashboard ── */
.dashboard { display: grid; grid-template-columns: 420px 1fr; gap: 20px; }
.left-section { display: flex; flex-direction: column; gap: 16px; }

/* ── Stat Cards ── */
.stats-cards { display: grid; grid-template-columns: 1fr; gap: 14px; }
.stat-card {
    padding: 22px 20px; border-radius: var(--radius);
    text-align: center; box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.total-card    { background: linear-gradient(160deg, var(--blue-soft), #c8d8f0); border: 1px solid rgba(90,143,196,0.2); }
.pending-card  { background: linear-gradient(160deg, var(--amber-soft), #fce8c5); border: 1px solid rgba(232,168,87,0.2); }
.completed-card{ background: linear-gradient(160deg, var(--green-soft), #c8f0e0); border: 1px solid rgba(92,196,154,0.2); }
.stat-label { font-size: 10px; letter-spacing: 2.5px; color: var(--text-muted); margin-bottom: 12px; text-transform: uppercase; font-weight: 700; }
.stat-value { font-size: 44px; font-weight: 800; color: var(--text); letter-spacing: -1px; }

/* ── Add Form ── */
.add-form-card {
    background: var(--surface); padding: 22px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}
.add-form-card h3 { font-size: 10.5px; letter-spacing: 2.5px; margin-bottom: 18px; color: var(--text-muted); text-transform: uppercase; font-weight: 700; }

.add-form-card input,
.add-form-card select,
.add-form-card textarea {
    width: 100%; padding: 12px 14px; margin-bottom: 12px;
    border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 500; font-family: inherit;
    color: var(--text); background: var(--surface2);
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.add-form-card input:focus,
.add-form-card select:focus,
.add-form-card textarea:focus {
    outline: none; border-color: var(--blue);
    background: white; box-shadow: 0 0 0 3px rgba(90,143,196,0.1);
}
.add-form-card textarea { resize: vertical; }

.add-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--blue) 0%, #4a7ab5 100%);
    color: white !important; border: none; padding: 13px;
    border-radius: var(--radius-sm); font-size: 14px;
    font-weight: 700; cursor: pointer; font-family: inherit;
    transition: all 0.2s;
    box-shadow: 0 4px 14px rgba(90,143,196,0.3);
    text-decoration: none;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.add-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(90,143,196,0.45); }
.add-btn:active { transform: translateY(0); }

/* ── Right / Tasks ── */
.right-section { display: flex; flex-direction: column; }
.tasks-card {
    background: var(--surface); padding: 22px;
    border-radius: var(--radius); height: 100%;
    box-shadow: var(--shadow-md); border: 1px solid var(--border);
}
.tasks-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.tasks-header h3 { font-size: 10.5px; letter-spacing: 2.5px; color: var(--text-muted); text-transform: uppercase; font-weight: 700; }
.clear-btn {
    background: var(--pink-soft); color: var(--pink);
    border: 1px solid rgba(228,123,168,0.3);
    padding: 8px 18px; border-radius: 8px;
    font-size: 12px; font-weight: 700; cursor: pointer;
    font-family: inherit; transition: all 0.2s;
}
.clear-btn:hover { background: var(--pink); color: white; }

.tasks-list { max-height: 700px; overflow-y: auto; }
.empty-state { text-align: center; color: var(--text-muted); padding: 50px 20px; font-size: 14px; font-weight: 500; }

.task-item {
    background: var(--surface2); padding: 16px;
    border-radius: var(--radius-sm); margin-bottom: 10px;
    display: flex; gap: 14px; align-items: flex-start;
    border-left: 4px solid;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: var(--shadow-sm);
}
.task-item:hover { transform: translateX(3px); box-shadow: var(--shadow-md); }
.task-item.high    { border-left-color: var(--pink); }
.task-item.medium  { border-left-color: var(--amber); }
.task-item.low     { border-left-color: var(--green); }
.task-item.completed { opacity: 0.55; }

.task-checkbox { width: 20px; height: 20px; cursor: pointer; margin-top: 2px; min-width: 20px; accent-color: var(--blue); }
.task-content { flex: 1; }
.task-title { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 4px; line-height: 1.3; }
.task-item.completed .task-title { text-decoration: line-through; color: var(--text-muted); }
.task-description { font-size: 13px; color: var(--text-muted); margin-bottom: 5px; line-height: 1.4; }
.task-priority { font-size: 10.5px; letter-spacing: 1px; color: var(--text-muted); text-transform: uppercase; font-weight: 600; }
.task-actions { display: flex; gap: 8px; }
.delete-btn {
    background: none; border: none; cursor: pointer;
    font-size: 18px; padding: 4px; opacity: 0.45;
    transition: opacity 0.2s; min-width: 44px; min-height: 44px;
    display: flex; align-items: center; justify-content: center;
}
.delete-btn:hover { opacity: 0.9; }

/* ── Responsive ── */
@media (max-width: 1200px) { .dashboard { grid-template-columns: 1fr; } }
@media (max-width: 768px) {
    * { -webkit-tap-highlight-color: transparent; }
    body { padding: 12px; }
    .main-title { font-size: 28px; line-height: 1.2; }
    .controls { gap: 10px; padding: 0; }
    .select-box { min-height: 48px; font-size: 14px; padding: 12px 18px; flex: 1; }
    .stat-value { font-size: 38px; }
    .stats-cards { gap: 12px; }
    .add-form-card input, .add-form-card select, .add-form-card textarea { font-size: 16px; min-height: 48px; }
    .add-btn { min-height: 52px; font-size: 15px; }
    .tasks-list { max-height: none; overflow: visible; }
    .task-item { padding: 18px; flex-direction: column; gap: 12px; }
    .task-checkbox { width: 32px; height: 32px; min-width: 32px; margin: 0; }
    .task-actions { width: 100%; justify-content: flex-end; padding-top: 10px; border-top: 1px solid var(--border); }
    .delete-btn { min-width: 48px; min-height: 48px; font-size: 20px; background: var(--surface2); }
    .clear-btn { min-height: 48px; padding: 12px 24px; font-size: 14px; width: 100%; justify-content: center; display: flex; }
}
@media (max-width: 480px) {
    .main-title { font-size: clamp(20px, 5vw, 22px); }
    .stat-value { font-size: clamp(28px, 7vw, 34px); }
    .task-title { font-size: clamp(13px, 3.5vw, 14px); }
}
