/* Stopwatch & Timer — page specific overrides (uses variables from main.css) */
.stopwatch-container { 
  padding: 80px 0; 
  min-height: calc(100vh - 200px); 
}

.stopwatch-header { 
  text-align: center; 
  margin-bottom: 40px; 
}

.stopwatch-header h1 { 
  font-size: 2.2rem; 
  margin-bottom: 8px; 
  color: var(--text); 
}

.stopwatch-header p { 
  color: var(--text-light); 
  max-width: 600px;
  margin: 0 auto;
}

/* Mode Selector */
.mode-selector {
  display: flex;
  justify-content: center;
  margin-bottom: 40px;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 8px;
  box-shadow: var(--shadow);
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.mode-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  background: transparent;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  font-weight: 500;
  color: var(--text-light);
}

.mode-btn:hover {
  color: var(--text);
  background: #f8fafc;
}

.mode-btn.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(227,6,19,.3);
}

.mode-btn i {
  font-size: 1.1rem;
}

/* Timer Grid */
.timer-grid {
  max-width: 800px;
  margin: 0 auto 60px;
}

.stopwatch-section,
.timer-section {
  display: none;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow);
  text-align: center;
}

.stopwatch-section.active,
.timer-section.active {
  display: block;
}

/* Timer Display */
.timer-display {
  margin-bottom: 40px;
}

.time-display {
  font-family: 'Courier New', monospace;
  font-size: 4rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  line-height: 1;
}

.time-display .milliseconds {
  font-size: 2rem;
  color: var(--text-light);
}

.timer-status {
  font-size: 1.2rem;
  color: var(--text-light);
  font-weight: 500;
}

/* Controls Grid */
.controls-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 40px;
}

.control-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 16px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  font-weight: 600;
  font-size: 1rem;
}

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

.control-btn.primary:hover:not(:disabled) {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(227,6,19,.3);
}

.control-btn.secondary {
  background: #f8fafc;
  color: var(--text);
  border: 2px solid #e5e7eb;
}

.control-btn.secondary:hover:not(:disabled) {
  background: #f1f5f9;
  border-color: #cbd5e1;
  transform: translateY(-2px);
}

.control-btn.danger {
  background: #ef4444;
  color: white;
}

.control-btn.danger:hover:not(:disabled) {
  background: #dc2626;
  transform: translateY(-2px);
}

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

.control-btn i {
  font-size: 1.1rem;
}

/* Laps Section */
.laps-section {
  text-align: left;
}

.laps-section h3 {
  margin-bottom: 16px;
  color: var(--text);
  text-align: center;
}

.laps-list {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius);
  background: #f8fafc;
}

.laps-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-light);
}

.laps-empty i {
  font-size: 2.5rem;
  margin-bottom: 12px;
  color: #e5e7eb;
}

.lap-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #e5e7eb;
  transition: var(--transition);
}

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

.lap-item:hover {
  background: white;
}

.lap-number {
  font-weight: 600;
  color: var(--primary);
  min-width: 40px;
}

.lap-time {
  font-family: 'Courier New', monospace;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  text-align: center;
}

.lap-difference {
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  color: var(--text-light);
  min-width: 80px;
  text-align: right;
}

/* Timer Inputs */
.timer-inputs {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 30px;
}

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

.time-input-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text);
}

.time-input-group input {
  width: 80px;
  padding: 12px;
  border: 2px solid #e5e7eb;
  border-radius: var(--radius);
  background: white;
  font-size: 1.5rem;
  font-weight: 600;
  text-align: center;
  font-family: 'Courier New', monospace;
}

.time-input-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(227,6,19,.1);
}

/* Preset Timers */
.preset-timers {
  margin-bottom: 30px;
}

.preset-timers h4 {
  margin-bottom: 12px;
  color: var(--text);
}

.preset-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.preset-btn {
  padding: 10px 16px;
  background: #f8fafc;
  border: 2px solid #e5e7eb;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  font-weight: 500;
  color: var(--text);
}

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

/* Alarm Settings */
.alarm-settings {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #e5e7eb;
}

.alarm-settings h4 {
  margin-bottom: 16px;
  color: var(--text);
}

.alarm-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 300px;
  margin: 0 auto;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-weight: 500;
  color: var(--text);
  padding: 8px 0;
}

.checkbox-label input[type="checkbox"] {
  display: none;
}

.checkmark {
  width: 20px;
  height: 20px;
  border: 2px solid #e5e7eb;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.checkmark:after {
  content: "✓";
  color: white;
  font-size: 12px;
  font-weight: bold;
  opacity: 0;
  transition: opacity 0.2s;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
  background: var(--primary);
  border-color: var(--primary);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark:after {
  opacity: 1;
}

.checkbox-label:hover .checkmark {
  border-color: var(--primary);
}

/* Statistics Section */
.stats-section {
  margin-bottom: 60px;
}

.stats-section h2 {
  text-align: center;
  margin-bottom: 30px;
  color: var(--text);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  text-align: center;
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.stat-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 16px;
  background: linear-gradient(135deg, rgba(227,6,19,.1) 0%, rgba(34,197,94,.1) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 1.5rem;
}

.stat-info h3 {
  margin-bottom: 8px;
  color: var(--text);
  font-size: 1.8rem;
  font-weight: 700;
}

.stat-info p {
  color: var(--text-light);
  margin: 0;
}

/* Info Section */
.info-section {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow);
  margin-bottom: 40px;
}

.info-section h2 {
  margin-bottom: 16px;
  color: var(--text);
}

.info-section p {
  margin-bottom: 20px;
  line-height: 1.6;
  color: var(--text);
}

.info-section h3 {
  margin: 24px 0 12px;
  color: var(--primary);
}

.info-section ul {
  margin-left: 20px;
  margin-bottom: 16px;
}

.info-section li {
  margin-bottom: 8px;
  line-height: 1.6;
  color: var(--text);
}

.usage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.usage-card {
  padding: 20px;
  background: #f8fafc;
  border-radius: var(--radius);
  border: 1px solid #e5e7eb;
}

.usage-card h4 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  color: var(--text);
}

.usage-card h4 i {
  color: var(--primary);
}

.usage-card ol {
  margin-left: 20px;
}

.usage-card li {
  margin-bottom: 8px;
  color: var(--text);
}

.disclaimer {
  background: rgba(227,6,19,.05);
  border-left: 4px solid var(--primary);
  padding: 16px 20px;
  border-radius: 4px;
  margin-top: 24px;
}

.disclaimer h3 {
  margin-top: 0;
  color: var(--primary);
}

.disclaimer p {
  margin-bottom: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .time-display {
    font-size: 3rem;
  }
  
  .time-display .milliseconds {
    font-size: 1.5rem;
  }
  
  .controls-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .timer-inputs {
    flex-direction: column;
    align-items: center;
    gap: 15px;
  }
  
  .time-input-group input {
    width: 100px;
  }
  
  .preset-buttons {
    justify-content: center;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .stopwatch-section,
  .timer-section {
    padding: 20px;
  }
  
  .stopwatch-header h1 {
    font-size: 1.8rem;
  }
  
  .time-display {
    font-size: 2.5rem;
  }
  
  .controls-grid {
    grid-template-columns: 1fr;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .usage-grid {
    grid-template-columns: 1fr;
  }
}