/* ==========================================================================
   Milestone 3: Visual Local-Mode Indicators & Badging
   ========================================================================== */

/* Global dimmed and desaturated styling in local mode */
body.is-local-mode {
  --theme-accent: #6b7280;
  --theme-provider-top: #d1d5db;
  --theme-provider-bottom: #9ca3af;
}

body.is-local-mode .topbar,
body.is-local-mode .ribbon-bar,
body.is-local-mode .window-bar {
  filter: grayscale(35%) contrast(95%);
}

body.is-local-mode .window-brand {
  opacity: 0.88;
}

/* Persistent offline / local mode status banner */
#local-mode-banner,
.local-mode-banner {
  position: sticky;
  top: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 8px 16px;
  box-sizing: border-box;
  background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 100%);
  border-bottom: 2px solid #f59e0b;
  color: #92400e;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

#local-mode-banner[hidden],
.local-mode-banner[hidden] {
  display: none !important;
}

.local-banner-icon {
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
}

.local-banner-text {
  font-size: 12px;
  letter-spacing: 0.01em;
}

.local-banner-text strong {
  font-weight: 700;
  color: #78350f;
}

/* (Local Mode Only) badge on headers and views */
.local-mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  margin-left: 8px;
  border-radius: 4px;
  border: 1px solid var(--theme-accent, #d97706);
  background-color: #fef3c7;
  color: #92400e;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
  vertical-align: middle;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.local-mode-badge::before {
  content: "⚠️";
  font-size: 11px;
  line-height: 1;
}

/* ==========================================================================
   Developer Interactive Size Picker Overlay
   ========================================================================== */
.dev-size-picker-badge {
  position: fixed;
  z-index: 100000;
  min-width: 270px;
  max-width: 350px;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #f1f5f9;
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 11px;
  padding: 10px 12px;
  user-select: none;
  touch-action: none;
}
.dev-size-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  padding-bottom: 6px;
  cursor: grab;
}
.dev-size-picker-title {
  font-weight: 700;
  font-size: 11px;
  color: #38bdf8;
  display: flex;
  align-items: center;
  gap: 5px;
}
.dev-size-picker-target-tag {
  font-family: monospace;
  font-size: 10px;
  background: rgba(255, 255, 255, 0.12);
  padding: 2px 6px;
  border-radius: 4px;
  color: #fde047;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dev-size-picker-close {
  background: transparent;
  border: 0;
  color: var(--theme-quiet, #94a3b8);
  font-size: 14px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}
.dev-size-picker-close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}
.dev-size-picker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.dev-size-picker-label {
  font-weight: 600;
  color: #cbd5e1;
  font-size: 10.5px;
  width: 75px;
  flex-shrink: 0;
}
.dev-size-picker-slider-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}
.dev-size-picker-slider {
  flex: 1;
  height: 4px;
  cursor: pointer;
  accent-color: #38bdf8;
}
.dev-size-picker-val {
  font-family: monospace;
  font-size: 11px;
  color: #38bdf8;
  font-weight: 700;
  min-width: 44px;
  text-align: right;
}
.dev-size-picker-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #f1f5f9;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 10px;
  cursor: pointer;
}
.dev-size-picker-btn:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
}
.dev-size-picker-css {
  margin-top: 8px;
  padding: 6px 8px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  font-family: monospace;
  font-size: 10px;
  color: #86efac;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  word-break: break-all;
}
.dev-size-picker-copy {
  background: #0284c7;
  border: 0;
  color: #fff;
  border-radius: 3px;
  padding: 2px 6px;
  font-size: 9.5px;
  cursor: pointer;
  font-weight: 600;
  flex-shrink: 0;
}
.dev-size-picker-copy:hover {
  background: #0369a1;
}
.dev-size-picker-highlight {
  outline: 2px dashed #38bdf8 !important;
  outline-offset: 1px !important;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.5) !important;
}

