@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;
    --amber:     #e8a857;
    --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);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.10), 0 4px 16px rgba(0,0,0,0.06);
    --radius:    16px;
    --radius-sm: 10px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    padding: 24px 20px;
    min-height: 100vh;
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    position: relative;
    overflow-x: hidden;
}

/* Subtle ambient blobs */
body::before {
    content: '';
    position: fixed; inset: 0; pointer-events: none; z-index: 0;
    background:
        radial-gradient(ellipse at 10% 20%, rgba(90,143,196,0.09) 0%, transparent 50%),
        radial-gradient(ellipse at 90% 80%, rgba(92,196,154,0.09) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(232,168,87,0.04) 0%, transparent 60%);
    animation: ambientFloat 25s ease-in-out infinite;
}
@keyframes ambientFloat {
    0%, 100% { transform: translate(0, 0); }
    33%  { transform: translate(20px, -20px); }
    66%  { transform: translate(-15px, 15px); }
}

.container { max-width: 1400px; margin: 0 auto; position: relative; z-index: 1; }

/* ── 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; }
.control-btn {
    padding: 10px 18px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 600;
    background: var(--surface); cursor: pointer;
    text-decoration: none; color: var(--text) !important;
    font-family: inherit;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
    white-space: nowrap;
}
.control-btn:hover {
    background: var(--blue); color: white;
    border-color: var(--blue);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(90,143,196,0.35);
}

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

/* ── Timer Card ── */
.timer-card {
    background: linear-gradient(135deg, var(--blue) 0%, var(--green) 100%);
    padding: 56px 40px; border-radius: 24px;
    text-align: center;
    box-shadow: 0 16px 50px rgba(90,143,196,0.3), 0 6px 20px rgba(92,196,154,0.2);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative; overflow: hidden;
}
/* Subtle sheen */
.timer-card::before {
    content: '';
    position: absolute; top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 60%);
    pointer-events: none;
}
.timer-card:hover { transform: translateY(-3px); box-shadow: 0 20px 60px rgba(90,143,196,0.4); }

.timer-display {
    font-size: 100px; font-weight: 800;
    color: white; margin-bottom: 10px;
    font-variant-numeric: tabular-nums;
    letter-spacing: -4px;
    text-shadow: 0 2px 20px rgba(0,0,0,0.15);
}
.timer-label {
    font-size: 16px; color: rgba(255,255,255,0.85);
    margin-bottom: 32px; letter-spacing: 3px;
    text-transform: uppercase; font-weight: 600;
}
.timer-controls { display: flex; gap: 14px; justify-content: center; }
.timer-btn {
    padding: 16px 36px; border: none;
    border-radius: var(--radius-sm); font-size: 16px; font-weight: 700;
    cursor: pointer; font-family: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
}
.start-btn {
    background: white; color: var(--blue);
    box-shadow: 0 4px 14px rgba(0,0,0,0.15);
}
.pause-btn {
    background: #f9e5c8; color: var(--amber);
    box-shadow: 0 4px 14px rgba(232,168,87,0.3);
}
.reset-btn {
    background: rgba(255,255,255,0.18); color: white;
    border: 2px solid rgba(255,255,255,0.5);
    box-shadow: none;
}
.timer-btn:hover { transform: scale(1.06); }
.timer-btn:active { transform: scale(0.98); }

