.time-selector-container {
  display: flex;
  gap: 8px;
  padding: 16px 24px;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.dark-mode .time-selector-container {
  background: #1f2937;
  border-color: #374151;
}

.time-selector {
  font-size: 1rem;
  font-weight: 600;
  color: #6b7280;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 8px 20px;
  cursor: pointer;
  transition: all 0.2s;
}

.dark-mode .time-selector {
  background: #111827;
  border-color: #374151;
  color: #9ca3af;
}

.time-selector:hover {
  background: #f3f4f6;
  color: #111827;
}

.dark-mode .time-selector:hover {
  background: #374151;
  color: #f3f4f6;
}

.time-selector.active {
  background: #3b82f6;
  color: #ffffff;
  border-color: #3b82f6;
  font-weight: 700;
}

.time-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  position: relative;
}

.clock-view {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.both-clocks-container {
  display: flex;
  width: 100%;
  height: 100%;
  gap: 32px;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.both-digital-clock {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.both-analog-clock {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.both-analog-clock .analog-clock-wrapper {
  min-height: 300px;
}

@media (max-width: 768px) {
  .both-clocks-container {
    flex-direction: column;
    gap: 24px;
  }
  
  .both-digital-clock,
  .both-analog-clock {
    width: 100%;
  }
}

.clock-display {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 16px;
  user-select: none;
}

.time-component {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 120px;
}

.time-label {
  font-size: 1.5rem;
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  transition: color 0.3s ease;
}

.dark-mode .time-label {
  color: #9ca3af;
}

.time-value {
  font-size: 8rem;
  font-weight: 700;
  color: #111827;
  font-family: "Fira Code", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  line-height: 1;
  transition: color 0.3s ease;
}

.dark-mode .time-value {
  color: #f3f4f6;
}

.ampm-indicator {
  font-size: 3rem;
  font-weight: 700;
  color: #111827;
  font-family: "Fira Code", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  line-height: 1;
  align-self: flex-start;
  margin-top: calc(1.5rem + 12px + 2rem);
  padding-bottom: 0.1em;
  margin-left: 8px;
  transition: color 0.3s ease;
}

.dark-mode .ampm-indicator {
  color: #f3f4f6;
}

.time-separator {
  font-size: 8rem;
  font-weight: 700;
  color: #111827;
  font-family: "Fira Code", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  line-height: 1;
  align-self: flex-start;
  margin-top: calc(1.5rem + 12px);
  padding-bottom: 0.1em;
  transition: color 0.3s ease;
}

.dark-mode .time-separator {
  color: #f3f4f6;
}

@media (max-width: 768px) {
  .time-value,
  .time-separator {
    font-size: 4rem;
  }
  #ampmValue {
    font-size: 1.5rem;
  }
  /* Digital tab only: time in one row, AM/PM larger and centered below */
  #digitalClockView .clock-display {
    display: grid;
    grid-template-columns: auto auto auto auto auto;
    justify-content: center;
    justify-items: center;
    gap: 16px;
  }
  #digitalClockView .ampm-indicator {
    grid-column: 1 / -1;
    justify-self: center;
    text-align: center;
    margin-left: 0;
    margin-top: 0.75rem;
    font-size: 2.25rem;
  }
  .time-label {
    font-size: 1.2rem;
  }
}

.time-text {
  margin-top: 16px;
  font-size: 1.5rem;
  font-weight: 500;
  color: #374151;
  text-align: center;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.4;
  min-height: 2.5em;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.3s ease;
}

.dark-mode .time-text {
  color: #d1d5db;
}

@media (max-width: 768px) {
  .time-value,
  .time-separator {
    font-size: 4rem;
  }
  .ampm-indicator {
    font-size: 1.5rem;
    margin-top: calc(1.2rem + 12px + 1.5rem);
  }
  #digitalClockView .ampm-indicator {
    margin-top: 0.75rem;
  }
  .time-label {
    font-size: 1.2rem;
  }
  .time-text {
    font-size: 1.2rem;
    margin-top: 12px;
    min-height: 2em;
  }
  .time-component {
    min-width: 100px;
  }
  .time-separator {
    margin-top: calc(1.2rem + 12px);
  }
}

@media (max-width: 480px) {
  .time-value,
  .time-separator {
    font-size: 3rem;
  }
  .ampm-indicator {
    font-size: 1.2rem;
    margin-top: calc(1rem + 12px + 6.9rem);
  }
  #digitalClockView .ampm-indicator {
    font-size: 1.75rem;
    margin-top: 0.5rem;
  }
  .time-label {
    font-size: 1rem;
  }
  .time-text {
    font-size: 1rem;
    margin-top: 8px;
    min-height: 1.8em;
  }
  .time-component {
    min-width: 80px;
  }
  .time-separator {
    margin-top: calc(1rem + 12px);
  }
}

.analog-clock-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 400px;
}

#analogClockCanvas {
  max-width: 500px;
  max-height: 500px;
  width: 100%;
  height: 100%;
  aspect-ratio: 1;
}

@media (max-width: 768px) {
  .analog-clock-wrapper {
    min-height: 300px;
  }
  /* Analog tab only: square wrapper so clock doesn't squish on mobile */
  #analogClockView .analog-clock-wrapper {
    width: min(100%, 85vmin);
    max-width: 300px;
    height: auto;
    min-height: 0;
    aspect-ratio: 1;
    margin: 0 auto;
  }
}

@media (max-width: 480px) {
  .analog-clock-wrapper {
    min-height: 250px;
  }
  #analogClockView .analog-clock-wrapper {
    max-width: 260px;
  }
}

