/**
 * TimeKeeper - GreenGetWare Theme
 * Professional Stopwatch, Timer, Alarm & Counter
 */

:root {
  /* Colors - GreenGetWare Theme */
  --primary: #39d353;
  --primary-dark: #176f3c;
  --primary-hover: #2fb344;
  --primary-light: rgba(57, 211, 83, 0.15);
  --primary-gradient: linear-gradient(135deg, #39d353 0%, #176f3c 100%);
  --accent: #00c9ff;
  --secondary: #64748b;
  --success: #39d353;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  
  /* Dark Theme (default) */
  --bg-primary: #0f0f1a;
  --bg-secondary: #1a1a2e;
  --bg-tertiary: #252540;
  --bg-card: rgba(26, 26, 46, 0.95);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-color: rgba(255, 255, 255, 0.08);
  
  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  
  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 60px rgba(57, 211, 83, 0.2);
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 400ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Light Theme */
[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --bg-card: rgba(255, 255, 255, 0.95);
  --text-primary: #1a1a2e;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border-color: rgba(0, 0, 0, 0.08);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.12);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

.text-gradient {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Session Banner */
.session-banner {
  background: linear-gradient(90deg, var(--warning), #d97706);
  color: #000;
  padding: 6px var(--space-md);
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
}

.session-banner i {
  font-size: 1rem;
}

/* Header */
.app-header {
  background: var(--bg-card);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border-color);
  padding: var(--space-md) 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.logo i {
  color: var(--primary);
  font-size: 1.75rem;
}

/* Navigation Tabs */
.nav-tabs-main {
  display: flex;
  gap: var(--space-xs);
  background: var(--bg-tertiary);
  padding: var(--space-xs);
  border-radius: var(--radius-lg);
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.nav-tab:hover {
  color: var(--text-primary);
  background: var(--bg-secondary);
}

.nav-tab.active {
  color: #fff;
  background: var(--primary-gradient);
  box-shadow: 0 4px 15px rgba(57, 211, 83, 0.3);
}

.nav-tab i {
  font-size: 1.125rem;
}

.header-actions {
  display: flex;
  gap: var(--space-sm);
}

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--bg-tertiary);
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  background: var(--primary);
  color: white;
}

.btn-icon.muted {
  color: var(--danger);
}

/* Brand Section */
.brand-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-badge {
  font-size: 0.6875rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.5px;
}

/* Home Button */
.btn-home {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--primary-gradient);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 15px rgba(57, 211, 83, 0.3);
}

.btn-home:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(57, 211, 83, 0.4);
  color: white;
}

.btn-home i {
  font-size: 1rem;
}

.btn-home span {
  display: none;
}

@media (min-width: 768px) {
  .btn-home span {
    display: inline;
  }
}

/* Main Content */
.main-content {
  padding: var(--space-xl) 0;
  min-height: calc(100vh - 120px);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Section Header */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.section-header h2 {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 1.5rem;
  font-weight: 600;
}

.section-header h2 i {
  color: var(--primary);
}

.btn-add {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  background: var(--primary-gradient);
  border: none;
  border-radius: var(--radius-full);
  color: white;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-add:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(57, 211, 83, 0.4);
}

/* Presets Bar */
.presets-bar {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}

.presets-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
}

.preset-btn {
  padding: var(--space-xs) var(--space-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.preset-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

/* Current Time Display */
.current-time-display {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.current-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 4rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 2px;
}

/* Grids */
.stopwatch-grid,
.timer-grid,
.alarm-grid,
.counter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--space-lg);
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
  text-align: center;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 4rem;
  margin-bottom: var(--space-md);
  opacity: 0.3;
}

.empty-state h3 {
  font-size: 1.25rem;
  margin-bottom: var(--space-sm);
  color: var(--text-secondary);
}

.empty-state p {
  font-size: 0.9375rem;
}

/* Cards Base */
.time-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-normal);
}

.time-card:hover {
  border-color: rgba(57, 211, 83, 0.3);
  box-shadow: var(--shadow-glow);
}

.time-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary-gradient);
}

.time-card.running::before {
  animation: progress-pulse 1s ease infinite;
}

@keyframes progress-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.card-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.card-label input {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.875rem;
  padding: 2px 4px;
  border-radius: var(--radius-sm);
  max-width: 150px;
}