/* Dark mode adjustments */
[data-theme="dark"] .mobile-version-card {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.6), 0 4px 12px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .mobile-version-title {
  color: #f8fafc;
}

[data-theme="dark"] .mobile-version-body {
  color: #cbd5e1;
}

[data-theme="dark"] .mobile-version-close {
  background: #334155;
  border-color: #475569;
  color: #cbd5e1;
}

[data-theme="dark"] .mobile-version-close:hover,
[data-theme="dark"] .mobile-version-close:active {
  background: #475569;
  color: #ffffff;
}

[data-theme="dark"] .mobile-version-eyebrow {
  color: #818cf8;
}

[data-theme="dark"] .mobile-version-icon-badge {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
  border-color: #4338ca;
}

[data-theme="dark"] .mobile-version-footer-note {
  color: var(--theme-quiet, #64748b);
}

[data-theme="dark"] .mobile-schedule-item.is-holding-time-block {
  box-shadow: 0 0 0 2.5px #94a3b8, 0 4px 14px rgba(0, 0, 0, 0.6) !important;
}

[data-theme="dark"] .mobile-timeblock-drag-avatar {
  border-color: var(--theme-border, #94a3b8);
  background:
    repeating-linear-gradient(135deg, rgba(148, 163, 184, 0.2) 0 8px, rgba(30, 41, 59, 0.9) 8px 18px),
    #1e293b;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(148, 163, 184, 0.2);
}

[data-theme="dark"] .mobile-timeblock-drag-avatar strong {
  color: #f8fafc;
}

[data-theme="dark"] .mobile-timeblock-drag-avatar span {
  color: #cbd5e1;
}

[data-theme="dark"] .mobile-grid-slot.is-time-block-drop-target {
  background: repeating-linear-gradient(135deg, rgba(148, 163, 184, 0.15) 0 8px, rgba(30, 41, 59, 0.5) 8px 18px) !important;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.45) !important;
}

[data-theme="dark"] .mobile-grid-slot.is-time-block-drop-target-start {
  background: repeating-linear-gradient(135deg, rgba(148, 163, 184, 0.25) 0 8px, rgba(30, 41, 59, 0.65) 8px 18px) !important;
  box-shadow: inset 0 2.5px 0 0 #94a3b8, inset 0 0 0 1px rgba(148, 163, 184, 0.65) !important;
}

/* Optional Glitch Mode: dark salon neon with brief, non-blocking signal tears. */
body[data-theme="signal-break"] #app-shell {
  background-image:
    radial-gradient(ellipse at 12% 9%, rgba(255, 54, 201, 0.13), transparent 36%),
    radial-gradient(ellipse at 88% 72%, rgba(48, 219, 234, 0.1), transparent 42%),
    linear-gradient(var(--theme-window-top), var(--theme-background));
}

body[data-theme="signal-break"] #brand-title {
  color: #f7f1ff;
  text-shadow: -1px 0 rgba(0, 245, 255, 0.82), 1px 0 rgba(255, 47, 195, 0.8);
  animation: signal-break-color-hop 4.7s steps(1, end) infinite;
}

body[data-theme="signal-break"] .ribbon-tool.is-active {
  border-color: #30dbea;
  box-shadow: inset 0 0 0 1px rgba(0, 245, 255, 0.22), 0 0 12px rgba(0, 245, 255, 0.34);
  animation: signal-break-accent-hop 3.9s steps(1, end) infinite;
}

