/* ── Clock App ── */
.clock-wrap { display: flex; flex-direction: column; height: 100%; padding: 12px; gap: 10px; background: var(--app-glass-bg); border: 1px solid var(--app-glass-border); backdrop-filter: var(--app-glass-blur); -webkit-backdrop-filter: var(--app-glass-blur); border-radius: 10px; overflow: hidden; }
.clock-tabs { display: flex; gap: 4px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); padding-bottom: 10px; }
.clock-tab { flex: 1; padding: 8px 12px; background: rgba(255, 255, 255, 0.05); border: none; border-bottom: 2px solid transparent; color: rgba(255, 255, 255, 0.6); font-size: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 5px; transition: all var(--transition-dur); border-radius: 4px 4px 0 0; }
.clock-tab:hover { background: rgba(255, 255, 255, 0.1); color: rgba(255, 255, 255, 0.8); }
.clock-tab.active { background: rgba(var(--accent-rgb), 0.15); color: var(--accent-color); border-bottom-color: var(--accent-color); }
.clock-content { flex: 1; overflow: auto; min-height: 0; position: relative; display: block; }
.clock-panel { display: none; position: absolute; inset: 0; width: 100%; flex-direction: column; align-items: center; padding: 20px; overflow-y: auto; }
.clock-panel.active { display: flex; position: relative; inset: auto; }
.clock-analog-wrap { display: flex; justify-content: center; margin-bottom: 15px; }
#clock-canvas { filter: drop-shadow(0 10px 30px rgba(245, 158, 11, 0.2)); border-radius: 50%; }
.clock-digital { text-align: center; width: 100%; }
#clock-time-display { font-size: 32px; font-weight: 200; letter-spacing: 1px; color: var(--accent-color); font-family: 'Courier New', monospace; margin-bottom: 8px; }
#clock-date-display { font-size: 12px; color: rgba(255, 255, 255, 0.5); letter-spacing: 0.5px; }
.stopwatch-display { flex: 1; display: flex; align-items: center; justify-content: center; width: 100%; }
#stopwatch-time { font-size: 48px; font-weight: 200; letter-spacing: 2px; color: var(--accent-color); font-family: 'Courier New', monospace; text-shadow: 0 4px 16px rgba(245, 158, 11, 0.2); }
.stopwatch-controls { display: flex; gap: 8px; width: 100%; justify-content: center; margin-bottom: 15px; }
.stopwatch-btn { padding: 8px 16px; background: linear-gradient(135deg, var(--accent-color), rgba(var(--accent-rgb), 0.8)); border: 1px solid rgba(var(--accent-rgb), 0.3); color: white; border-radius: 6px; cursor: pointer; font-size: 12px; display: flex; align-items: center; gap: 5px; transition: all var(--transition-dur); }
.stopwatch-btn:hover:not(:disabled) { background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.9), var(--accent-color)); box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.3); }
.stopwatch-btn.running { background: linear-gradient(135deg, #ef4444, #dc2626); border-color: rgba(239, 68, 68, 0.3); }
.stopwatch-btn-secondary { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.2); color: rgba(255, 255, 255, 0.8); }
.stopwatch-btn-secondary:hover { background: rgba(255, 255, 255, 0.15); border-color: rgba(255, 255, 255, 0.3); }
.stopwatch-laps { width: 100%; border-top: 1px solid rgba(255, 255, 255, 0.1); padding-top: 10px; }
#stopwatch-laps-list { width: 100%; }

/* ── Timer ── */
.timer-display {
  font-size: 56px;
  font-weight: 200;
  letter-spacing: 2px;
  color: var(--accent-color);
  font-family: 'Courier New', monospace;
  text-shadow: 0 4px 20px rgba(245, 158, 11, 0.3);
  margin: 20px 0;
  position: relative;
}
.timer-ring {
  width: 180px;
  height: 180px;
  position: relative;
  margin-bottom: 20px;
}
.timer-ring svg {
  transform: rotate(-90deg);
}
.timer-ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 8;
}
.timer-ring-progress {
  fill: none;
  stroke: var(--accent-color);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear;
  filter: drop-shadow(0 0 8px rgba(var(--accent-rgb), 0.5));
}
.timer-ring-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 200;
  color: white;
  font-family: 'Courier New', monospace;
}
.timer-controls { display: flex; gap: 8px; width: 100%; justify-content: center; margin-bottom: 15px; flex-wrap: wrap; }
.timer-btn { padding: 8px 16px; background: linear-gradient(135deg, var(--accent-color), rgba(var(--accent-rgb), 0.8)); border: 1px solid rgba(var(--accent-rgb), 0.3); color: white; border-radius: 6px; cursor: pointer; font-size: 12px; display: flex; align-items: center; gap: 5px; transition: all var(--transition-dur); }
.timer-btn:hover:not(:disabled) { background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.9), var(--accent-color)); box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.3); }
.timer-btn.running { background: linear-gradient(135deg, #ef4444, #dc2626); border-color: rgba(239, 68, 68, 0.3); }
.timer-btn-secondary { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.2); color: rgba(255, 255, 255, 0.8); }
.timer-btn-secondary:hover { background: rgba(255, 255, 255, 0.15); border-color: rgba(255, 255, 255, 0.3); }
.timer-setup { display: flex; gap: 8px; align-items: center; justify-content: center; margin-bottom: 15px; flex-wrap: wrap; }
.timer-input-group { display: flex; align-items: center; gap: 6px; }
.timer-input-group label { font-size: 11px; color: rgba(255, 255, 255, 0.6); }
.timer-input {
  width: 60px;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: white;
  border-radius: 6px;
  font-size: 18px;
  text-align: center;
  font-family: 'Courier New', monospace;
}
.timer-input:focus { outline: none; background: rgba(255, 255, 255, 0.12); border-color: var(--accent-color); }
.timer-input::-webkit-inner-spin-button,
.timer-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.timer-input[type=number] { -moz-appearance: textfield; }
.timer-separator { font-size: 20px; color: rgba(255, 255, 255, 0.4); font-weight: bold; }
.timer-presets { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.timer-preset { padding: 5px 10px; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 5px; color: rgba(255, 255, 255, 0.7); font-size: 11px; cursor: pointer; transition: all var(--transition-dur); }
.timer-preset:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.2); }
.timer-done {
  animation: timerPulse 1s ease-in-out infinite;
}
@keyframes timerPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.98); }
}
.timer-ring.timer-done .timer-ring-progress {
  stroke: #ef4444;
}
.timer-ring.timer-done .timer-ring-text {
  color: #ef4444;
}

