.layout-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2rem;
  align-items: start;
}

.clock-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.controls-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.clock-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.clock {
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: var(--bg-secondary, #f5f5f5);
  border: 4px solid var(--border-color, #ddd);
  position: relative;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.clock-face {
  width: 100%;
  height: 100%;
  position: relative;
  border-radius: 50%;
}

.clock-numbers {
  width: 100%;
  height: 100%;
  position: absolute;
}

.clock-number {
  position: absolute;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary, #333);
  transform: translate(-50%, -50%);
  text-align: center;
}

.clock-tick {
  position: absolute;
  width: 2px;
  height: 6px;
  background: var(--border-color, #ccc);
  left: 50%;
  transform-origin: center 112px;
}

.clock-tick.major {
  height: 10px;
  width: 2px;
  background: var(--text-secondary, #666);
}

.hand {
  position: absolute;
  bottom: 50%;
  left: 50%;
  transform-origin: bottom center;
  border-radius: 4px;
}

.hour-hand {
  width: 5px;
  height: 55px;
  background: var(--text-primary, #333);
  margin-left: -2.5px;
  z-index: 3;
}

.minute-hand {
  width: 3px;
  height: 80px;
  background: var(--primary-color, #3b82f6);
  margin-left: -1.5px;
  z-index: 2;
}

.clock-center {
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--text-primary, #333);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 4;
}

.time-display {
  margin-top: 0.75rem;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary, #333);
  font-variant-numeric: tabular-nums;
}

.control-section {
  background: var(--bg-secondary, #f5f5f5);
  border: 1px solid var(--border-color, #ddd);
  border-radius: 8px;
  padding: 1rem;
}

.control-section h3 {
  margin: 0 0 0.75rem 0;
  font-size: 0.95rem;
  color: var(--text-primary, #333);
}

.slider-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.slider-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.slider-item label {
  font-size: 0.85rem;
  color: var(--text-secondary, #666);
  min-width: 50px;
}

.time-slider {
  flex: 1;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--border-color, #ddd);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.time-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: var(--primary-color, #3b82f6);
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.1s;
}

.time-slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

.time-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: var(--primary-color, #3b82f6);
  border-radius: 50%;
  border: none;
  cursor: pointer;
}

.time-input-group {
  display: flex;
  align-items: flex-end;
  gap: 0.4rem;
}

.time-input-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.time-input-item label {
  font-size: 0.75rem;
  color: var(--text-secondary, #666);
}

.time-input {
  width: 60px;
  padding: 0.5rem;
  font-size: 1rem;
  text-align: center;
  border: 1px solid var(--border-color, #ddd);
  border-radius: 6px;
  background: var(--bg-primary, #fff);
  color: var(--text-primary, #333);
}

.time-input:focus {
  outline: none;
  border-color: var(--primary-color, #3b82f6);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.time-input-small {
  width: 50px;
  padding: 0.4rem;
  font-size: 0.9rem;
  text-align: center;
  border: 1px solid var(--border-color, #ddd);
  border-radius: 6px;
  background: var(--bg-primary, #fff);
  color: var(--text-primary, #333);
}

.time-input-small:focus {
  outline: none;
  border-color: var(--primary-color, #3b82f6);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.time-separator {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary, #333);
  padding-bottom: 0.5rem;
}

.btn-primary {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  background: var(--primary-color, #3b82f6);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.btn-primary:hover {
  background: var(--primary-hover, #2563eb);
}

.btn-secondary {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  background: var(--bg-tertiary, #e5e5e5);
  color: var(--text-primary, #333);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.btn-secondary:hover {
  background: var(--border-color, #ddd);
}

.animation-controls {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.animation-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}

.animation-row label {
  font-size: 0.75rem;
  color: var(--text-secondary, #666);
}

.animation-buttons {
  display: flex;
  gap: 0.5rem;
}

.quick-times {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  width: 100%;
  max-width: 240px;
}

.quick-time-btn {
  padding: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--bg-primary, #fff);
  color: var(--text-primary, #333);
  border: 2px solid var(--border-color, #ddd);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.quick-time-btn:hover {
  border-color: var(--primary-color, #3b82f6);
  background: var(--primary-light, #eff6ff);
}

.quick-time-btn.active {
  border-color: var(--primary-color, #3b82f6);
  background: var(--primary-color, #3b82f6);
  color: #fff;
}

.overlap-buttons-row {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.overlap-btn-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.overlap-time {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-color, #3b82f6);
  background: var(--bg-primary, #fff);
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  border: 2px solid var(--primary-color, #3b82f6);
  min-width: 60px;
  text-align: center;
}

.overlap-btn-group .btn-primary,
.overlap-btn-group .btn-secondary {
  width: 100%;
}

@media (max-width: 700px) {
  .layout-grid {
    grid-template-columns: 1fr;
  }

  .clock-panel {
    order: 1;
  }

  .controls-panel {
    order: 2;
  }

  .quick-times {
    max-width: 100%;
  }

  .animation-row {
    flex-direction: column;
    align-items: stretch;
  }

  .time-input-group {
    justify-content: flex-start;
  }
}