.card-label input:focus {
  outline: none;
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.card-actions {
  display: flex;
  gap: var(--space-xs);
}

.card-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.card-btn:hover {
  background: var(--primary);
  color: white;
}

.card-btn.delete:hover {
  background: var(--danger);
}

/* Time Display */
.time-display {
  font-family: 'JetBrains Mono', monospace;
  font-size: 3.5rem;
  font-weight: 600;
  text-align: center;
  margin: var(--space-lg) 0;
  letter-spacing: 2px;
  line-height: 1;
}

.time-display .hours,
.time-display .minutes,
.time-display .seconds {
  display: inline-block;
}

.time-display .milliseconds {
  font-size: 1.5rem;
  color: var(--text-secondary);
  margin-left: 4px;
}

.time-display .separator {
  color: var(--text-muted);
  margin: 0 2px;
}

.time-display.running .separator {
  animation: blink 1s ease infinite;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0.3; }
}

/* Control Buttons */
.control-buttons {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.ctrl-btn {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  font-size: 1.25rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.ctrl-btn.start {
  background: var(--primary-gradient);
  color: white;
  box-shadow: 0 4px 15px rgba(57, 211, 83, 0.4);
}

.ctrl-btn.start:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 25px rgba(57, 211, 83, 0.5);
}

.ctrl-btn.pause {
  background: var(--warning);
  color: white;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

.ctrl-btn.stop {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.ctrl-btn.stop:hover {
  background: var(--danger);
  color: white;
}

.ctrl-btn.lap {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.ctrl-btn.lap:hover {
  background: var(--info);
  color: white;
}

.ctrl-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* Laps Section */
.laps-section {
  margin-top: var(--space-lg);
  max-height: 200px;
  overflow-y: auto;
}

.laps-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border-color);
  margin-bottom: var(--space-sm);
}

.laps-header span {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.lap-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-xs) 0;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border-color);
}

.lap-item:last-child {
  border-bottom: none;
}

.lap-number {
  color: var(--text-muted);
  width: 50px;
}

.lap-time {
  font-family: 'JetBrains Mono', monospace;
  color: var(--primary);
}

.lap-split {
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-secondary);
  font-size: 0.8125rem;
}

/* Progress Ring */
.progress-container {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 0 auto var(--space-md);
}

.progress-ring {
  transform: rotate(-90deg);
}

.progress-ring-bg {
  fill: none;
  stroke: var(--bg-tertiary);
  stroke-width: 8;
}

.progress-ring-fill {
  fill: none;
  stroke: url(#progressGradient);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.3s ease;
}

.progress-time {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.progress-time .time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 2rem;
  font-weight: 600;
}

.progress-time .label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* Alarm Card */
.alarm-card .alarm-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 3rem;
  font-weight: 600;
  text-align: center;
  margin: var(--space-md) 0;
}

.alarm-card .alarm-remaining {
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.alarm-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: var(--space-md);
}

.toggle-switch {
  position: relative;
  width: 56px;
  height: 28px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.toggle-switch.active {
  background: var(--primary);
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  background: white;
  border-radius: 50%;
  transition: transform var(--transition-fast);
}

.toggle-switch.active::after {
  transform: translateX(28px);
}

/* Counter Card */
.counter-display {
  text-align: center;
  margin: var(--space-lg) 0;
}

.counter-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 5rem;
  font-weight: 700;
  line-height: 1;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.counter-target {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: var(--space-sm);
}

.counter-progress {
  width: 100%;
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  margin-top: var(--space-sm);
  overflow: hidden;
}

.counter-progress-fill {
  height: 100%;
  background: var(--primary-gradient);
  border-radius: var(--radius-full);
  transition: width var(--transition-fast);
}

.counter-buttons {
  display: flex;
  justify-content: center;
  gap: var(--space-lg);
  margin-top: var(--space-lg);
}

.counter-btn {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  font-size: 2rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.counter-btn.decrement {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.counter-btn.decrement:hover {
  background: var(--danger);
  color: white;
}

.counter-btn.increment {
  background: var(--primary-gradient);
  color: white;
  box-shadow: 0 4px 15px rgba(57, 211, 83, 0.4);
}

.counter-btn.increment:hover {
  transform: scale(1.1);
}

.counter-history {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-color);
}

.counter-history-title {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: var(--space-sm);
}

.counter-history-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  max-height: 80px;
  overflow-y: auto;
}

.history-item {
  font-size: 0.75rem;
  padding: 2px 8px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
}

/* Modals */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 420px;
  animation: modalSlide 0.3s ease;
}

