/* Local Time Tracker — Purple theme */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #8B5CF6;
  --primary-dim: rgba(139,92,246,0.12);
  --primary-glow: rgba(139,92,246,0.3);
  --secondary: #A78BFA;
  --bg: #0F172A;
  --bg-card: #1E293B;
  --bg-input: #0D1322;
  --bg-hover: #273249;
  --border: rgba(139,92,246,0.15);
  --border-focus: rgba(139,92,246,0.5);
  --text: #E2E8F0;
  --text-dim: #94A3B8;
  --text-muted: #475569;
  --green: #34D399;
  --red: #F87171;
  --red-dim: rgba(248,113,113,0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --transition: 0.2s ease;
  --shadow: 0 4px 24px rgba(0,0,0,0.5);
}

html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font); background: var(--bg); color: var(--text); min-height: 100vh; line-height: 1.6; }
body::before { content: ''; position: fixed; inset: 0; background: radial-gradient(ellipse at top, rgba(139,92,246,0.06), transparent 50%); pointer-events: none; }

.header { border-bottom: 1px solid var(--border); background: rgba(30,41,59,0.9); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 10; }
.header-inner { max-width: 800px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; }
.header-left { display: flex; align-items: center; gap: 10px; }
.logo-icon { font-size: 1.2rem; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; background: var(--primary-dim); border-radius: var(--radius-sm); }
.header h1 { font-size: 1.05rem; font-weight: 700; }
.subtitle { font-size: 0.72rem; color: var(--text-dim); }
.header-actions { display: flex; gap: 6px; }

.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; font-family: var(--font); font-size: 0.8rem; font-weight: 500; border: none; border-radius: 6px; cursor: pointer; transition: all var(--transition); }
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn-primary { background: linear-gradient(135deg, var(--primary), #7C3AED); color: white; font-weight: 600; }
.btn-primary:hover { box-shadow: 0 4px 16px var(--primary-glow); transform: translateY(-1px); }
.btn-danger { background: linear-gradient(135deg, var(--red), #DC2626); color: white; font-weight: 600; }
.btn-danger:hover { box-shadow: 0 4px 16px rgba(248,113,113,0.3); }
.btn-ghost { background: transparent; color: var(--text-dim); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--primary); background: var(--primary-dim); }
.btn-sm { padding: 5px 10px; font-size: 0.78rem; }
.btn-lg { padding: 10px 20px; font-size: 0.9rem; }

.main { max-width: 800px; margin: 0 auto; padding: 20px; }

.timer-section { text-align: center; padding: 32px 0; }
.timer-display { font-family: var(--mono); font-size: 3.5rem; font-weight: 800; color: var(--primary); margin-bottom: 16px; letter-spacing: 0.05em; }
.timer-controls { display: flex; justify-content: center; gap: 10px; align-items: center; flex-wrap: wrap; }
.project-field { padding: 10px 14px; font-family: var(--font); font-size: 0.9rem; color: var(--text); background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); outline: none; min-width: 200px; }
.project-field:focus { border-color: var(--border-focus); }
.project-field::placeholder { color: var(--text-muted); }

.manual-section { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 16px; }
.panel-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.panel-label { font-size: 0.75rem; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.04em; }
.manual-row { display: flex; gap: 6px; padding: 10px 14px; flex-wrap: wrap; align-items: center; }
.field { padding: 7px 10px; font-family: var(--font); font-size: 0.82rem; color: var(--text); background: var(--bg-input); border: 1px solid var(--border); border-radius: 6px; outline: none; }
.field:focus { border-color: var(--border-focus); }
.field::placeholder { color: var(--text-muted); }
.field-sm { width: 60px; }

.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.summary-card { display: flex; flex-direction: column; align-items: center; padding: 14px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); }
.card-num { font-size: 1.3rem; font-weight: 700; color: var(--primary); font-family: var(--mono); }
.card-label { font-size: 0.72rem; color: var(--text-dim); text-transform: uppercase; }

.entries-section { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); }
.entries-list { max-height: 400px; overflow-y: auto; padding: 8px; }
.entry-item { display: flex; align-items: center; gap: 10px; padding: 10px; background: var(--bg); border: 1px solid rgba(139,92,246,0.06); border-radius: 6px; margin-bottom: 4px; font-size: 0.82rem; transition: all var(--transition); }
.entry-item:hover { border-color: rgba(139,92,246,0.2); }
.entry-project { flex: 1; font-weight: 600; color: var(--primary); }
.entry-duration { font-family: var(--mono); color: var(--secondary); }
.entry-date { font-size: 0.72rem; color: var(--text-muted); }
.entry-remove { background: none; border: none; color: var(--red); cursor: pointer; font-size: 0.8rem; padding: 2px 4px; border-radius: 4px; }
.entry-remove:hover { background: var(--red-dim); }

.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column-reverse; gap: 8px; }
.toast { padding: 10px 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow); font-size: 0.82rem; animation: toastIn 0.3s ease; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 768px) {
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .timer-display { font-size: 2.5rem; }
  .timer-controls { flex-direction: column; }
  .project-field { min-width: 100%; }
}