/* ── Mode Selector ── */
.mode-selector { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mode-btn {
    padding: 16px; background: var(--surface);
    border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 600; cursor: pointer;
    color: var(--text); font-family: inherit;
    transition: all 0.2s; box-shadow: var(--shadow-sm);
}
.mode-btn:hover { border-color: var(--blue); color: var(--blue); }
.mode-btn.active {
    background: var(--blue); color: white;
    border-color: var(--blue);
    box-shadow: 0 4px 14px rgba(90,143,196,0.35);
}

/* ── Session Stats ── */
.session-card {
    background: linear-gradient(160deg, var(--blue-soft), #c8d8f0);
    padding: 24px; border-radius: var(--radius);
    border: 1px solid rgba(90,143,196,0.2); box-shadow: var(--shadow-sm);
}
.session-card h3 { font-size: 10.5px; letter-spacing: 2.5px; margin-bottom: 20px; color: var(--blue); text-transform: uppercase; font-weight: 800; }
.session-stat {
    display: flex; justify-content: space-between;
    padding: 12px 0; border-bottom: 1px solid rgba(90,143,196,0.15);
    font-size: 14px; font-weight: 500;
}
.session-stat:last-child { border-bottom: none; }
.session-stat span:last-child { font-weight: 800; color: var(--blue); font-size: 15px; }

/* ── Right Section Cards ── */
.tasks-card, .history-card, .quotes-card {
    background: var(--surface); padding: 22px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md); border: 1px solid var(--border);
}
.tasks-card h3, .history-card h3, .quotes-card h3 {
    font-size: 10.5px; letter-spacing: 2.5px; margin-bottom: 16px;
    color: var(--text-muted); text-transform: uppercase; font-weight: 700;
}
.tasks-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.tasks-header h3 { margin-bottom: 0; }
.add-task-btn {
    background: linear-gradient(135deg, var(--blue), #4a7ab5);
    color: white; border: none;
    padding: 9px 18px; border-radius: 8px;
    font-size: 13px; font-weight: 700;
    cursor: pointer; font-family: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 3px 10px rgba(90,143,196,0.3);
}
.add-task-btn:hover { transform: translateY(-1px); box-shadow: 0 5px 16px rgba(90,143,196,0.4); }

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

.task-item {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 14px; background: var(--surface2);
    border-radius: 8px; margin-bottom: 8px;
    transition: transform 0.15s, box-shadow 0.15s; box-shadow: var(--shadow-sm);
}
.task-item:hover { transform: translateX(2px); box-shadow: var(--shadow-md); }
.task-checkbox { width: 20px; height: 20px; cursor: pointer; accent-color: var(--blue); }
.task-text { flex: 1; font-size: 14px; font-weight: 500; color: var(--text); }
.task-delete { background: none; border: none; color: var(--pink); cursor: pointer; font-size: 18px; opacity: 0.6; transition: opacity 0.2s; padding: 4px; }
.task-delete:hover { opacity: 1; }

.history-item {
    padding: 11px 14px; border-left: 4px solid var(--blue);
    background: var(--surface2); border-radius: 4px;
    margin-bottom: 8px; font-size: 13px; font-weight: 500;
    color: var(--text); box-shadow: var(--shadow-sm);
}
.quote {
    font-style: italic; color: var(--text-muted);
    line-height: 1.7; font-size: 15px; font-weight: 400;
}

/* ── Settings Modal ── */
.modal {
    display: none; position: fixed; inset: 0;
    background: rgba(26,26,46,0.4);
    backdrop-filter: blur(6px);
    z-index: 1000; align-items: center; justify-content: center;
}
.modal.show { display: flex; }
.modal-content {
    background: var(--surface); padding: 32px;
    border-radius: 24px; max-width: 500px; width: 90%;
    box-shadow: 0 24px 60px rgba(0,0,0,0.15);
    animation: modalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid var(--border);
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to   { opacity: 1; transform: scale(1)    translateY(0); }
}
.modal-content h2 { font-size: 22px; font-weight: 800; margin-bottom: 24px; color: var(--text); letter-spacing: -0.3px; }
.setting-item { margin-bottom: 20px; }
.setting-item label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 8px; color: var(--text-muted); }
.setting-item input[type="number"] {
    width: 100%; padding: 11px 14px; border: 1.5px solid var(--border);
    border-radius: var(--radius-sm); font-size: 14px; font-family: inherit;
    background: var(--surface2); color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.setting-item input[type="number"]:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(90,143,196,0.1); }
.setting-item input[type="checkbox"] { width: 20px; height: 20px; cursor: pointer; accent-color: var(--blue); }
.modal-actions { display: flex; gap: 12px; margin-top: 28px; }
.save-btn, .cancel-btn {
    flex: 1; padding: 13px; border: none;
    border-radius: var(--radius-sm); font-size: 14px;
    font-weight: 700; cursor: pointer; font-family: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
}
.save-btn   { background: linear-gradient(135deg, var(--blue), #4a7ab5); color: white; box-shadow: 0 4px 14px rgba(90,143,196,0.3); }
.save-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(90,143,196,0.4); }
.cancel-btn { background: var(--surface2); color: var(--text-muted); border: 1.5px solid var(--border); }
.cancel-btn:hover { background: var(--border); }

/* ── 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: clamp(22px, 5vw, 32px); }
    .timer-display { font-size: clamp(60px, 14vw, 80px); }
    .timer-card { padding: clamp(30px, 5vw, 40px) 20px; }
    .timer-controls { flex-direction: column; gap: 10px; }
    .timer-btn { width: 100%; min-height: 48px; font-size: 15px; }
    .mode-selector { grid-template-columns: 1fr; gap: 10px; }
    .mode-btn { min-height: 48px; }
    .controls { gap: 8px; flex-wrap: wrap; }
    .control-btn { min-height: 44px; font-size: 13px; flex: 1 1 auto; }
    .session-card, .tasks-card, .history-card, .quotes-card { padding: 15px; }
    .tasks-list, .history-list { max-height: 250px; }
    .add-task-btn { min-height: 44px; }
    .task-item { padding: 12px; }
    .task-checkbox { width: 24px; height: 24px; }
    .task-delete { min-width: 44px; min-height: 44px; }
}
@media (max-width: 480px) {
    .main-title { font-size: clamp(20px, 5vw, 24px); }
    .timer-display { font-size: clamp(52px, 12vw, 64px); }
    .timer-label { font-size: 12px; letter-spacing: 2px; }
    .timer-btn { padding: 13px 20px; font-size: 14px; }
    .mode-btn { padding: 13px; font-size: 13px; }
    .control-btn { font-size: 12px; padding: 8px 14px; }
}
