/* Reset & General Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-color-1: #0f172a;
  --bg-color-2: #1e293b;
  --sign-bg: #ffffff;

  /* Sorry Sign Color Palette */
  --sign-burgundy: #992b37;
  --sign-green: #13381b;
  --sign-red-title: #b52435;
  --brass-color: #d4af37;
  --brass-dark: #aa8412;

  /* Clock Variables */
  --clock-radius: 125px;

  /* Transitions */
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  font-family: 'Outfit', sans-serif;
  background: radial-gradient(circle at center, var(--bg-color-2) 0%, var(--bg-color-1) 100%);
  color: var(--bg-color-1);
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  position: relative;
}

/* Background Pattern overlay */
body::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 0);
  background-size: 24px 24px;
  pointer-events: none;
  z-index: 0;
}

.app-container {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  max-width: 1200px;
  padding: 12px;
  overflow: hidden;
}

/* --- THE SIGN CARD --- */
.sign-card {
  width: 440px;
  min-height: 640px;
  background: var(--sign-bg);
  border-radius: 20px;
  box-shadow:
    0 15px 35px rgba(0, 0, 0, 0.35),
    0 5px 15px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  position: relative;
  transform: scale(var(--app-scale, 1));
  transform-origin: center center;
  transition: transform 0.4s ease-out, padding 0.3s ease, border 0.3s ease;
  flex-shrink: 0;
}

.sign-card.layout-sorry {
  padding: 26px;
}

.sign-card.layout-classic {
  padding: 0;
  border: 14px solid var(--sign-red-title);
  overflow: hidden;
}

/* Burgundy Frame (Inset) - Only for Sorry Layout */
.sign-card.layout-sorry::after {
  content: "";
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  bottom: 14px;
  border: 10px solid var(--sign-burgundy);
  border-radius: 12px;
  pointer-events: none;
  z-index: 1;
}

/* Grommet - Top Center (Classic Layout) */
.grommet {
  display: none;
}

.layout-classic .grommet {
  display: block;
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 24px;
  background: radial-gradient(circle, #ffe699 0%, var(--brass-color) 70%, var(--brass-dark) 100%);
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  z-index: 10;
}

.grommet-hole {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  background: #0f172a;
  border-radius: 50%;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6);
}

/* Sign Content Layout */
.sign-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  height: 100%;
  flex-grow: 1;
  padding: 8px 10px;
  transition: padding 0.3s ease;
}

.layout-classic .sign-content {
  padding: 0;
}

/* Header Text */
.sign-header {
  text-align: center;
  margin-bottom: 15px;
}

.layout-classic .sign-header {
  margin-bottom: 0;
}

/* Layout Headers Toggling */
.sorry-header-content {
  display: none;
}

.layout-sorry .sorry-header-content,
.layout-sorry-landscape .sorry-header-content {
  display: block;
}

.classic-header-content {
  display: none;
}

.layout-classic .classic-header-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--sign-red-title) 0%, #991b1b 100%);
  padding: 24px 10px;
  width: 100%;
}

.sorry-title {
  font-family: 'Playfair Display', serif;
  font-weight: 900;
  font-style: italic;
  font-size: 6rem;
  color: var(--sign-red-title);
  line-height: 1;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.sorry-subtitle {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-style: italic;
  font-size: 1.8rem;
  line-height: 1.3;
  color: var(--sign-green);
  letter-spacing: -0.01em;
}

.classic-header-content h1 {
  font-family: 'Outfit', sans-serif;
  font-weight: 900;
  font-size: 2.6rem;
  color: #ffffff;
  line-height: 1.1;
  text-align: center;
  letter-spacing: 0.05em;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.classic-header-content .header-line-1 {
  margin-bottom: 2px;
}

/* Clock Container */
.clock-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  position: relative;
}

.layout-classic .clock-container {
  padding: 30px 20px 20px 20px;
  margin-bottom: 0;
  flex-grow: 1;
  justify-content: space-around;
}

/* The Clock Face circle */
.clock-face {
  width: 260px;
  height: 260px;
  border-radius: 50%;
  position: relative;
  background: #ffffff;
  transition: transform 0.2s ease;
}

.clock-face.alarm-flashing {
  animation: clockFaceFlash 0.7s steps(1, end) infinite;
  cursor: pointer;
}

@keyframes clockFaceFlash {
  0%,
  49% {
    background: #ffffff;
  }

  50%,
  100% {
    background: #facc15;
  }
}

.layout-classic .clock-face {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

/* Dial svg outer boundary */
.clock-dial {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hour-wedge {
  fill: rgba(153, 43, 55, 0.18);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.hour-wedge.visible {
  opacity: 1;
}

.dial-border {
  fill: none;
  stroke: var(--sign-green);
  stroke-width: 4px;
  transition: stroke 0.3s ease, stroke-width 0.3s ease;
}

.layout-classic .dial-border {
  stroke: #1e293b;
  stroke-width: 6px;
}

/* Ticks style (only in classic) */
.tick {
  stroke: #1e293b;
  stroke-linecap: round;
}

.tick.major {
  stroke-width: 3.5px;
}

.tick.minor {
  stroke-width: 1.5px;
  stroke: #64748b;
}

/* Numbers styling */
.clock-numbers {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
}

.number {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 32px;
  height: 32px;
  margin: -16px 0 0 -16px;
  text-align: center;
  line-height: 32px;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1.8rem;
  color: var(--sign-green);
  transition: color 0.3s ease, font-weight 0.3s ease;
}

.layout-classic .number {
  color: #1e293b;
  font-weight: 900;
}

/* circular positions for numbers (using clock-radius of 96px) */
.n12 {
  transform: rotate(0deg) translate(0, -96px) rotate(0deg);
}

.n1 {
  transform: rotate(30deg) translate(0, -96px) rotate(-30deg);
}

.n2 {
  transform: rotate(60deg) translate(0, -96px) rotate(-60deg);
}

.n3 {
  transform: rotate(90deg) translate(0, -96px) rotate(-90deg);
}

.n4 {
  transform: rotate(120deg) translate(0, -96px) rotate(-120deg);
}

.n5 {
  transform: rotate(150deg) translate(0, -96px) rotate(-150deg);
}

.n6 {
  transform: rotate(180deg) translate(0, -96px) rotate(-180deg);
}

.n7 {
  transform: rotate(210deg) translate(0, -96px) rotate(-210deg);
}

.n8 {
  transform: rotate(240deg) translate(0, -96px) rotate(-240deg);
}

.n9 {
  transform: rotate(270deg) translate(0, -96px) rotate(-270deg);
}

.n10 {
  transform: rotate(300deg) translate(0, -96px) rotate(-300deg);
}

.n11 {
  transform: rotate(330deg) translate(0, -96px) rotate(-330deg);
}

/* Clock Hands Groups */
.hand-group {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
}

.target-hands {
  z-index: 5;
}

.target-hands.hidden {
  opacity: 0;
  pointer-events: none;
}

.hand {
  position: absolute;
  left: 50%;
  bottom: 50%;
  transform-origin: 50% 100%;
}

/* CURRENT TIME HANDS (Black, shown above target time) */
.current-hands {
  z-index: 7;
  opacity: 0.5;
  pointer-events: none;
}

.current-hour {
  z-index: 7;
  background: #050505;
  transition: background 0.3s ease, width 0.3s ease, height 0.3s ease, margin-left 0.3s ease, border-radius 0.3s ease, clip-path 0.3s ease;
}

.layout-sorry .current-hour,
.layout-sorry-landscape .current-hour {
  width: 18px;
  height: 65px;
  margin-left: -9px;
  clip-path: polygon(50% 0%, 100% 25%, 70% 100%, 30% 100%, 0% 25%);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.18);
}

.layout-classic .current-hour {
  width: 16px;
  height: 62px;
  background: #050505;
  margin-left: -8px;
  border-radius: 8px;
  clip-path: none;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.22);
}

.current-minute {
  z-index: 8;
  background: #050505;
  transition: background 0.3s ease, width 0.3s ease, height 0.3s ease, margin-left 0.3s ease, border-radius 0.3s ease, clip-path 0.3s ease;
}

.layout-sorry .current-minute,
.layout-sorry-landscape .current-minute {
  width: 12px;
  height: 96px;
  margin-left: -6px;
  clip-path: polygon(50% 0%, 100% 15%, 70% 100%, 30% 100%, 0% 15%);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.18);
}

.layout-classic .current-minute {
  width: 10px;
  height: 92px;
  background: #050505;
  margin-left: -5px;
  border-radius: 6px;
  clip-path: none;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.22);
}

