/* ========================================
   🕒 STOPWATCH TOOL - ADDITIONAL CSS
   Extends index.css - Minimal additions only
======================================== */

/* Stopwatch Card Container */
.stopwatch-card {
  text-align: center;
  padding: 2rem;
}

/* Time Display - Large & Clear */
.time-display {
  font-family: 'Segoe UI', monospace;
  font-size: 4rem;
  font-weight: 700;
  color: var(--text-color);
  background: linear-gradient(135deg, var(--bg-color) 0%, white 100%);
  padding: 1.5rem 2rem;
  border-radius: 16px;
  border: 3px solid var(--border-color);
  margin: 1.5rem 0 2rem;
  letter-spacing: -0.05em;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.time-display.running {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15), var(--shadow-lg);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15), var(--shadow-lg); }
  50% { box-shadow: 0 0 0 6px rgba(99, 102, 241, 0.25), var(--shadow-lg); }
}

/* Control Buttons Grid */
.controls {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.control-btn {
  padding: 1rem 1.5rem;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.control-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.control-btn:hover::before {
  left: 100%;
}

.control-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: var(--shadow);
}

.control-btn:disabled:hover::before {
  left: -100%;
}

/* Button Variants */
.start-btn {
  background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
  color: white;
  grid-column: span 2;
}

.start-btn:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.pause-btn {
  background: linear-gradient(135deg, var(--warning-color) 0%, #d97706 100%);
  color: white;
}

.pause-btn:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
}

.reset-btn {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
}

.reset-btn:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--secondary-color) 100%);
}

.lap-btn {
  background: linear-gradient(135deg, var(--accent-color) 0%, #db2777 100%);
  color: white;
}

.lap-btn:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  background: linear-gradient(135deg, #db2777 0%, #be185d 100%);
}

/* Lap Times Section */
.lap-section {
  background: var(--bg-color);
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 1rem;
  border: 2px solid var(--border-color);
}

.lap-title {
  font-size: 1.25rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.lap-list {
  list-style: none;
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: white;
}

.lap-list li {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Segoe UI', monospace;
  font-size: 1rem;
}

.lap-list li:last-child {
  border-bottom: none;
}

.lap-list li span:first-child {
  font-weight: 600;
  color: var(--text-color);
}

.lap-list li span:last-child {
  color: var(--primary-color);
  font-weight: 700;
}

.clear-laps-btn {
  width: 100%;
  padding: 0.75rem;
  background: var(--bg-color);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-light);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.clear-laps-btn:hover {
  background: #fef2f2;
  border-color: var(--error-color);
  color: var(--error-color);
}

/* Content Sections */
.content-section,
.faq-section {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 2rem;
  margin-top: 2rem;
  box-shadow: var(--shadow-lg);
}

.content-section h2,
.faq-section h2 {
  font-size: 1.75rem;
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  text-align: center;
}

.content-section p {
  margin-bottom: 1.25rem;
  line-height: 1.8;
  color: var(--text-color);
}

.content-section strong {
  color: var(--primary-dark);
  font-weight: 600;
}

/* FAQ Items */
.faq-item {
  background: var(--bg-color);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
}

.faq-item:hover {
  border-color: var(--primary-color);
  box-shadow: var(--shadow);
}

.faq-item h3 {
  font-size: 1.1rem;
  color: var(--text-color);
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.faq-item p {
  margin: 0;
  color: var(--text-light);
  line-height: 1.7;
}

/* ========================================
   📱 RESPONSIVE ADJUSTMENTS
======================================== */

/* Tablet: 640px+ */
@media (min-width: 640px) {
  .time-display {
    font-size: 5rem;
    padding: 2rem 3rem;
  }
  
  .controls {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
  }
  
  .start-btn {
    grid-column: span 4;
  }
}

/* Desktop: 768px+ */
@media (min-width: 768px) {
  .stopwatch-card {
    padding: 3rem;
  }
  
  .time-display {
    font-size: 6rem;
    padding: 2.5rem 4rem;
  }
  
  .controls {
    gap: 1rem;
    max-width: 600px;
  }
  
  .control-btn {
    padding: 1.25rem 1.5rem;
    font-size: 1.05rem;
  }
  
  .content-section,
  .faq-section {
    padding: 2.5rem;
  }
  
  .content-section h2,
  .faq-section h2 {
    font-size: 2rem;
  }
}

/* Large Desktop: 1024px+ */
@media (min-width: 1024px) {
  .time-display {
    font-size: 7rem;
  }
  
  .lap-list {
    max-height: 400px;
  }
}

/* Mobile: <640px */
@media (max-width: 639px) {
  .time-display {
    font-size: 3rem;
    padding: 1.25rem 1.5rem;
  }
  
  .controls {
    gap: 0.75rem;
  }
  
  .control-btn {
    padding: 0.875rem 1rem;
    font-size: 0.9rem;
  }
  
  .btn-icon {
    font-size: 1rem;
  }
  
  .lap-list li {
    font-size: 0.95rem;
    padding: 0.625rem 0.875rem;
  }
}

/* ========================================
   ♿ ACCESSIBILITY ENHANCEMENTS
======================================== */

/* Focus states for keyboard navigation */
.control-btn:focus-visible,
.clear-laps-btn:focus-visible {
  outline: 3px solid var(--primary-color);
  outline-offset: 2px;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .time-display.running,
  .control-btn,
  .faq-item {
    animation: none !important;
    transition: none !important;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .time-display {
    border-width: 4px;
  }
  
  .control-btn {
    border: 2px solid currentColor;
  }
}

/* Screen reader only class for dynamic updates */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
/* ========================================
   ⬅️ ENHANCED BACK BUTTON
======================================== */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--card-bg);
  color: var(--primary-color);
  text-decoration: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  margin: 4rem 2rem 2rem;
  position: relative;
  overflow: hidden;
  border: 2px solid transparent;
  width: fit-content;
}

.back-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.1), transparent);
  transition: left 0.5s ease;
}

.back-btn:hover::before {
  left: 100%;
}

.back-btn:hover {
  background: var(--primary-color);
  color: white;
  transform: translateX(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-color);
}

.back-btn:active {
  transform: translateX(-3px) scale(0.98);
}