body[data-theme="signal-break"] #app-shell::after {
  content: "";
  position: fixed;
  inset: 24px 0 0;
  z-index: 80;
  pointer-events: none;
  opacity: 0;
  background:
    linear-gradient(#05040a, #05040a) 12% 28% / 32px 9px,
    linear-gradient(#020107, #020107) 84% 63% / 20px 12px,
    linear-gradient(#05040a, #05040a) 42% 82% / 46px 6px,
    linear-gradient(90deg, #30dbea 50%, #ff36c9 50%) 68% 16% / 38px 2px,
    repeating-linear-gradient(0deg, transparent 0 4px, rgba(0, 245, 255, 0.08) 4px 5px);
  background-repeat: no-repeat;
  animation:
    signal-break-pixel-hop 1.9s steps(1, end) infinite,
    signal-break-color-hop 4.7s steps(1, end) infinite;
}

@keyframes signal-break-pixel-hop {
  0%, 78%, 86%, 100% { opacity: 0; }
  79% { opacity: 0.7; background-position: 12% 28%, 84% 63%, 42% 82%, 68% 16%, 0 0; }
  81% { opacity: 0.3; background-position: 72% 38%, 24% 73%, 62% 22%, 18% 66%, 0 1px; }
  83% { opacity: 0.6; background-position: 32% 78%, 64% 23%, 12% 52%, 88% 36%, 0 0; }
}

@keyframes signal-break-color-hop {
  0%, 28%, 100% { filter: hue-rotate(0deg); }
  29%, 52% { filter: hue-rotate(118deg); }
  53%, 76% { filter: hue-rotate(238deg); }
  77%, 99% { filter: hue-rotate(62deg); }
}

@keyframes signal-break-accent-hop {
  0%, 32%, 100% { box-shadow: inset 0 0 0 1px rgba(0, 245, 255, 0.22), 0 0 12px rgba(0, 245, 255, 0.34); }
  33%, 65% { box-shadow: inset 0 0 0 1px rgba(255, 47, 195, 0.28), 0 0 12px rgba(255, 47, 195, 0.42); }
  66%, 99% { box-shadow: inset 0 0 0 1px rgba(190, 255, 43, 0.24), 0 0 12px rgba(190, 255, 43, 0.34); }
}

@media (prefers-reduced-motion: reduce) {
  body[data-theme="signal-break"] #brand-title,
  body[data-theme="signal-break"] .ribbon-tool.is-active,
  body[data-theme="signal-break"] #app-shell::after {
    animation: none !important;
  }
}

/* ==========================================================================
   Bubbly Modern (2026 Theme): Modern rounded aesthetic with bubbly pill geometry,
   soft multi-layer ambient glows, bouncy tactile feedback, and playful fresh accents.
   ========================================================================== */
body[data-theme="bubbly-modern"] {
  --radius-tight: 12px;
}

body[data-theme="bubbly-modern"] #app-shell {
  background-image:
    radial-gradient(ellipse at 15% 10%, rgba(255, 77, 160, 0.12), transparent 45%),
    radial-gradient(ellipse at 85% 85%, rgba(159, 64, 224, 0.12), transparent 50%),
    linear-gradient(var(--theme-window-top), var(--theme-background));
}

body[data-theme="bubbly-modern"] .ribbon-bar {
  border-radius: 16px;
  margin: 3px 6px;
  box-shadow: 0 4px 16px rgba(130, 70, 190, 0.08);
}

body[data-theme="bubbly-modern"] .ribbon-strip {
  gap: 4px;
}

body[data-theme="bubbly-modern"] .ribbon-tool {
  border-radius: 14px;
  border: 1px solid rgba(209, 187, 243, 0.65);
  box-shadow: 0 2px 6px rgba(130, 70, 190, 0.05);
  transition: transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.16s ease;
}

body[data-theme="bubbly-modern"] .ribbon-tool:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 16px rgba(255, 77, 160, 0.18);
}

body[data-theme="bubbly-modern"] .ribbon-tool:active {
  transform: scale(0.96);
}

body[data-theme="bubbly-modern"] .ribbon-tool.is-active {
  border-color: #ff4da0;
  background: linear-gradient(135deg, rgba(255, 77, 160, 0.16), rgba(159, 64, 224, 0.12));
  box-shadow: inset 0 0 0 1.5px #ff4da0, 0 4px 12px rgba(255, 77, 160, 0.22);
}

body[data-theme="bubbly-modern"] .sidebar {
  border-radius: 18px;
  margin: 4px 2px 4px 6px;
  box-shadow: 0 4px 20px rgba(130, 70, 190, 0.09);
  border: 1px solid var(--theme-border);
}