.current-second {
  z-index: 9;
  width: 1.5px;
  height: 90px;
  background: #050505;
  margin-left: -0.75px;
  transform-origin: 50% 85%;
  bottom: calc(50% - 13.5px);
}

/* TARGET RETURN TIME HANDS (Draggable) */
.target-hour {
  z-index: 5;
  transition: background 0.3s ease, width 0.3s ease, height 0.3s ease, margin-left 0.3s ease, border-radius 0.3s ease, clip-path 0.3s ease;
}

.layout-sorry .target-hour,
.layout-sorry-landscape .target-hour {
  width: 18px;
  height: 65px;
  background: var(--sign-burgundy);
  margin-left: -9px;
  /* Sword shape: pointed tip, tapers down to base */
  clip-path: polygon(50% 0%, 100% 25%, 70% 100%, 30% 100%, 0% 25%);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.layout-classic .target-hour {
  width: 16px;
  height: 62px;
  background: var(--sign-burgundy);
  margin-left: -8px;
  border-radius: 8px;
  /* Rounded ends */
  clip-path: none;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.target-minute {
  z-index: 6;
  transition: background 0.3s ease, width 0.3s ease, height 0.3s ease, margin-left 0.3s ease, border-radius 0.3s ease, clip-path 0.3s ease;
}

.layout-sorry .target-minute,
.layout-sorry-landscape .target-minute {
  width: 12px;
  height: 96px;
  background: var(--sign-burgundy);
  margin-left: -6px;
  /* Sword shape: pointed tip, tapers down to base */
  clip-path: polygon(50% 0%, 100% 15%, 70% 100%, 30% 100%, 0% 15%);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.layout-classic .target-minute {
  width: 10px;
  height: 92px;
  background: var(--sign-burgundy);
  margin-left: -5px;
  border-radius: 6px;
  /* Rounded ends */
  clip-path: none;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Drag Handles for Interactive Hands */
.draggable {
  cursor: grab;
  transition: opacity var(--transition-fast);
  touch-action: none; /* Prevents scroll interruption on mobile dragging */
}

.draggable:active {
  cursor: grabbing;
}

.draggable::after {
  content: "";
  position: absolute;
  top: -8px;
  left: -6px;
  right: -6px;
  bottom: -4px;
  border: 2px dashed transparent;
  transition: border-color var(--transition-fast);
}

.draggable:hover::after {
  border-color: rgba(212, 175, 55, 0.6);
}

.drag-handle {
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  left: 50%;
  top: 5px;
  transform: translateX(-50%);
  background: rgba(212, 175, 55, 0.9);
  border: 1.5px solid #ffffff;
  opacity: 0;
  transition: opacity var(--transition-fast);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  clip-path: none !important;
  /* prevent clip-path inherit */
  z-index: 10;
}

.draggable:hover .drag-handle {
  opacity: 1;
}

/* Center Pin (Gold Brass Cap Dome) */
.center-pin {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffffff 0%, var(--brass-color) 45%, var(--brass-dark) 90%);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.45);
  z-index: 10;
  pointer-events: none;
}

.pin-cap {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.15);
}

/* Symmetrical control buttons (Settings, Fullscreen, and Help) on the clock face */
.settings-toggle,
.fullscreen-toggle,
.help-toggle {
  position: absolute;
  background: transparent;
  /* Remove background button shape */
  border: none;
  /* Remove border */
  width: 36px;
  height: 36px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #cbd5e1;
  /* Shade lighter than #64748b */
  cursor: pointer;
  transition: var(--transition-smooth);
  z-index: 8;
  box-shadow: none;
  /* Remove shadow */
}

.settings-toggle {
  top: 20px;
  right: 20px;
}

.fullscreen-toggle {
  top: 20px;
  left: 20px;
}

.help-toggle {
  bottom: 20px;
  right: 20px;
}

.settings-toggle:hover {
  transform: rotate(45deg);
  background: transparent;
  color: #64748b;
  /* Subtle hover color */
}

.fullscreen-toggle:hover,
.help-toggle:hover {
  transform: scale(1.1);
  background: transparent;
  color: #64748b;
  /* Subtle hover color */
}

.help-panel {
  position: absolute;
  right: 20px;
  bottom: 62px;
  width: min(340px, calc(100% - 40px));
  max-height: 72%;
  overflow-y: auto;
  padding: 18px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--sign-green);
  border: 2px solid rgba(153, 43, 55, 0.28);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
  z-index: 30;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.help-panel.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.help-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.help-header h2 {
  font-size: 1.15rem;
  line-height: 1;
  margin: 0;
  color: var(--sign-burgundy);
}

.help-close {
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.help-close:hover {
  color: var(--sign-burgundy);
}

.help-content {
  display: grid;
  gap: 8px;
}

.help-content p {
  font-size: 0.92rem;
  line-height: 1.35;
  margin: 0;
}

.help-content h3 {
  margin: 8px 0 0;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sign-burgundy);
}

/* Countdown Panel (Bottom Corner - White Matte theme) */
.countdown-panel {
  margin-top: 2px;
  background: transparent;
  /* Remove white background */
  border: none;
  /* Remove border */
  border-radius: 10px;
  padding: 12px 16px;
  text-align: center;
  width: 85%;
  box-shadow: none;
  /* Remove box shadow */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

.countdown-timer {
  font-family: 'Share Tech Mono', monospace;
  font-size: 2.3rem;
  font-weight: 700;
  color: #cbd5e1;
  /* Shade lighter than #a3a3a3 */
  letter-spacing: 0.06em;
  line-height: 1;
}

.countdown-timer.returning {
  color: #10b981;
  /* Green when returning/close */
}

.countdown-label {
  font-family: 'Outfit', sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  color: #cbd5e1;
  /* Shade lighter than #a3a3a3 */
  font-weight: 800;
  margin-top: 0px;
  text-transform: uppercase;
}

/* Footer Discount message styling */
.sign-footer {
  text-align: center;
  margin-top: -12px;
  transition: display 0.3s ease;
}

.layout-classic .sign-footer {
  display: none;
}

.discount-text {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-style: italic;
  font-size: 1.45rem;
  line-height: 1.35;
  color: var(--sign-green);
  letter-spacing: -0.01em;
}

.discount-text strong {
  font-weight: 900;
  font-size: 1.6rem;
}

/* --- SETTINGS DRAWER PANEL --- */
.settings-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: 360px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
  z-index: 100;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  color: #f8fafc;
}

.settings-panel.open {
  transform: translateX(0);
}

.settings-header {
  padding: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.settings-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
}

.settings-close {
  background: none;
  border: none;
  font-size: 1.8rem;
  color: #94a3b8;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.settings-close:hover {
  color: #f8fafc;
}

.pin-toggle {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  transition: color var(--transition-fast), transform var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  margin-left: auto;
  margin-right: 12px;
}

.pin-toggle:hover {
  color: #f8fafc;
}

.pin-toggle.active {
  color: #facc15;
  transform: rotate(-45deg);
}

.settings-content {
  padding: 24px;
  flex-grow: 1;
  overflow-y: auto;
}

.setting-group {
  margin-bottom: 28px;
}

.setting-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #94a3b8;
  margin-bottom: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.select-custom {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition-fast);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
}

