:root {
  --bg: #0A0A0A;
  --bg-panel: rgba(25, 25, 25, 0.6);
  --accent: #E74C3C;
  --text: #F8F9FA;
  --text-muted: #ADB5BD;
  --border: rgba(255, 255, 255, 0.1);
  --radius: 16px;
  --font: 'Inter', sans-serif;
  --ring-circumference: 942.47; /* 2 * pi * 150 */
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg);
  background-image: 
    radial-gradient(circle at 15% 50%, rgba(231, 76, 60, 0.05), transparent 25%),
    radial-gradient(circle at 85% 30%, rgba(255, 255, 255, 0.02), transparent 25%);
  color: var(--text);
  font-family: var(--font);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.glass {
  background: var(--bg-panel);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  margin: 1rem;
  border-radius: var(--radius);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--accent);
}

.logo h1 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
}

.header-actions {
  display: flex;
  gap: 0.5rem;
}

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text);
}

.btn {
  font-family: var(--font);
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.btn.primary {
  background: var(--accent);
  color: #fff;
}
.btn.primary:hover {
  background: #C0392B;
  transform: translateY(-1px);
}
.btn.outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn.outline:hover {
  background: rgba(255,255,255,0.05);
}
.btn.ghost {
  background: transparent;
  color: var(--text-muted);
}
.btn.ghost:hover {
  color: var(--text);
  background: rgba(255,255,255,0.05);
}
.btn.huge {
  font-size: 1.25rem;
  padding: 1rem 3rem;
  border-radius: 40px;
}
.btn.small {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

/* Main Layout */
.dashboard {
  flex: 1;
  display: flex;
  gap: 1.5rem;
  padding: 0 1.5rem 1.5rem 1.5rem;
  overflow: hidden;
}

.side-panel {
  width: 340px;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  overflow-y: auto;
}

.center-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* Mode Tabs */
.mode-tabs {
  position: absolute;
  top: 0;
  display: flex;
  padding: 0.5rem;
  gap: 0.5rem;
  border-radius: 30px;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.5rem 1.25rem;
  border-radius: 20px;
  font-family: inherit;
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.tab-btn.active {
  background: var(--accent);
  color: #fff;
}

/* Circular Timer */
.timer-container {
  position: relative;
  width: 320px;
  height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 3rem;
}

.progress-ring {
  position: absolute;
  top: 0;
  left: 0;
  transform: rotate(-90deg);
}

.progress-ring__circle {
  stroke-dasharray: var(--ring-circumference);
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear, stroke 0.3s ease;
}

.timer-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 1;
}

#time-left {
  font-size: 5rem;
  font-weight: 700;
  letter-spacing: -2px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

#current-task-label {
  font-size: 1rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.timer-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.shortcut-hint {
  margin-top: 1.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  opacity: 0.6;
}

/* Sidebar Sections */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.section-header h2 {
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
}
.section-header h2 i {
  color: var(--accent);
  width: 18px;
  height: 18px;
}

.badge {
  background: rgba(231, 76, 60, 0.15);
  color: var(--accent);
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.spotify-embed-container {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(0,0,0,0.2);
  min-height: 352px;
}

.spotify-controls {
  margin-top: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 1.5rem 0;
}

/* Ambient Mixer */
.sound-track {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.track-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 80px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.track-info i {
  width: 18px;
  height: 18px;
}

.vol-slider {
  flex: 1;
  -webkit-appearance: none;
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  outline: none;
}

.vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text);
  cursor: pointer;
  transition: transform 0.1s;
}

.vol-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  background: var(--accent);
}

/* Modals */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  width: 90%;
  max-width: 500px;
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal.active .modal-content {
  transform: translateY(0);
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-header h2 { font-size: 1.25rem; font-weight: 600; }

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
}

.settings-group { margin-bottom: 1.5rem; }
.settings-group h3 { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 1rem; text-transform: uppercase; letter-spacing: 1px;}
.duration-inputs { display: flex; gap: 1rem; }
.duration-inputs label { display: flex; flex-direction: column; gap: 0.5rem; font-size: 0.85rem; color: var(--text-muted); flex: 1; }
.duration-inputs input, .input-group input { 
  background: rgba(0,0,0,0.3); border: 1px solid var(--border); color: var(--text); padding: 0.75rem; border-radius: 8px; font-family: var(--font); width: 100%;
}
.input-group { margin-bottom: 1rem; }
.input-group label { display: block; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.5rem; }

.toggle-row { display: flex; justify-content: space-between; align-items: center; cursor: pointer; }
.toggle-switch { position: relative; width: 44px; height: 24px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(255,255,255,0.1); transition: .4s; border-radius: 24px; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: var(--text-muted); transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--accent); }
input:checked + .slider:before { transform: translateX(20px); background-color: #fff; }

/* Stats Grid */
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.stat-card { background: rgba(0,0,0,0.2); padding: 1.5rem; border-radius: 12px; border: 1px solid var(--border); text-align: center; }
.stat-card h4 { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.5rem; font-weight: 500; }
.stat-value { font-size: 2rem; font-weight: 700; color: var(--accent); }
.stats-grid .stat-card:last-child { grid-column: 1 / -1; }

.hidden { display: none !important; }

/* Themes specific to modes */
body.mode-shortBreak {
  --accent: #2ECC71;
  background-image: 
    radial-gradient(circle at 15% 50%, rgba(46, 204, 113, 0.05), transparent 25%),
    radial-gradient(circle at 85% 30%, rgba(255, 255, 255, 0.02), transparent 25%);
}
body.mode-longBreak {
  --accent: #3498DB;
  background-image: 
    radial-gradient(circle at 15% 50%, rgba(52, 152, 219, 0.05), transparent 25%),
    radial-gradient(circle at 85% 30%, rgba(255, 255, 255, 0.02), transparent 25%);
}
