/* cignyl-sftp 20260824 */
/* ------------------------------ */
/* v2 Time Dial (clock picker)    */
/* ------------------------------ */

.v2-theme .v2-time-dial {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--v2-space-md);
  width: 100%;
  --v2-time-dial-accent: hsl(var(--primary));
  --v2-time-dial-bg: hsl(var(--secondary));
  --v2-time-dial-border: hsl(var(--border));
  --v2-time-dial-foreground: hsl(var(--foreground));
  --v2-time-dial-muted: hsl(var(--muted-foreground));
}

.v2-theme .v2-time-dial--size-sm {
  --v2-time-dial-clock-size: 180px;
  --v2-time-dial-option-distance: 72px;
  --v2-time-dial-hand-length: 51px;
}

.v2-theme .v2-time-dial--size-md {
  --v2-time-dial-clock-size: 220px;
  --v2-time-dial-option-distance: 88px;
  --v2-time-dial-hand-length: 67px;
}

.v2-theme .v2-time-dial--size-lg {
  --v2-time-dial-clock-size: 260px;
  --v2-time-dial-option-distance: 104px;
  --v2-time-dial-hand-length: 83px;
}

.v2-theme .v2-time-dial--size-xlg {
  --v2-time-dial-clock-size: 300px;
  --v2-time-dial-option-distance: 120px;
  --v2-time-dial-hand-length: 99px;
}

.v2-theme .v2-time-dial--disabled-true {
  opacity: 0.6;
  pointer-events: none;
}

.v2-theme .v2-time-dial__label {
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.2;
  color: hsl(var(--foreground));
  width: 100%;
  text-align: center;
}

.v2-theme .v2-time-dial__display {
  display: flex;
  align-items: center;
  gap: 6px;
  background: hsl(var(--secondary));
  border: 1px solid var(--v2-time-dial-border);
  border-radius: var(--radius);
  padding: 6px 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.v2-theme .v2-time-dial__display-button {
  border: 1px solid var(--v2-time-dial-border);
  border-radius: calc(var(--radius) - 2px);
  padding: 6px 10px;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--v2-time-dial-foreground);
  background: hsl(var(--background));
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.v2-theme .v2-time-dial__display-button[data-stage-target="hour"],
.v2-theme .v2-time-dial__display-button[data-stage-target="minute"] {
  min-width: 46px;
  text-align: center;
}

.v2-theme .v2-time-dial__display-button.is-active {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-color: hsl(var(--primary) / 0.8);
  box-shadow: 0 2px 6px hsl(var(--primary) / 0.3);
}

.v2-theme .v2-time-dial__display-button.is-active:hover {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.v2-theme .v2-time-dial__display-button:hover {
  background: hsl(var(--accent));
}

.v2-theme .v2-time-dial__display-button--ampm {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 6px 8px;
}

.v2-theme .v2-time-dial__separator {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--v2-time-dial-muted);
  user-select: none;
}

.v2-theme .v2-time-dial__clock {
  position: relative;
  width: var(--v2-time-dial-clock-size);
  height: var(--v2-time-dial-clock-size);
  border-radius: 50%;
  border: 1px solid var(--v2-time-dial-border);
  background: radial-gradient(circle at center, hsl(var(--background)) 0%, hsl(var(--secondary)) 70%, hsl(var(--accent)) 100%);
  box-shadow: inset 0 2px 6px rgba(255, 255, 255, 0.5);
}

.v2-theme .v2-time-dial__clock::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  margin: -4px;
  border-radius: 50%;
  background: hsl(var(--primary));
  box-shadow: 0 0 0 2px hsl(var(--background));
  z-index: 3;
}

.v2-theme .v2-time-dial__face {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.v2-theme .v2-time-dial[data-stage="hour"] .v2-time-dial__face--hour,
.v2-theme .v2-time-dial[data-stage="minute"] .v2-time-dial__face--minute {
  opacity: 1;
  pointer-events: auto;
}

.v2-theme .v2-time-dial__option {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 42px;
  height: 42px;
  margin: -21px;
  border-radius: 50%;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--v2-time-dial-foreground);
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}

.v2-theme .v2-time-dial__option:hover {
  color: hsl(var(--primary));
}

.v2-theme .v2-time-dial__option.is-active {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  box-shadow: 0 2px 8px hsl(var(--primary) / 0.35);
}

.v2-theme .v2-time-dial__hand {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: var(--v2-time-dial-hand-length);
  margin-top: calc(-1 * var(--v2-time-dial-hand-length));
  margin-left: -2px;
  transform-origin: 50% 100%;
  transition: transform 0.2s ease;
  pointer-events: none;
  z-index: 2;
}

.v2-theme .v2-time-dial__hand.is-hidden {
  opacity: 0;
}

.v2-theme .v2-time-dial__hand span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(180deg, hsl(var(--primary) / 0.8) 0%, hsl(var(--primary)) 100%);
}

.v2-theme .v2-time-dial__ampm {
  display: flex;
  gap: 10px;
  justify-content: center;
  width: 100%;
}

.v2-theme .v2-time-dial__ampm-button {
  border: 1px solid var(--v2-time-dial-border);
  background: hsl(var(--background));
  border-radius: var(--radius);
  padding: 8px 22px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--v2-time-dial-foreground);
  cursor: pointer;
  text-transform: uppercase;
  transition: background 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.v2-theme .v2-time-dial__ampm-button:hover {
  background: hsl(var(--accent));
}

.v2-theme .v2-time-dial__ampm-button.is-active:hover {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.v2-theme .v2-time-dial__ampm-button.is-active {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-color: hsl(var(--primary) / 0.8);
  box-shadow: 0 2px 6px hsl(var(--primary) / 0.3);
}

.v2-theme .v2-time-dial__display-button:focus-visible,
.v2-theme .v2-time-dial__option:focus-visible,
.v2-theme .v2-time-dial__ampm-button:focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
}