.select-custom:focus {
  border-color: #10b981;
  background-color: rgba(255, 255, 255, 0.1);
}

.select-custom option {
  background: #0f172a;
  color: #ffffff;
}

.input-custom {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition-fast);
}

.input-custom:focus {
  border-color: #10b981;
  background: rgba(255, 255, 255, 0.1);
}

.input-custom:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.input-custom::placeholder {
  color: #64748b;
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.link-grid .input-custom,
.link-grid #linkConnectBtn,
.link-grid .link-delete-btn {
  grid-column: span 2;
}

.link-status {
  margin-top: 10px;
  color: #94a3b8;
  font-size: 0.82rem;
  line-height: 1.35;
}

.btn-danger {
  background: rgba(181, 36, 53, 0.16);
  border-color: rgba(181, 36, 53, 0.45);
}

.btn-danger:hover:not(:disabled) {
  background: rgba(181, 36, 53, 0.3);
  border-color: var(--sign-red-title);
}

.presets-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 10px;
  color: #ffffff;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: #ffffff;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-preset {
  background: rgba(19, 56, 27, 0.3);
  border-color: rgba(19, 56, 27, 0.6);
}

.btn-preset:hover {
  background: rgba(19, 56, 27, 0.5);
  border-color: #10b981;
}

.btn-reset {
  background: rgba(212, 175, 55, 0.2);
  border-color: rgba(212, 175, 55, 0.5);
}

.btn-reset:hover {
  background: rgba(212, 175, 55, 0.35);
  border-color: #d4af37;
}

.toggle-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.toggle-option span {
  font-size: 0.95rem;
  color: #e2e8f0;
}

.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #334155;
  transition: .3s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
}

input:checked+.slider {
  background-color: #10b981;
}

input:checked+.slider:before {
  transform: translateX(22px);
}

.slider.rounded {
  border-radius: 34px;
}

.slider.rounded:before {
  border-radius: 50%;
}

.settings-footer {
  margin-top: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 20px;
}

.help-text {
  font-size: 0.8rem;
  line-height: 1.4;
  color: #94a3b8;
  font-style: italic;
}