.alarm-controls { width: 100%; margin-bottom: 15px; display: flex; flex-direction: column; gap: 10px; }
.alarm-time-input { display: flex; gap: 8px; width: 100%; }
#alarm-time-input { flex: 1; padding: 8px 12px; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.15); color: white; border-radius: 6px; font-size: 14px; cursor: pointer; }
#alarm-time-input:focus { outline: none; background: rgba(255, 255, 255, 0.12); border-color: var(--accent-color); box-shadow: 0 0 8px rgba(var(--accent-rgb), 0.3); }
.alarm-btn-add { padding: 8px 16px; background: linear-gradient(135deg, var(--accent-color), rgba(var(--accent-rgb), 0.8)); border: 1px solid rgba(var(--accent-rgb), 0.3); color: white; border-radius: 6px; cursor: pointer; font-size: 12px; display: flex; align-items: center; gap: 5px; transition: all var(--transition-dur); white-space: nowrap; }
.alarm-btn-add:hover { background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.9), var(--accent-color)); box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.3); }
.alarms-list { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.alarm-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 6px; transition: all var(--transition-dur); }
.alarm-item:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.15); }
.alarm-item.disabled { opacity: 0.5; }
.alarm-item-time { font-size: 16px; font-weight: 500; color: var(--accent-color); font-family: 'Courier New', monospace; min-width: 60px; }
.alarm-item-label { flex: 1; color: rgba(255, 255, 255, 0.7); font-size: 12px; margin-left: 12px; }
.alarm-item-controls { display: flex; gap: 6px; }
.alarm-toggle, .alarm-delete { padding: 6px 10px; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.15); color: rgba(255, 255, 255, 0.7); border-radius: 4px; cursor: pointer; font-size: 11px; transition: all var(--transition-dur); display: flex; align-items: center; }
.alarm-toggle:hover { background: rgba(var(--accent-rgb), 0.2); color: var(--accent-color); border-color: var(--accent-color); }
.alarm-delete:hover { background: rgba(239, 68, 68, 0.2); color: #ef4444; border-color: #ef4444; }

/* Light mode overrides */
#os.light-mode .clock-tab { color: rgba(20,20,50,0.6); }
#os.light-mode .clock-tab.active { color: var(--accent-color); }
#os.light-mode .alarm-item { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.08); }
#os.light-mode .alarm-item:hover { background: rgba(0,0,0,0.06); border-color: rgba(0,0,0,0.12); }