@keyframes modalSlide {
  from { opacity: 0; transform: translateY(-20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
}

.btn-close-modal {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-close-modal:hover {
  background: var(--danger);
  color: white;
}

.modal-body {
  padding: var(--space-lg);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-md);
  padding: var(--space-lg);
  border-top: 1px solid var(--border-color);
}

/* Time Input Group */
.time-input-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.time-input {
  text-align: center;
}

.time-input input {
  width: 80px;
  padding: var(--space-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 2rem;
  font-weight: 600;
  text-align: center;
}

.time-input input:focus {
  outline: none;
  border-color: var(--primary);
}

.time-input label {
  display: block;
  margin-top: var(--space-xs);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.time-separator {
  font-size: 2rem;
  color: var(--text-muted);
  font-weight: 600;
  padding-bottom: 20px;
}

/* Form Elements */
.form-group {
  margin-bottom: var(--space-md);
}

.form-group label {
  display: block;
  margin-bottom: var(--space-xs);
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.form-group input,
.form-group select {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9375rem;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
}

.form-check {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.form-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

/* Buttons */
.btn-primary {
  padding: var(--space-sm) var(--space-xl);
  background: var(--primary-gradient);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-primary:hover {
  box-shadow: 0 4px 15px rgba(57, 211, 83, 0.4);
}

.btn-secondary {
  padding: var(--space-sm) var(--space-xl);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-secondary:hover {
  border-color: var(--primary);
}

/* Alarm Alert */
.alarm-alert .alert-content {
  text-align: center;
  padding: var(--space-2xl);
  animation: alertPulse 0.5s ease infinite alternate;
}

@keyframes alertPulse {
  from { transform: scale(1); }
  to { transform: scale(1.02); }
}

.alert-icon {
  font-size: 5rem;
  color: var(--primary);
  margin-bottom: var(--space-lg);
  animation: alertBounce 0.5s ease infinite alternate;
}

@keyframes alertBounce {
  from { transform: translateY(0); }
  to { transform: translateY(-10px); }
}

.alert-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

.alert-label {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
}

.alert-actions {
  display: flex;
  justify-content: center;
  gap: var(--space-lg);
}

.btn-snooze {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-snooze:hover {
  background: var(--warning);
  border-color: var(--warning);
  color: white;
}

.btn-dismiss {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  background: var(--primary-gradient);
  border: none;
  border-radius: var(--radius-full);
  color: white;
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-dismiss:hover {
  box-shadow: 0 4px 20px rgba(57, 211, 83, 0.4);
}

/* Sound Panel */
.sound-panel {
  position: fixed;
  top: 80px;
  right: -320px;
  width: 300px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  transition: right var(--transition-normal);
}

.sound-panel.active {
  right: 20px;
}

.sound-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  border-bottom: 1px solid var(--border-color);
}

.sound-panel-header h4 {
  font-size: 1rem;
  font-weight: 600;
}

.btn-close-panel {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
}

.sound-panel-body {
  padding: var(--space-md);
}

.sound-option {
  margin-bottom: var(--space-md);
}

.sound-option label {
  display: block;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
}

.sound-option input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
}

.btn-test-sound {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-md);
  background: var(--primary-light);
  border: 1px solid var(--primary);
  border-radius: var(--radius-md);
  color: var(--primary);
  font-size: 0.875rem;
  cursor: pointer;
}

.sound-check {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-color);
}

.sound-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.sound-check label {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Shortcuts Panel */
.shortcuts-panel {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 320px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
}

.shortcuts-panel.active {
  display: block;
}

.shortcuts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  border-bottom: 1px solid var(--border-color);
}

.shortcuts-header h4 {
  font-size: 1rem;
  font-weight: 600;
}

.shortcuts-body {
  padding: var(--space-md);
}

.shortcut {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-xs) 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.shortcut kbd {
  background: var(--bg-tertiary);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
}

/* Fullscreen Mode */
body.fullscreen .session-banner,
body.fullscreen .app-header {
  display: none;
}

body.fullscreen .main-content {
  padding-top: var(--space-2xl);
}

body.fullscreen .stopwatch-grid,
body.fullscreen .timer-grid {
  grid-template-columns: 1fr;
  max-width: 500px;
  margin: 0 auto;
}

body.fullscreen .time-display {
  font-size: 6rem;
}

/* Responsive */
@media (max-width: 992px) {
  .nav-tabs-main {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-color);
    border-radius: 0;
    padding: var(--space-sm);
    z-index: 100;
    justify-content: space-around;
  }

  .nav-tab {
    flex-direction: column;
    gap: 2px;
    padding: var(--space-sm);
    font-size: 0.75rem;
  }

  .nav-tab span {
    display: block;
  }

  .main-content {
    padding-bottom: 100px;
  }

  .app-header .container {
    justify-content: space-between;
  }

  .header-actions {
    gap: var(--space-xs);
  }
}

@media (max-width: 576px) {
  .stopwatch-grid,
  .timer-grid,
  .alarm-grid,
  .counter-grid {
    grid-template-columns: 1fr;
  }

  .time-display {
    font-size: 2.5rem;
  }

  .current-time {
    font-size: 2.5rem;
  }

  .time-input input {
    width: 60px;
    font-size: 1.5rem;
    padding: var(--space-sm);
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-md);
  }

  .presets-bar {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: var(--space-sm);
  }
}