body[data-theme="bubbly-modern"] .sidebar-header {
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
}

body[data-theme="bubbly-modern"] .mini-calendar-stack {
  border-radius: 14px;
  margin: 4px 6px;
  padding: 6px 8px;
  box-shadow: inset 0 1px 4px rgba(130, 70, 190, 0.05);
}

body[data-theme="bubbly-modern"] .mini-month {
  border-radius: 14px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.65);
  box-shadow: 0 2px 8px rgba(130, 70, 190, 0.06);
}

body[data-theme="bubbly-modern"] .mini-month-header {
  border-radius: 9999px;
  margin-bottom: 4px;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(130, 70, 190, 0.08);
}

body[data-theme="bubbly-modern"] .mini-day {
  border-radius: 9999px;
  transition: transform 0.12s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.12s ease;
}

body[data-theme="bubbly-modern"] .mini-day:hover {
  transform: scale(1.18);
  border-radius: 9999px;
}

body[data-theme="bubbly-modern"] .mini-day.is-selected {
  border-radius: 9999px;
  background: linear-gradient(135deg, #ff4da0, #9f40e0);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(255, 77, 160, 0.45);
}

body[data-theme="bubbly-modern"] .mini-day.is-today {
  border-radius: 9999px;
  background: rgba(255, 77, 160, 0.18);
  color: #d11270;
  box-shadow: inset 0 0 0 1.5px rgba(255, 77, 160, 0.65);
}

body[data-theme="bubbly-modern"] .mini-calendar-resizer {
  border-radius: 9999px;
  margin: 2px 8px;
  height: 6px;
  min-height: 6px;
}

body[data-theme="bubbly-modern"] .sidebar-box {
  border-radius: 16px;
  border: 1px solid var(--theme-border);
  margin: 6px 6px 10px;
  box-shadow: 0 3px 12px rgba(130, 70, 190, 0.07);
  overflow: hidden;
}

body[data-theme="bubbly-modern"] .box-title {
  border-radius: 14px 14px 0 0;
}

body[data-theme="bubbly-modern"] .sidebar-button,
body[data-theme="bubbly-modern"] .tab-button,
body[data-theme="bubbly-modern"] .nav-button,
body[data-theme="bubbly-modern"] .toolbar-button,
body[data-theme="bubbly-modern"] .section-button,
body[data-theme="bubbly-modern"] .sidebar-nav-btn {
  border-radius: 9999px;
  box-shadow: 0 2px 6px rgba(130, 70, 190, 0.08);
  transition: transform 0.14s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.14s ease;
}

body[data-theme="bubbly-modern"] .sidebar-button:hover,
body[data-theme="bubbly-modern"] .sidebar-nav-btn:hover {
  transform: translateY(-1.5px) scale(1.04);
  box-shadow: 0 4px 12px rgba(255, 77, 160, 0.28);
}

body[data-theme="bubbly-modern"] .sidebar-button:active,
body[data-theme="bubbly-modern"] .sidebar-nav-btn:active {
  transform: scale(0.95);
}

body[data-theme="bubbly-modern"] .quick-link {
  border-radius: 12px;
  margin: 3px 5px;
  transition: transform 0.14s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.1s ease;
}

body[data-theme="bubbly-modern"] .quick-link:hover {
  transform: translateX(3px);
  background: rgba(255, 255, 255, 0.85);
}

body[data-theme="bubbly-modern"] .provider-header {
  border-radius: 14px 14px 0 0;
  margin: 0 1px;
}

body[data-theme="bubbly-modern"] .provider-header::before {
  border-radius: 12px 12px 0 0;
}

body[data-theme="bubbly-modern"] .appointment-card,
body[data-theme="bubbly-modern"] .slot-card {
  border-radius: 14px;
  box-shadow: 0 3px 10px rgba(130, 70, 190, 0.12);
}