/* --- THEMES (DARK MODE FOR APP BG) --- */
body.dark-mode {
  background: radial-gradient(circle at center, #020617 0%, #090d16 100%);
}

body.dark-mode .sign-card {
  background: #0f172a;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.6), 0 5px 20px rgba(0, 0, 0, 0.4);
}

body.dark-mode .sorry-subtitle,
body.dark-mode .discount-text {
  color: #e2e8f0;
}

/* Dark Mode Clock Face & Hands */
body.dark-mode .clock-face {
  background: #1e293b;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

body.dark-mode .clock-face.alarm-flashing {
  animation: clockFaceFlashDark 0.7s steps(1, end) infinite;
}

@keyframes clockFaceFlashDark {
  0%,
  49% {
    background: #1e293b;
  }
  50%,
  100% {
    background: #facc15;
  }
}

body.dark-mode .current-hour,
body.dark-mode .current-minute,
body.dark-mode .current-second {
  background: #ffffff !important;
}

body.dark-mode .number {
  color: #ffffff !important;
}

body.dark-mode .dial-border {
  stroke: #ffffff !important;
}

body.dark-mode .tick {
  stroke: #ffffff !important;
}

body.dark-mode .tick.minor {
  stroke: #64748b !important;
}

/* Device Link Details Collapsible Styling */
.link-setting-details {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 25px;
  padding-top: 15px;
}

.link-setting-details summary {
  font-size: 0.85rem;
  font-weight: 600;
  color: #94a3b8;
  cursor: pointer;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  user-select: none;
  outline: none;
  list-style: none; /* Hide default triangle marker */
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: color var(--transition-fast);
}

.link-setting-details summary::after {
  content: "┿"; /* Premium plus symbol */
  font-size: 0.8rem;
  transition: transform 0.2s ease;
}

.link-setting-details[open] summary::after {
  content: "━"; /* Premium minus/dash symbol */
}

.link-setting-details summary::-webkit-details-marker {
  display: none; /* Hide default triangle on Chrome/Safari */
}

.link-setting-details summary:hover {
  color: #f8fafc;
}

.link-setting-details[open] summary {
  margin-bottom: 15px;
  color: #10b981; /* Highlight summary when open */
}

.summary-header-wrapper {
  display: flex;
  align-items: center;
}

.instructions-trigger-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 2px 8px;
  cursor: pointer;
  text-transform: none; /* Keep it normal casing, not uppercase */
  letter-spacing: normal;
  transition: all var(--transition-fast);
  margin-left: 10px;
  display: inline-flex;
  align-items: center;
  font-family: inherit;
}

.instructions-trigger-btn:hover {
  background: rgba(16, 185, 129, 0.2);
  border-color: #10b981;
  color: #ffffff;
}

body.dark-mode .instructions-trigger-btn {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .instructions-trigger-btn:hover {
  background: rgba(16, 185, 129, 0.2);
  border-color: #10b981;
  color: #ffffff;
}

/* Sync Instructions Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000; /* High z-index to overlay on top of settings panel */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: rgba(30, 41, 59, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 24px;
  width: 90%;
  max-width: 420px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  position: relative;
  transform: scale(0.92);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  color: #f8fafc;
}

.modal-overlay.open .modal-content {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #94a3b8;
  cursor: pointer;
  transition: color var(--transition-fast);
  line-height: 1;
}

.modal-close:hover {
  color: #ffffff;
}

.modal-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 16px;
  color: #10b981;
  letter-spacing: 0.02em;
}

.modal-body {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #cbd5e1;
}

.modal-body p {
  margin-top: 0;
  margin-bottom: 12px;
}

.modal-body ol {
  margin: 0 0 16px 20px;
  padding: 0;
}

.modal-body li {
  margin-bottom: 8px;
}

.modal-body li strong {
  color: #ffffff;
}

/* Dark mode overrides for modal content */
body.dark-mode .modal-content {
  background: rgba(15, 23, 42, 0.95);
  border-color: rgba(255, 255, 255, 0.08);
}

/* Dark mode for help panel */
body.dark-mode .help-panel {
  background: rgba(15, 23, 42, 0.98);
  color: #e2e8f0;
  border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .help-header h2 {
  color: #fca5a5;
}

/* --- RESPONSIVENESS --- */
@media (max-width: 480px) {
  .sign-card:not(.layout-sorry-landscape) {
    width: 340px;
    min-height: 540px;
  }

  .sign-card.layout-sorry {
    padding: 16px;
  }

  .sign-card.layout-classic {
    padding: 0;
    border-width: 9px;
  }

  .sign-card.layout-sorry::after {
    top: 8px;
    left: 8px;
    right: 8px;
    bottom: 8px;
    border-width: 7px;
  }

  .classic-header-content h1 {
    font-size: 2rem;
  }

  .layout-classic .clock-container {
    padding: 15px 10px 10px 10px;
  }

  .sorry-title {
    font-size: 2.8rem;
  }

  .sorry-subtitle {
    font-size: 1.1rem;
  }

  .clock-face {
    width: 210px;
    height: 210px;
  }

  .number {
    font-size: 1.4rem;
  }

  /* Scale numbers translation (using radius 76px) */
  .n12 {
    transform: rotate(0deg) translate(0, -76px) rotate(0deg);
  }

  .n1 {
    transform: rotate(30deg) translate(0, -76px) rotate(-30deg);
  }

  .n2 {
    transform: rotate(60deg) translate(0, -76px) rotate(-60deg);
  }

  .n3 {
    transform: rotate(90deg) translate(0, -76px) rotate(-90deg);
  }

  .n4 {
    transform: rotate(120deg) translate(0, -76px) rotate(-120deg);
  }

  .n5 {
    transform: rotate(150deg) translate(0, -76px) rotate(-150deg);
  }

  .n6 {
    transform: rotate(180deg) translate(0, -76px) rotate(-180deg);
  }

  .n7 {
    transform: rotate(210deg) translate(0, -76px) rotate(-210deg);
  }

  .n8 {
    transform: rotate(240deg) translate(0, -76px) rotate(-240deg);
  }

  .n9 {
    transform: rotate(270deg) translate(0, -76px) rotate(-270deg);
  }

  .n10 {
    transform: rotate(300deg) translate(0, -76px) rotate(-300deg);
  }

  .n11 {
    transform: rotate(330deg) translate(0, -76px) rotate(-330deg);
  }

  .target-hour,
  .current-hour {
    height: 50px;
    width: 14px;
    margin-left: -7px;
  }

  .target-minute,
  .current-minute {
    height: 75px;
    width: 10px;
    margin-left: -5px;
  }

  .current-second {
    height: 75px;
  }

  .discount-text {
    font-size: 1.15rem;
  }

  .discount-text strong {
    font-size: 1.3rem;
  }
}

/* --- FULLSCREEN MODE SCALING --- */
body.fullscreen-mode {
  overflow: hidden;
}

body.fullscreen-mode .app-container,
body:fullscreen .app-container {
  padding: 12px;
}

body.fullscreen-mode .sign-card,
body:fullscreen .sign-card {
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
}

/* --- LANDSCAPE SORRY LAYOUT --- */
.sign-card.layout-sorry-landscape {
  width: 820px;
  min-height: 480px;
  background: #faf8f5;
  border: 14px solid var(--sign-red-title);
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.sign-card.layout-sorry-landscape::after {
  content: "";
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  bottom: 10px;
  border: 2px solid var(--sign-burgundy);
  border-radius: 10px;
  pointer-events: none;
  z-index: 1;
}

.layout-sorry-landscape .sign-content {
  display: grid;
  grid-template-columns: 1.22fr 1fr;
  grid-template-rows: auto auto;
  column-gap: 24px;
  row-gap: 16px;
  padding: 16px 24px;
  height: 100%;
  flex-grow: 1;
}

.layout-sorry-landscape .sign-header {
  grid-column: 1;
  grid-row: 1;
  text-align: center;
  align-self: center;
  margin-bottom: 0;
}

.layout-sorry-landscape .clock-container {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  justify-self: center;
  margin-bottom: 0;
}

.layout-sorry-landscape .sign-footer {
  grid-column: 1 / span 2;
  grid-row: 2;
  text-align: center;
  align-self: end;
  margin-top: 0;
  width: 100%;
}

.layout-sorry-landscape .sorry-title {
  font-size: 5.4rem;
  margin-bottom: 4px;
  line-height: 0.95;
}

.layout-sorry-landscape .sorry-subtitle {
  font-size: 1.55rem;
  line-height: 1.35;
  margin-top: 12px;
}

.sorry-divider-red {
  display: none;
}

.footer-divider-green {
  display: none;
}

.layout-sorry-landscape .sorry-divider-red {
  display: block;
  width: 85%;
  max-width: 340px;
  margin: 10px auto 2px auto;
  color: var(--sign-red-title);
  opacity: 0.85;
}

.sorry-divider-red svg {
  display: block;
  width: 100%;
  height: auto;
}

.layout-sorry-landscape .footer-divider-green {
  display: block;
  width: 100%;
  max-width: 580px;
  margin: 6px auto;
  color: var(--sign-green);
  opacity: 0.75;
}

.footer-divider-green svg {
  display: block;
  width: 100%;
  height: auto;
}

.layout-sorry-landscape .discount-text {
  font-size: 1.25rem;
  line-height: 1.2;
  margin: 4px 0;
  white-space: nowrap;
}

.layout-sorry-landscape .discount-text br {
  display: none;
}

.layout-sorry-landscape .discount-text strong {
  font-size: 1.35rem;
  margin: 0 4px;
  display: inline-block;
}

.layout-sorry-landscape .clock-face {
  width: 260px;
  height: 260px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
}

.layout-sorry-landscape .number {
  font-size: 1.7rem;
}

@media (max-width: 480px) {
  .layout-sorry-landscape .clock-face {
    width: 260px !important;
    height: 260px !important;
  }
  .layout-sorry-landscape .number {
    font-size: 1.7rem !important;
  }
  .layout-sorry-landscape .sorry-title {
    font-size: 5.4rem !important;
  }
  .layout-sorry-landscape .sorry-subtitle {
    font-size: 1.55rem !important;
  }
  .layout-sorry-landscape .discount-text {
    font-size: 1.25rem !important;
  }
  .layout-sorry-landscape .discount-text strong {
    font-size: 1.35rem !important;
  }
  .layout-sorry-landscape .n12 { transform: rotate(0deg) translate(0, -96px) rotate(0deg) !important; }
  .layout-sorry-landscape .n1  { transform: rotate(30deg) translate(0, -96px) rotate(-30deg) !important; }
  .layout-sorry-landscape .n2  { transform: rotate(60deg) translate(0, -96px) rotate(-60deg) !important; }
  .layout-sorry-landscape .n3  { transform: rotate(90deg) translate(0, -96px) rotate(-90deg) !important; }
  .layout-sorry-landscape .n4  { transform: rotate(120deg) translate(0, -96px) rotate(-120deg) !important; }
  .layout-sorry-landscape .n5  { transform: rotate(150deg) translate(0, -96px) rotate(-150deg) !important; }
  .layout-sorry-landscape .n6  { transform: rotate(180deg) translate(0, -96px) rotate(-180deg) !important; }
  .layout-sorry-landscape .n7  { transform: rotate(210deg) translate(0, -96px) rotate(-210deg) !important; }
  .layout-sorry-landscape .n8  { transform: rotate(240deg) translate(0, -96px) rotate(-240deg) !important; }
  .layout-sorry-landscape .n9  { transform: rotate(270deg) translate(0, -96px) rotate(-270deg) !important; }
  .layout-sorry-landscape .n10 { transform: rotate(300deg) translate(0, -96px) rotate(-300deg) !important; }
  .layout-sorry-landscape .n11 { transform: rotate(330deg) translate(0, -96px) rotate(-330deg) !important; }
  
  .layout-sorry-landscape .target-hour,
  .layout-sorry-landscape .current-hour {
    height: 65px !important;
    width: 18px !important;
    margin-left: -9px !important;
  }
  .layout-sorry-landscape .target-minute,
  .layout-sorry-landscape .current-minute {
    height: 96px !important;
    width: 12px !important;
    margin-left: -6px !important;
  }
}

/* --- SETTINGS MENU SIDEBAR PINNING --- */
@media (min-width: 769px) {
  .settings-panel.pinned {
    transform: translateX(0) !important;
    box-shadow: none;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  .app-container.menu-pinned {
    margin-right: 360px;
    width: calc(100% - 360px);
  }

  .quick-panel.pinned {
    transform: translateX(0) !important;
    box-shadow: none;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
  }

  .app-container.quick-pinned {
    margin-left: 360px;
    width: calc(100% - 360px);
  }
}

/* --- QUICK PRESETS SIDEBAR DRAW-OUT PANEL --- */
.quick-panel {
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: 360px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
  z-index: 100;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  color: #f8fafc;
}

.quick-panel.open {
  transform: translateX(0);
}

.quick-header {
  padding: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.quick-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
}

.quick-close {
  background: none;
  border: none;
  font-size: 1.8rem;
  color: #94a3b8;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.quick-close:hover {
  color: #f8fafc;
}

.quick-content {
  padding: 24px;
  flex-grow: 1;
  overflow-y: auto;
  direction: rtl; /* moves scrollbar to left side */
}

/* Reset text direction for all children so content renders LTR */
.quick-content > * {
  direction: ltr;
}

.quick-toggle {
  position: absolute;
  background: transparent;
  border: none;
  width: 36px;
  height: 36px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #cbd5e1;
  cursor: pointer;
  transition: var(--transition-smooth);
  z-index: 8;
  bottom: 20px;
  left: 20px;
}

.quick-toggle:hover {
  transform: scale(1.1);
  color: #64748b;
}

/* --- CLOCK FACE PULSING ANIMATION --- */
.clock-face.pulsing {
  animation: clockPulse 1.2s ease-in-out infinite alternate;
}

@keyframes clockPulse {
  0% {
    background-color: #ffffff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  }
  100% {
    background-color: #ffebeb; /* Deeper rose/red tint */
    box-shadow: 0 0 35px rgba(153, 43, 55, 0.85); /* Much stronger Burgundy glow */
  }
}

body.dark-mode .clock-face.pulsing {
  animation: clockPulseDark 1.2s ease-in-out infinite alternate;
}

@keyframes clockPulseDark {
  0% {
    background-color: #1e293b;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  }
  100% {
    background-color: #451a20; /* Deeper burgundy tint */
    box-shadow: 0 0 40px rgba(248, 113, 113, 0.95); /* Extremely glowing rose */
  }
}

body.theme-brass .clock-face.pulsing {
  animation: clockPulseBrass 1.2s ease-in-out infinite alternate;
}

@keyframes clockPulseBrass {
  0% {
    background-color: #fdfcf9;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.08);
  }
  100% {
    background-color: #eadeb8; /* Stronger brass/gold tint */
    box-shadow: 0 0 35px rgba(140, 88, 39, 0.9); /* Strong Glowing Oak/Brass shadow */
  }
}

body.theme-cyberpunk .clock-face.pulsing {
  animation: clockPulseCyber 1.2s ease-in-out infinite alternate;
}

@keyframes clockPulseCyber {
  0% {
    background-color: #06060c;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.35);
  }
  100% {
    background-color: #24003d; /* Much deeper purple tint */
    box-shadow: 0 0 40px rgba(0, 240, 255, 1), 0 0 20px rgba(255, 0, 127, 0.9); /* Vibrant Cyan/magenta neon glow */
  }
}

body.theme-vintage .clock-face.pulsing {
  animation: clockPulseVintage 1.2s ease-in-out infinite alternate;
}

@keyframes clockPulseVintage {
  0% {
    background-color: #ebdfc9;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.1);
  }
  100% {
    background-color: #d2bd96; /* Rich warm brown tint */
    box-shadow: 0 0 35px rgba(77, 51, 31, 0.9); /* Heavy Vintage brown glow */
  }
}

body.theme-minimalist .clock-face.pulsing {
  animation: clockPulseMinimal 1.2s ease-in-out infinite alternate;
}

@keyframes clockPulseMinimal {
  0% {
    background-color: #f9fafb;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
  }
  100% {
    background-color: #e5e7eb; /* Deeper grey tint */
    box-shadow: 0 0 30px rgba(17, 24, 39, 0.5); /* Strong gray glow */
  }
}

/* --- DIGITAL CLOCK FACE VIEW --- */
.digital-face {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  padding: 24px;
  box-sizing: border-box;
  z-index: 10;
  background: #ffffff;
}

body.dark-mode .digital-face {
  background: #1e293b;
}

.digital-time-container, 
.digital-return-container {
  text-align: center;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.digital-time-container {
  margin-bottom: 20px;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.08);
  padding-bottom: 12px;
}

body.dark-mode .digital-time-container {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.digital-current-time {
  font-family: 'Share Tech Mono', monospace;
  font-size: 2.1rem;
  color: #0f172a;
  letter-spacing: 0.05em;
  line-height: 1;
}

body.dark-mode .digital-current-time {
  color: #e2e8f0;
}

.digital-return-time {
  font-family: 'Share Tech Mono', monospace;
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--sign-burgundy);
  letter-spacing: 0.05em;
  line-height: 1;
}

body.dark-mode .digital-return-time {
  color: #f87171;
}

.digital-label {
  font-family: 'Outfit', sans-serif;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #94a3b8;
  text-transform: uppercase;
  margin-top: 5px;
}

.digital-adjustments {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.btn-adjust {
  background: rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(15, 23, 42, 0.12);
  color: #0f172a;
  padding: 5px 9px;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 800;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-adjust:hover {
  background: rgba(15, 23, 42, 0.15);
  border-color: #0f172a;
}

body.dark-mode .btn-adjust {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

body.dark-mode .btn-adjust:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: #ffffff;
}

/* --- ENGAGEMENT QR CODE OVERLAY --- */
.qr-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  z-index: 25;
  transition: var(--transition-smooth);
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.05);
}

body.dark-mode .qr-overlay {
  background: rgba(30, 41, 59, 0.98);
}

.qr-code-container {
  background: #ffffff;
  padding: 10px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 12px;
}

.qr-code-container img {
  width: 130px;
  height: 130px;
  display: block;
}

.qr-label {
  font-family: 'Outfit', sans-serif;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--sign-green);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

body.dark-mode .qr-label {
  color: #10b981;
}

/* --- EDITABLE TEXT FIELD FOCUS BOXES --- */
[contenteditable="true"] {
  outline: none;
  border: 1.5px dashed transparent;
  border-radius: 6px;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

[contenteditable="true"]:hover {
  border-color: rgba(16, 185, 129, 0.4);
  background-color: rgba(16, 185, 129, 0.04);
  cursor: text;
}

[contenteditable="true"]:focus {
  border-color: #10b981;
  background-color: rgba(16, 185, 129, 0.08);
}

/* --- OPEN WELCOME STATE SCREEN --- */
.open-content {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  flex-grow: 1;
  padding: 30px 20px;
  height: 100%;
  width: 100%;
  box-sizing: border-box;
}

.open-title {
  font-family: 'Playfair Display', serif;
  font-weight: 900;
  font-style: italic;
  font-size: 5rem;
  color: #10b981;
  line-height: 1;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.open-divider-red {
  width: 80%;
  max-width: 320px;
  margin: 6px auto 14px auto;
  color: #10b981;
  opacity: 0.85;
}

.open-divider-red svg {
  display: block;
  width: 100%;
  height: auto;
}

.open-subtitle {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-style: italic;
  font-size: 1.8rem;
  line-height: 1.3;
  color: var(--sign-green);
  letter-spacing: -0.01em;
  margin-bottom: 24px;
}

.open-media-panel {
  width: 100%;
  max-width: 340px;
  background: rgba(16, 185, 129, 0.05);
  border: 1px dashed rgba(16, 185, 129, 0.3);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  box-sizing: border-box;
}

.open-welcome-msg {
  font-family: 'Outfit', sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--sign-green);
  line-height: 1.45;
}

.open-welcome-slideshow {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.open-welcome-slideshow img {
  max-width: 100%;
  max-height: 150px;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  object-fit: cover;
}

/* Show/Hide States */
.sign-card.state-open .sorry-header-content,
.sign-card.state-open .classic-header-content,
.sign-card.state-open .clock-container,
.sign-card.state-open .sign-footer,
.sign-card.state-open .grommet {
  display: none !important;
}

.sign-card.state-open .open-content {
  display: flex !important;
}

/* Open Mode inside Landscape Layout overrides */
.layout-sorry-landscape.state-open .open-content {
  grid-column: 1 / span 2;
  grid-row: 1 / span 2;
}

/* --- THEMES & STYLING VARIATIONS --- */

/* BRASS & OAK THEME */
body.theme-brass {
  background: radial-gradient(circle at center, #2e1c0c 0%, #170d05 100%) !important;
}

body.theme-brass .sign-card {
  background: #fbf9f3 !important;
  border: 14px solid #8c5827 !important;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), inset 0 0 12px rgba(92, 58, 33, 0.15) !important;
}

body.theme-brass .sign-card.layout-sorry::after {
  border-color: #8c5827 !important;
}

body.theme-brass .clock-face {
  background: #fdfcf9 !important;
  border: 2px solid #8c5827 !important;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.08) !important;
}

body.theme-brass .dial-border {
  stroke: #8c5827 !important;
}

body.theme-brass .number {
  color: #5d381b !important;
}

body.theme-brass .sorry-title {
  color: #8c5827 !important;
}

body.theme-brass .sorry-subtitle,
body.theme-brass .discount-text,
body.theme-brass .open-subtitle,
body.theme-brass .open-welcome-msg {
  color: #4a2e16 !important;
}

body.theme-brass .current-hour,
body.theme-brass .current-minute,
body.theme-brass .current-second {
  background: #b58918 !important;
}

body.theme-brass .target-hour,
body.theme-brass .target-minute {
  background: #8c5827 !important;
}

body.theme-brass .hour-wedge {
  fill: rgba(140, 88, 39, 0.15) !important;
}

body.theme-brass .digital-face {
  background: #fdfcf9 !important;
}

body.theme-brass .digital-current-time {
  color: #4a2e16 !important;
}

body.theme-brass .digital-return-time {
  color: #8c5827 !important;
}

body.theme-brass .btn-adjust {
  background: rgba(140, 88, 39, 0.08) !important;
  border-color: rgba(140, 88, 39, 0.2) !important;
  color: #4a2e16 !important;
}

body.theme-brass .btn-adjust:hover {
  background: rgba(140, 88, 39, 0.18) !important;
}

/* CYBERPUNK NEON THEME */
body.theme-cyberpunk {
  background: radial-gradient(circle at center, #070714 0%, #000000 100%) !important;
}

body.theme-cyberpunk::before {
  background-image: radial-gradient(rgba(0, 240, 255, 0.12) 1px, transparent 0) !important;
}

body.theme-cyberpunk .sign-card {
  background: rgba(10, 10, 20, 0.9) !important;
  border: 4px solid #ff007f !important;
  box-shadow: 0 0 25px rgba(255, 0, 127, 0.45), inset 0 0 15px rgba(0, 240, 255, 0.25) !important;
  color: #00f0ff !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
}

body.theme-cyberpunk .sign-card.layout-sorry::after {
  border: 2px solid #00f0ff !important;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.3) !important;
  top: 10px !important;
  left: 10px !important;
  right: 10px !important;
  bottom: 10px !important;
}

body.theme-cyberpunk .sorry-title {
  color: #ff007f !important;
  text-shadow: 0 0 8px rgba(255, 0, 127, 0.85) !important;
}

body.theme-cyberpunk .sorry-subtitle,
body.theme-cyberpunk .discount-text,
body.theme-cyberpunk .open-subtitle,
body.theme-cyberpunk .open-welcome-msg {
  color: #00f0ff !important;
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.8) !important;
}

body.theme-cyberpunk .clock-face {
  background: #06060c !important;
  border: 2px solid #00f0ff !important;
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.35), inset 0 0 8px rgba(0, 240, 255, 0.1) !important;
}

body.theme-cyberpunk .dial-border {
  stroke: #ff007f !important;
}

body.theme-cyberpunk .number {
  color: #00f0ff !important;
  text-shadow: 0 0 6px rgba(0, 240, 255, 0.6) !important;
}

body.theme-cyberpunk .current-hour,
body.theme-cyberpunk .current-minute,
body.theme-cyberpunk .current-second {
  background: #ff007f !important;
  box-shadow: 0 0 8px rgba(255, 0, 127, 0.8) !important;
}

body.theme-cyberpunk .target-hour,
body.theme-cyberpunk .target-minute {
  background: #00f0ff !important;
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.8) !important;
}

body.theme-cyberpunk .hour-wedge {
  fill: rgba(0, 240, 255, 0.18) !important;
}

body.theme-cyberpunk .digital-face {
  background: #06060c !important;
}

body.theme-cyberpunk .digital-current-time {
  color: #00f0ff !important;
  text-shadow: 0 0 6px rgba(0, 240, 255, 0.6) !important;
}

body.theme-cyberpunk .digital-return-time {
  color: #ff007f !important;
  text-shadow: 0 0 8px rgba(255, 0, 127, 0.8) !important;
}

body.theme-cyberpunk .btn-adjust {
  background: rgba(0, 240, 255, 0.08) !important;
  border-color: rgba(0, 240, 255, 0.25) !important;
  color: #00f0ff !important;
}

body.theme-cyberpunk .btn-adjust:hover {
  background: rgba(0, 240, 255, 0.2) !important;
  border-color: #00f0ff !important;
}

/* WARM VINTAGE THEME */
body.theme-vintage {
  background: radial-gradient(circle at center, #3d2f23 0%, #1e150d 100%) !important;
}

body.theme-vintage .sign-card {
  background: #f3edd8 !important;
  border: 12px double #4d331f !important;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5) !important;
}

body.theme-vintage .sign-card.layout-sorry::after {
  border: 2px solid #4d331f !important;
}

body.theme-vintage .clock-face {
  background: #ebdfc9 !important;
  border: 2px solid #4d331f !important;
}

body.theme-vintage .dial-border {
  stroke: #4d331f !important;
}

body.theme-vintage .number {
  color: #3d2818 !important;
  font-family: 'Playfair Display', serif !important;
  font-weight: 700 !important;
}

body.theme-vintage .sorry-title {
  color: #4d331f !important;
  font-family: 'Playfair Display', serif !important;
}

body.theme-vintage .sorry-subtitle,
body.theme-vintage .discount-text,
body.theme-vintage .open-subtitle,
body.theme-vintage .open-welcome-msg {
  color: #3d2818 !important;
}

body.theme-vintage .current-hour,
body.theme-vintage .current-minute,
body.theme-vintage .current-second {
  background: #23160b !important;
}

body.theme-vintage .target-hour,
body.theme-vintage .target-minute {
  background: #4d331f !important;
}

body.theme-vintage .hour-wedge {
  fill: rgba(77, 51, 31, 0.15) !important;
}

body.theme-vintage .digital-face {
  background: #ebdfc9 !important;
}

body.theme-vintage .digital-current-time {
  color: #3d2818 !important;
}

body.theme-vintage .digital-return-time {
  color: #4d331f !important;
}

body.theme-vintage .btn-adjust {
  background: rgba(77, 51, 31, 0.08) !important;
  border-color: rgba(77, 51, 31, 0.2) !important;
  color: #3d2818 !important;
}

body.theme-vintage .btn-adjust:hover {
  background: rgba(77, 51, 31, 0.18) !important;
}

/* CHIC MINIMALIST THEME */
body.theme-minimalist {
  background: radial-gradient(circle at center, #f4f4f7 0%, #d1d5db 100%) !important;
}

body.theme-minimalist .sign-card {
  background: #ffffff !important;
  border-radius: 4px !important;
  border: 1px solid #e5e7eb !important;
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.04), 0 2px 10px rgba(0, 0, 0, 0.02) !important;
}

body.theme-minimalist .sign-card.layout-sorry::after {
  display: none !important;
}

body.theme-minimalist .sorry-title {
  color: #111827 !important;
  font-family: 'Outfit', sans-serif !important;
  font-style: normal !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
}

body.theme-minimalist .sorry-subtitle,
body.theme-minimalist .discount-text,
body.theme-minimalist .open-subtitle,
body.theme-minimalist .open-welcome-msg {
  color: #4b5563 !important;
  font-style: normal !important;
  font-weight: 500 !important;
}

body.theme-minimalist .clock-face {
  background: #f9fafb !important;
  border: 1px solid #f3f4f6 !important;
}

body.theme-minimalist .dial-border {
  stroke: #e5e7eb !important;
}

body.theme-minimalist .number {
  color: #9ca3af !important;
  font-weight: 500 !important;
}

body.theme-minimalist .current-hour,
body.theme-minimalist .current-minute,
body.theme-minimalist .current-second {
  background: #111827 !important;
}

body.theme-minimalist .target-hour,
body.theme-minimalist .target-minute {
  background: #9ca3af !important;
}

body.theme-minimalist .hour-wedge {
  fill: rgba(17, 24, 39, 0.06) !important;
}

body.theme-minimalist .digital-face {
  background: #f9fafb !important;
}

body.theme-minimalist .digital-current-time {
  color: #111827 !important;
}

body.theme-minimalist .digital-return-time {
  color: #9ca3af !important;
}

body.theme-minimalist .btn-adjust {
  background: rgba(17, 24, 39, 0.04) !important;
  border-color: rgba(17, 24, 39, 0.1) !important;
  color: #111827 !important;
}

body.theme-minimalist .btn-adjust:hover {
  background: rgba(17, 24, 39, 0.08) !important;
}

/* --- DRAG & DROP / EDITABLE PRESETS SIDEBAR STYLING --- */
.presets-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 4px;
}

.preset-item {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 4px 8px;
  transition: all 0.2s ease;
  user-select: none;
}

.preset-item.over {
  border: 1px dashed #3b82f6;
  background: rgba(59, 130, 246, 0.15);
  transform: scale(0.98);
}

.preset-drag-handle {
  cursor: grab;
  color: #64748b;
  font-size: 1.1rem;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
}

.preset-drag-handle:active {
  cursor: grabbing;
}

.preset-apply-btn {
  flex-grow: 1;
  background: none;
  border: none;
  color: #cbd5e1;
  text-align: left;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 6px;
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 0.2s ease, color 0.2s ease;
  white-space: normal;
  word-break: break-word;
}

.preset-apply-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.preset-edit-btn,
.preset-delete-btn {
  background: none;
  border: none;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 6px;
  border-radius: 4px;
  color: #94a3b8;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}

.preset-edit-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #3b82f6;
}

.preset-delete-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

/* Inline Edit Form Layout */
.preset-edit-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  padding: 6px;
  background: rgba(15, 23, 42, 0.4);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.preset-edit-row {
  display: flex;
  gap: 6px;
}

.preset-edit-form input {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  color: #ffffff;
  padding: 5px 8px;
  font-size: 0.8rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.preset-edit-form input:focus {
  border-color: #3b82f6;
}

.preset-edit-form input[type="text"] {
  flex-grow: 1;
}

.preset-edit-form input[type="number"] {
  width: 65px;
}

.preset-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.preset-save-btn,
.preset-cancel-btn {
  border: none;
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.preset-save-btn {
  background: #3b82f6;
  color: #ffffff;
}

.preset-save-btn:hover {
  background: #2563eb;
}

.preset-cancel-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
}

.preset-cancel-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}
