/* ==========================================================================
   FAMILYHUB CALENDAR - PREMIUM GLASSMORPHISM SYSTEM
   ========================================================================== */

/* --- Google Fonts Import --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@300;400;500;600;700;800&display=swap');

/* --- Design Tokens / CSS Variables --- */
:root {
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Color Palette - Elegant Dark Space theme */
  --bg-primary: #0a0f1d;
  --bg-gradient: radial-gradient(circle at 0% 0%, #1e1b4b 0%, #0f172a 50%, #020617 100%);
  --bg-glow-purple: rgba(147, 51, 234, 0.15);
  --bg-glow-cyan: rgba(6, 182, 212, 0.12);

  /* Glassmorphism tokens */
  --glass-bg: rgba(30, 41, 59, 0.45);
  --glass-bg-hover: rgba(30, 41, 59, 0.65);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-focus: rgba(99, 102, 241, 0.4);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --glass-blur: blur(16px);

  /* Typography Colors */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dark: #64748b;
  --accent-color: #6366f1;
  --accent-glow: rgba(99, 102, 241, 0.3);
  
  /* Adaptive input & overlay tokens */
  --input-bg: rgba(255, 255, 255, 0.03);
  --overlay-bg: rgba(255, 255, 255, 0.02);
  --overlay-bg-hover: rgba(255, 255, 255, 0.06);

  /* Category colors */
  --color-general: #6366f1;
  --color-work: #06b6d4;
  --color-school: #f97316;
  --color-home: #10b981;
  --color-maintenance: #a855f7;
  --color-social: #ec4899;

  /* Spacing & Borders */
  --border-radius-lg: 24px;
  --border-radius-md: 16px;
  --border-radius-sm: 8px;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  /* Dropdown Popover Custom background */
  --dropdown-bg: rgba(15, 23, 42, 0.95);
}

/* --- Base Resets & Layout --- */
html, body {
  touch-action: manipulation; /* Disable double-tap to zoom */
  scrollbar-width: none !important; /* Hide main scrollbar on Firefox */
  -ms-overflow-style: none !important; /* Hide main scrollbar on IE/Edge */
  overflow: hidden !important;
  overflow-x: hidden !important;
  overflow-y: hidden !important;
  height: 100vh !important;
  max-height: 100vh !important;
  width: 100% !important;
  position: fixed;
  top: 0;
  left: 0;
  overscroll-behavior: none !important; /* Disable native swipe history back/forward navigations */
  overscroll-behavior-x: none !important;
}

/* Hide main scrollbar on Webkit browsers */
html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  background-image: var(--bg-gradient);
  color: var(--text-main);
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Lock viewport and disable overall dynamic page scrolling in desktop/kiosk sizes */
@media (min-width: 1024px) {
  html, body {
    overflow: hidden !important;
    height: 100vh !important;
    max-height: 100vh !important;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
  }
}

/* Ambient glow accents */
body::before {
  content: "";
  position: absolute;
  top: -10%;
  left: -10%;
  width: 50%;
  height: 50%;
  background: var(--bg-glow-purple);
  filter: blur(150px);
  z-index: -1;
  pointer-events: none;
}

body::after {
  content: "";
  position: absolute;
  bottom: -10%;
  right: -10%;
  width: 50%;
  height: 50%;
  background: var(--bg-glow-cyan);
  filter: blur(150px);
  z-index: -1;
  pointer-events: none;
}

/* --- Container App Wrapper --- */
.app-container {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 24px;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden; /* Strictly lock dynamic sizing and disable overall page scrolling */
}

/* --- Custom Scrollbar --- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* --- Reusable Glass Panels --- */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--glass-shadow);
  padding: 24px;
  transition: var(--transition-smooth);
}

.glass-panel:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  height: 100%;
  overflow-y: hidden; /* Lock sidebar scrolling to preserve hallway Kiosk solidity */
}

/* Ensure all sidebar lozenges maintain full design dimensions without vertical compression */
.brand-panel,
.clock-panel,
.view-toggle,
.glass-panel,
.nav-buttons {
  flex-shrink: 0 !important;
}

/* Premium Sidebar DAYPAGE Brand Lozenge */
.brand-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px 24px;
  text-align: center;
}

.brand-logo-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.brand-img-emblem {
  width: 76px;
  height: 76px;
  border-radius: 12px;
  object-fit: cover;
  border: 2px solid var(--glass-border);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.28));
  transition: var(--transition-smooth);
}

.brand-img-emblem:hover {
  transform: scale(1.04);
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  margin: 0;
  color: var(--text-main);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  background: linear-gradient(135deg, var(--text-main) 40%, var(--text-muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Mobile header brand is hidden on desktop by default */
.mobile-header-brand {
  display: none !important;
}

/* Header Clock Panel */
.clock-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.digital-clock {
  font-family: var(--font-heading);
  font-size: 3.2rem;
  font-weight: 800;
  letter-spacing: -1px;
  background: linear-gradient(135deg, #fff 0%, #a5b4fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
  margin-bottom: 4px;
}

.digital-seconds {
  font-size: 1.4rem;
  font-weight: 400;
  opacity: 0.8;
  vertical-align: super;
}

.calendar-date {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.greeting-text {
  font-size: 0.85rem;
  color: var(--accent-color);
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* Sync Indicator Status */
.sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  margin-bottom: 12px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.sync-badge:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

.sync-dot.syncing {
  background: #f59e0b;
  box-shadow: 0 0 8px #f59e0b;
  animation: pulse-sync 1s infinite alternate;
}

.sync-dot.offline {
  background: #ef4444;
  box-shadow: 0 0 8px #ef4444;
}

@keyframes pulse-sync {
  0% { opacity: 0.3; }
  100% { opacity: 1; }
}

/* Primary Navigation Buttons */
.nav-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn {
  font-family: var(--font-heading);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 20px;
  border-radius: var(--border-radius-md);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: white;
  border: none;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(99, 102, 241, 0.6);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

/* View Controller Tabs */
.view-toggle {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: rgba(255, 255, 255, 0.03);
  padding: 4px;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--glass-border);
}

.view-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 8px 0;
  cursor: pointer;
  border-radius: 12px;
  transition: var(--transition-smooth);
}

.view-tab:hover {
  color: var(--text-main);
}

.view-tab.active {
  background: var(--glass-bg-hover);
  color: var(--text-main);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  border: 1px solid rgba(255,255,255,0.05);
}

/* Family Filter Panel */
.family-panel-title {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* --- Collapsible Family Filters Dropdown --- */
.family-filter-container {
  position: relative;
  padding: 14px 20px !important;
}

.family-dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.family-dropdown-active {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar-circle-mini {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.active-filter-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

#familyDropdownArrow {
  transition: var(--transition-smooth);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.family-dropdown-content {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--dropdown-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-md);
  box-shadow: var(--glass-shadow);
  padding: 12px;
  z-index: 100;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.25s;
  pointer-events: none;
}

.family-dropdown-content.expanded {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.family-avatars {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.family-member-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 4px;
  border-radius: 20px;
  cursor: pointer;
  transition: var(--transition-smooth);
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.01);
}

.family-member-row:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

.family-member-row.active {
  background: var(--input-bg);
  border-color: var(--accent-color);
  box-shadow: 0 0 10px var(--accent-glow);
}

.member-profile {
  display: flex;
  align-items: center;
  gap: 6px;
}

.family-member-row .avatar-circle {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.75rem;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.25);
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.member-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: var(--transition-smooth);
}

.family-member-row.active .member-name {
  color: var(--text-main);
}

.member-filter-dot {
  display: none;
}

/* --- Right Column: Calendar Main --- */
.calendar-main {
  display: flex;
  flex-direction: column;
  gap: 24px;
  height: 100%;
  overflow: hidden;
}

/* Calendar Header Controller */
.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-left-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-nav-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.calendar-nav-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.calendar-title {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.calendar-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  padding: 4px;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--glass-border);
}

.nav-arrow {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.nav-arrow:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.btn-today {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0 12px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-today:hover {
  background: rgba(255, 255, 255, 0.08);
}

.quick-meta {
  display: flex;
  align-items: center;
  gap: 24px;
}

.weather-widget {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.weather-temp {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-main);
}

/* --- WEEK VIEW GRID --- */
.calendar-view-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}

.week-view-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 14px;
  height: 100%;
  min-height: 500px;
}

.day-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: var(--border-radius-md);
  padding: 12px;
  transition: var(--transition-smooth);
  height: 100%;
  overflow-y: auto;
}

.day-column:hover {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.05);
}

.day-column.is-today {
  background: rgba(99, 102, 241, 0.04);
  border-color: rgba(99, 102, 241, 0.25);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.1);
}

.day-column-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  text-align: center;
}

.day-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.day-number {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.6rem;
  color: var(--text-main);
  line-height: 1.1;
  margin-top: 2px;
}

.day-column.is-today .day-number {
  color: #a5b4fc;
}

/* Event Cards styling */
.events-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.event-card {
  position: relative;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-left: 4px solid var(--accent-color);
  border-radius: var(--border-radius-sm);
  padding: 10px;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
  gap: 6px;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  user-select: none !important;
  -webkit-touch-callout: none !important;
}

.event-card * {
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  user-select: none !important;
  -webkit-touch-callout: none !important;
}

.event-card:hover {
  background: rgba(255, 255, 255, 0.07);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.event-time {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.event-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.3;
  word-break: break-word;
}

.event-assignees {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.mini-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-family: var(--font-heading);
  font-weight: 800;
  border: 1px solid rgba(255,255,255,0.15);
}

.event-flag {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* Filter Fading animations */
.event-card.filtered-out {
  opacity: 0.15;
  transform: scale(0.95);
  pointer-events: none;
}

/* --- MONTH VIEW GRID --- */
.month-view-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: auto repeat(5, 1fr);
  gap: 6px;
  height: 100%;
  min-height: 500px;
}

.month-weekday-header {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  text-align: center;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.month-cell {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  min-height: 75px;
  transition: var(--transition-smooth);
}

.month-cell:hover {
  background: rgba(255, 255, 255, 0.03);
}

.month-cell.outside-month {
  opacity: 0.25;
}

.month-cell.is-today {
  background: rgba(99, 102, 241, 0.03);
  border-color: rgba(99, 102, 241, 0.3);
}

.month-day-number {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.month-cell.is-today .month-day-number {
  color: #a5b4fc;
}

.month-events {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow-y: auto;
  flex: 1;
  max-height: 80px;
}

.month-mini-event {
  font-size: 0.7rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 2px 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  border-left: 2px solid var(--accent-color);
  color: var(--text-main);
  cursor: pointer;
}

.month-mini-event:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* --- DAY VIEW --- */
.day-view-container {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  height: 100%;
}

.day-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.day-big-header {
  text-align: center;
  padding: 24px;
  border-radius: var(--border-radius-md);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
}

.day-big-num {
  font-family: var(--font-heading);
  font-size: 4rem;
  font-weight: 800;
  line-height: 1;
  color: var(--accent-color);
}

.day-big-name {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 4px;
}

.day-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  overflow-y: auto;
  height: 100%;
}

.timeline-hour-row {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.timeline-time {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding-top: 4px;
}

.timeline-events-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.timeline-event-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-left: 4px solid var(--accent-color);
  border-radius: var(--border-radius-md);
  padding: 14px;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.timeline-event-card:hover {
  background: rgba(255, 255, 255, 0.06);
  transform: translateX(4px);
}

.timeline-event-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.timeline-event-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
}

.timeline-event-description {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.timeline-event-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* --- MODAL DIALOGS --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(2, 6, 23, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 40px 16px;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

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

.modal-content {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--glass-shadow);
  width: 95%;
  max-width: 500px;
  padding: 24px;
  margin: auto;
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--text-main);
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 800;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.modal-close:hover {
  color: var(--text-main);
}

/* Form Styles */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.form-input {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  background: var(--input-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-sm);
  padding: 12px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-main);
  transition: var(--transition-smooth);
}

.form-input:focus {
  outline: none;
  background: var(--overlay-bg-hover);
  border-color: var(--accent-color);
  box-shadow: 0 0 8px var(--accent-glow);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.form-row > .form-group {
  min-width: 0 !important;
  box-sizing: border-box !important;
}

/* Multi-select check grid */
.assignee-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
}

.assignee-checkbox {
  position: relative;
}

.assignee-checkbox input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.assignee-checkbox-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  user-select: none;
}

.assignee-checkbox:hover .assignee-checkbox-label {
  background: rgba(255, 255, 255, 0.06);
}

.assignee-checkbox input:checked + .assignee-checkbox-label {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--accent-color);
  box-shadow: 0 0 6px var(--accent-glow);
}

/* Color Palette Select */
.flag-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
}

.flag-radio {
  position: relative;
}

.flag-radio input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.flag-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 4px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.flag-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

.flag-name {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
}

.flag-radio input:checked + .flag-badge {
  background: rgba(255, 255, 255, 0.07);
  border-color: white;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.15);
}

.flag-radio input:checked + .flag-badge .flag-name {
  color: var(--text-main);
}

/* Modal Actions buttons */
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 28px;
}

.modal-actions .btn {
  width: auto;
  padding: 10px 24px;
}

.btn-delete {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-delete:hover {
  background: #ef4444;
  color: white;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
}

.btn-toggle-all {
  padding: 4px 8px;
  font-size: 0.75rem;
  width: auto;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.8);
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

/* Light themes color overrides for Select All button */
body.theme-solar .btn-toggle-all,
body.theme-nordic .btn-toggle-all,
body.theme-mint .btn-toggle-all,
body.theme-sakura .btn-toggle-all {
  background: rgba(0, 0, 0, 0.05) !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  color: #000000 !important;
}

body.theme-solar .btn-toggle-all:hover,
body.theme-nordic .btn-toggle-all:hover,
body.theme-mint .btn-toggle-all:hover,
body.theme-sakura .btn-toggle-all:hover {
  background: rgba(0, 0, 0, 0.1) !important;
  color: #000000 !important;
}

/* --- QR Code Share Modal Styling --- */
.qr-modal-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
}

.qr-placeholder {
  background: white;
  padding: 16px;
  border-radius: var(--border-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.qr-link {
  font-family: monospace;
  background: rgba(255,255,255,0.05);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--accent-color);
  max-width: 100%;
  word-break: break-all;
}

/* --- MOBILE COMPANION LAYOUT (Detected or Sim) --- */
@media (max-width: 1023px) {
  .app-container {
    grid-template-columns: 1fr;
    padding: 16px;
    padding-bottom: 80px; /* Space for bottom navigation sticky actions */
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
  }

  /* Hide tablet-only elements */
  .sidebar {
    display: none; /* Hide fully, we'll expose navigation in a mobile topbar */
  }

  .calendar-main {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  /* Make header look like a nice mobile dashboard (50% shorter DWA lozenge) */
  .calendar-header {
    position: sticky;
    top: 12px;
    z-index: 1000;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-md);
    padding: 6px 12px;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
  }

  .header-left-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
  }

  .brand-nav-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
  }

  .calendar-nav-controls {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .mobile-header-brand {
    display: flex !important;
    align-items: center;
    gap: 6px;
    margin-bottom: 0;
    align-self: auto;
  }

  .mobile-brand-img {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    object-fit: cover;
    border: 1px solid var(--glass-border);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
  }

  .mobile-brand-title {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--text-main);
    background: linear-gradient(135deg, var(--text-main) 50%, var(--text-muted) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }

  .calendar-header .calendar-title {
    text-align: center;
    width: 100%;
    font-size: 1.05rem;
    letter-spacing: -0.2px;
    margin: 2px 0;
  }

  .calendar-nav {
    justify-content: center;
  }

  .quick-meta {
    justify-content: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 4px;
    margin-top: 2px;
  }

  /* Dynamic Mobile Navigation Drawer / Switcher */
  .mobile-nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--glass-border);
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 12px 24px;
    z-index: 999;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.15);
  }

  .mobile-nav-bar .view-tab {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 0;
    border-radius: 12px;
    box-shadow: none;
  }

  .mobile-nav-bar .view-tab.active {
    background: rgba(var(--accent-color-rgb, 99, 102, 241), 0.1);
    color: var(--accent-color);
    box-shadow: none;
    border: none;
  }

  /* Adjust grid views into a responsive list stack */
  .week-view-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    height: auto;
  }

  .day-column {
    height: auto;
    overflow-y: visible;
    padding: 16px;
    background: var(--glass-bg);
  }

  .day-column-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    margin-bottom: 8px;
  }

  .day-number {
    font-size: 1.3rem;
  }

  .events-list {
    gap: 12px;
  }

  .event-card {
    padding: 14px;
    border-radius: var(--border-radius-md);
  }

  .event-title {
    font-size: 0.95rem;
  }

  /* Month View adjust on Mobile */
  .month-view-grid {
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: auto repeat(6, auto);
    gap: 4px;
    height: auto !important;
    min-height: 0 !important;
  }

  .month-weekday-header {
    font-size: 0.7rem;
    padding: 4px 0;
    font-weight: 700;
  }

  .month-cell {
    padding: 6px 4px;
    min-height: 55px !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
  }

  .month-day-number {
    font-size: 0.8rem;
    margin-bottom: 4px;
    font-weight: 600;
  }

  .month-events {
    display: none; /* Hide titles on small screens, show dots instead */
  }

  .month-cell-dots {
    display: flex;
    justify-content: center;
    gap: 2px;
    flex-wrap: wrap;
    margin-top: 2px;
  }

  .month-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
  }

  /* Compact Weather Widget for 50% Shorter Mobile Top Lozenge */
  .weather-widget {
    gap: 6px !important;
  }
  .weather-widget #weatherIcon {
    font-size: 1.05rem !important;
  }
  .weather-widget .weather-temp {
    font-size: 0.9rem !important;
  }
  .weather-widget .weather-loc-label {
    font-size: 0.65rem !important;
  }
  .weather-widget #weatherDesc {
    font-size: 0.58rem !important;
  }

  /* Day View adjust on Mobile */
  .day-view-container {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .day-sidebar {
    display: none; /* Hide large visual number, keep only chronological stack */
  }

  .modal-content {
    padding: 16px;
    margin: 20px auto 80px auto; /* Clearance from mobile browser bar! */
  }

  .day-timeline {
    padding: 16px;
    height: auto !important;
    overflow: visible !important;
  }

  /* Mobile floating quick add button */
  .mobile-fab {
    position: fixed;
    right: 20px;
    bottom: 80px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.5);
    border: none;
    cursor: pointer;
    z-index: 998;
    transition: var(--transition-smooth);
  }

  .mobile-fab:hover {
    transform: scale(1.1);
  }
}

/* Fallback element display rules */
@media (min-width: 1024px) {
  .mobile-nav-bar,
  .mobile-fab,
  .month-cell-dots {
    display: none !important;
  }
}

/* ==========================================
   SETTINGS CENTER & DYNAMIC TAB STYLES
   ========================================== */
.settings-tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 12px;
  margin-bottom: 20px;
  overflow-x: auto;
}

.settings-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 8px 14px;
  cursor: pointer;
  border-radius: var(--border-radius-sm);
  transition: var(--transition-smooth);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.settings-tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.03);
}

.settings-tab-btn.active {
  background: var(--glass-bg-hover);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.settings-tab-content {
  display: none;
  animation: fadeInSettingsTab 0.25s ease-out;
}

.settings-tab-content.active {
  display: block;
}

@keyframes fadeInSettingsTab {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Accessibility contrast styles for Kiosk settings modal cards */
.settings-card {
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 20px;
  transition: var(--transition-smooth);
}

/* Purple Theme settings cards (e.g. Account, Family Name, Alerts) */
.settings-card.purple-card {
  background: rgba(99, 102, 241, 0.03);
  border: 1px solid rgba(99, 102, 241, 0.15);
}
body.theme-nordic .settings-card.purple-card,
body.theme-mint .settings-card.purple-card,
body.theme-sakura .settings-card.purple-card,
body.theme-solar .settings-card.purple-card {
  background: rgba(99, 102, 241, 0.05);
  border: 1px solid rgba(99, 102, 241, 0.25);
}

/* Amber/Yellow Theme settings cards (e.g. Weather Location) */
.settings-card.amber-card {
  background: rgba(245, 158, 11, 0.03);
  border: 1px solid rgba(245, 158, 11, 0.15);
}
body.theme-nordic .settings-card.amber-card,
body.theme-mint .settings-card.amber-card,
body.theme-sakura .settings-card.amber-card,
body.theme-solar .settings-card.amber-card {
  background: rgba(217, 119, 6, 0.05);
  border: 1px solid rgba(217, 119, 6, 0.25);
}

/* Standard label text inside settings cards (always adopts perfect light/dark contrast) */
.settings-card-label {
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-main) !important;
  margin-bottom: 4px;
}

/* Icons styling inside settings card labels */
.settings-card-label i {
  font-size: 0.95rem;
}

/* Custom theme color overrides for settings icons depending on active light/dark modes */
.settings-card-label i.fa-user-shield,
.settings-card-label i.fa-users {
  color: var(--accent-color);
}
.settings-card-label i.fa-signature,
.settings-card-label i.fa-bell {
  color: #6366f1;
}
body.theme-nordic .settings-card-label i.fa-signature,
body.theme-mint .settings-card-label i.fa-signature,
body.theme-sakura .settings-card-label i.fa-signature,
body.theme-solar .settings-card-label i.fa-signature,
body.theme-nordic .settings-card-label i.fa-bell,
body.theme-mint .settings-card-label i.fa-bell,
body.theme-sakura .settings-card-label i.fa-bell,
body.theme-solar .settings-card-label i.fa-bell {
  color: #4f46e5; /* Slightly darker indigo for better light-theme contrast */
}
.settings-card-label i.fa-tags {
  color: #10b981;
}
body.theme-nordic .settings-card-label i.fa-tags,
body.theme-mint .settings-card-label i.fa-tags,
body.theme-sakura .settings-card-label i.fa-tags,
body.theme-solar .settings-card-label i.fa-tags {
  color: #059669; /* Slightly darker emerald for better light-theme contrast */
}

/* Weather pin icon: Golden glow on dark themes, high-contrast dark amber on light themes */
.settings-card-label i.fa-map-marker-alt {
  color: #fbbf24;
}
body.theme-nordic .settings-card-label i.fa-map-marker-alt,
body.theme-mint .settings-card-label i.fa-map-marker-alt,
body.theme-sakura .settings-card-label i.fa-map-marker-alt,
body.theme-solar .settings-card-label i.fa-map-marker-alt {
  color: #d97706; /* Dark rich amber */
}

/* Dynamically editable lists (family & flags) */
.settings-list-editor {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 250px;
  overflow-y: auto;
  padding-right: 4px;
  margin-bottom: 16px;
}

.settings-list-row {
  display: grid;
  grid-template-columns: 1fr 60px 50px 40px;
  gap: 10px;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
  padding: 8px 12px;
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-sm);
}

.btn-icon-delete {
  background: transparent;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-size: 1rem;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
  border-radius: 6px;
}

.btn-icon-delete:hover {
  background: rgba(239, 68, 68, 0.15);
}

.settings-notifications-info {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  border-radius: var(--border-radius-md);
  background: rgba(99, 102, 241, 0.05);
  border: 1px solid rgba(99, 102, 241, 0.15);
  text-align: center;
  align-items: center;
  margin-bottom: 16px;
}

/* ==========================================
   THEME COLOR PALETTES
   ========================================== */
body.theme-sunset {
  --bg-primary: #1c0d02;
  --bg-gradient: radial-gradient(circle at 0% 0%, #4c1d95 0%, #2e1065 40%, #7c2d12 80%, #0c0a09 100%);
  --bg-glow-purple: rgba(249, 115, 22, 0.15);
  --bg-glow-cyan: rgba(236, 72, 153, 0.12);
  --accent-color: #f97316;
  --accent-glow: rgba(249, 115, 22, 0.3);
}

body.theme-forest {
  --bg-primary: #051b15;
  --bg-gradient: radial-gradient(circle at 0% 0%, #064e3b 0%, #022c22 50%, #02110d 100%);
  --bg-glow-purple: rgba(16, 185, 129, 0.15);
  --bg-glow-cyan: rgba(6, 182, 212, 0.12);
  --accent-color: #10b981;
  --accent-glow: rgba(16, 185, 129, 0.3);
}

body.theme-ocean {
  --bg-primary: #020f1a;
  --bg-gradient: radial-gradient(circle at 0% 0%, #0f172a 0%, #075985 40%, #0c4a6e 70%, #020f1a 100%);
  --bg-glow-purple: rgba(6, 182, 212, 0.15);
  --bg-glow-cyan: rgba(29, 78, 216, 0.12);
  --accent-color: #06b6d4;
  --accent-glow: rgba(6, 182, 212, 0.3);
}

body.theme-lavender {
  --bg-primary: #0b071e;
  --bg-gradient: radial-gradient(circle at 0% 0%, #3b0764 0%, #1e1b4b 50%, #0b071e 100%);
  --bg-glow-purple: rgba(168, 85, 247, 0.15);
  --bg-glow-cyan: rgba(99, 102, 241, 0.12);
  --accent-color: #a855f7;
  --accent-glow: rgba(168, 85, 247, 0.3);
}

/* --- LIGHT THEME PRESETS --- */
body.theme-solar {
  --bg-primary: #fdfaf2;
  --bg-gradient: radial-gradient(circle at 0% 0%, #fffbeb 0%, #fef3c7 40%, #fde68a 80%, #f59e0b 100%);
  --bg-glow-purple: rgba(245, 158, 11, 0.2);
  --bg-glow-cyan: rgba(251, 191, 36, 0.15);
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-bg-hover: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(120, 53, 15, 0.12);
  --glass-shadow: 0 8px 32px 0 rgba(120, 53, 15, 0.08);
  --text-main: #000000;
  --text-muted: #000000;
  --text-dark: #000000;
  --accent-color: #d97706;
  --accent-glow: rgba(217, 119, 6, 0.2);
  --input-bg: rgba(255, 255, 255, 0.5);
  --overlay-bg: rgba(120, 53, 15, 0.03);
  --overlay-bg-hover: rgba(120, 53, 15, 0.07);
  --dropdown-bg: rgba(255, 255, 255, 0.98);
}

body.theme-nordic {
  --bg-primary: #f0f9ff;
  --bg-gradient: radial-gradient(circle at 0% 0%, #ffffff 0%, #f0f9ff 40%, #e0f2fe 80%, #bae6fd 100%);
  --bg-glow-purple: rgba(2, 132, 199, 0.2);
  --bg-glow-cyan: rgba(56, 189, 248, 0.15);
  --glass-bg: rgba(255, 255, 255, 0.75);
  --glass-bg-hover: rgba(255, 255, 255, 0.9);
  --glass-border: rgba(15, 23, 42, 0.1);
  --glass-shadow: 0 8px 32px 0 rgba(15, 23, 42, 0.06);
  --text-main: #000000;
  --text-muted: #000000;
  --text-dark: #000000;
  --accent-color: #0284c7;
  --accent-glow: rgba(2, 132, 199, 0.2);
  --input-bg: rgba(255, 255, 255, 0.55);
  --overlay-bg: rgba(15, 23, 42, 0.03);
  --overlay-bg-hover: rgba(15, 23, 42, 0.07);
  --dropdown-bg: rgba(255, 255, 255, 0.98);
}

body.theme-mint {
  --bg-primary: #f0fdf4;
  --bg-gradient: radial-gradient(circle at 0% 0%, #ffffff 0%, #f0fdf4 40%, #dcfce7 80%, #bbf7d0 100%);
  --bg-glow-purple: rgba(16, 185, 129, 0.2);
  --bg-glow-cyan: rgba(52, 211, 153, 0.15);
  --glass-bg: rgba(255, 255, 255, 0.75);
  --glass-bg-hover: rgba(255, 255, 255, 0.9);
  --glass-border: rgba(6, 78, 59, 0.1);
  --glass-shadow: 0 8px 32px 0 rgba(6, 78, 59, 0.06);
  --text-main: #000000;
  --text-muted: #000000;
  --text-dark: #000000;
  --accent-color: #059669;
  --accent-glow: rgba(5, 150, 105, 0.2);
  --input-bg: rgba(255, 255, 255, 0.55);
  --overlay-bg: rgba(6, 78, 59, 0.03);
  --overlay-bg-hover: rgba(6, 78, 59, 0.07);
  --dropdown-bg: rgba(255, 255, 255, 0.98);
}

body.theme-sakura {
  --bg-primary: #fff5f5;
  --bg-gradient: radial-gradient(circle at 0% 0%, #ffffff 0%, #fff5f5 40%, #ffe4e6 80%, #fecdd3 100%);
  --bg-glow-purple: rgba(219, 39, 119, 0.2);
  --bg-glow-cyan: rgba(244, 63, 94, 0.15);
  --glass-bg: rgba(255, 255, 255, 0.75);
  --glass-bg-hover: rgba(255, 255, 255, 0.9);
  --glass-border: rgba(76, 5, 25, 0.1);
  --glass-shadow: 0 8px 32px 0 rgba(76, 5, 25, 0.06);
  --text-main: #000000;
  --text-muted: #000000;
  --text-dark: #000000;
  --accent-color: #db2777;
  --accent-glow: rgba(219, 39, 119, 0.2);
  --input-bg: rgba(255, 255, 255, 0.55);
  --overlay-bg: rgba(76, 5, 25, 0.03);
  --overlay-bg-hover: rgba(76, 5, 25, 0.07);
  --dropdown-bg: rgba(255, 255, 255, 0.98);
}

/* Digital Clock Overrides for Light Themes */
body.theme-solar .digital-clock { background: linear-gradient(135deg, #78350f 0%, #b45309 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
body.theme-nordic .digital-clock { background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
body.theme-mint .digital-clock { background: linear-gradient(135deg, #064e3b 0%, #047857 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
body.theme-sakura .digital-clock { background: linear-gradient(135deg, #4c0519 0%, #be185d 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

/* Light Theme Outlines for Day Columns, Background Tracks, Timeline Rows, and Month Cells */
body.theme-solar .day-column,
body.theme-solar .day-column-track,
body.theme-solar .month-cell {
  border-color: rgba(120, 53, 15, 0.16) !important;
  background: rgba(120, 53, 15, 0.015) !important;
}
body.theme-solar .day-column:hover,
body.theme-solar .day-column-track:hover,
body.theme-solar .month-cell:hover {
  border-color: rgba(120, 53, 15, 0.25) !important;
  background: rgba(120, 53, 15, 0.03) !important;
}
body.theme-solar .timeline-hour-row,
body.theme-solar .month-weekday-header {
  border-bottom-color: rgba(120, 53, 15, 0.12) !important;
}

body.theme-nordic .day-column,
body.theme-nordic .day-column-track,
body.theme-nordic .month-cell {
  border-color: rgba(15, 23, 42, 0.14) !important;
  background: rgba(15, 23, 42, 0.015) !important;
}
body.theme-nordic .day-column:hover,
body.theme-nordic .day-column-track:hover,
body.theme-nordic .month-cell:hover {
  border-color: rgba(15, 23, 42, 0.22) !important;
  background: rgba(15, 23, 42, 0.03) !important;
}
body.theme-nordic .timeline-hour-row,
body.theme-nordic .month-weekday-header {
  border-bottom-color: rgba(15, 23, 42, 0.1) !important;
}

body.theme-mint .day-column,
body.theme-mint .day-column-track,
body.theme-mint .month-cell {
  border-color: rgba(6, 78, 59, 0.14) !important;
  background: rgba(6, 78, 59, 0.015) !important;
}
body.theme-mint .day-column:hover,
body.theme-mint .day-column-track:hover,
body.theme-mint .month-cell:hover {
  border-color: rgba(6, 78, 59, 0.22) !important;
  background: rgba(6, 78, 59, 0.03) !important;
}
body.theme-mint .timeline-hour-row,
body.theme-mint .month-weekday-header {
  border-bottom-color: rgba(6, 78, 59, 0.1) !important;
}

body.theme-sakura .day-column,
body.theme-sakura .day-column-track,
body.theme-sakura .month-cell {
  border-color: rgba(76, 5, 25, 0.14) !important;
  background: rgba(76, 5, 25, 0.015) !important;
}
body.theme-sakura .day-column:hover,
body.theme-sakura .day-column-track:hover,
body.theme-sakura .month-cell:hover {
  border-color: rgba(76, 5, 25, 0.22) !important;
  background: rgba(76, 5, 25, 0.03) !important;
}
body.theme-sakura .timeline-hour-row,
body.theme-sakura .month-weekday-header {
  border-bottom-color: rgba(76, 5, 25, 0.1) !important;
}

/* Interactive Drag & Drop Visual Styles */
.event-card.draggable-active {
  cursor: grab;
  user-select: none;
}
.event-card.dragging {
  opacity: 0.55 !important;
  transform: scale(1.04) rotate(1deg) !important;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.28) !important;
  cursor: grabbing;
  z-index: 9999 !important;
}
.day-column-track.drag-hover,
.day-column.drag-hover {
  background: rgba(99, 102, 241, 0.08) !important;
  border-color: var(--accent-color) !important;
  box-shadow: inset 0 0 12px rgba(99, 102, 241, 0.15) !important;
}

/* ==========================================
   CSS GRID-SPANNING WEEK VIEW SYSTEM
   ========================================== */
.week-view-container {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 500px;
}

.week-bg-tracks {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 14px;
  pointer-events: none;
  z-index: 1;
}

.day-column-track {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: var(--border-radius-md);
  height: 100%;
  pointer-events: auto; /* Allow tracks to catch drop events */
  transition: var(--transition-smooth);
}

.day-column-track.is-today {
  background: rgba(99, 102, 241, 0.04);
  border-color: rgba(99, 102, 241, 0.25);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.1);
}

.week-grid-content {
  position: relative;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: max-content;
  row-gap: 12px;
  column-gap: 14px;
  padding: 12px 0;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

.week-grid-content > * {
  pointer-events: auto;
}

.week-no-events {
  grid-column: 1 / 8;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-dark);
  padding: 60px 0;
  font-style: italic;
}

/* Theme Selector Grid */
.theme-selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.theme-option {
  position: relative;
  cursor: pointer;
}

.theme-option input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.theme-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: var(--border-radius-md);
  background: var(--overlay-bg);
  border: 1px solid var(--glass-border);
  transition: var(--transition-smooth);
  text-align: center;
  height: 100%;
}

.theme-preview-color {
  width: 100%;
  height: 60px;
  border-radius: var(--border-radius-sm);
}

.theme-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.theme-option input:checked + .theme-card {
  background: var(--overlay-bg-hover);
  border-color: white;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.15);
}

.theme-option input:checked + .theme-card .theme-label {
  color: var(--text-main);
}

/* ==========================================================================
   BLUE LIGHT NIGHT SHIFT FILTER
   ========================================================================== */
body.night-shift-active {
  filter: sepia(0.35) saturate(0.9) hue-rotate(-3deg);
  transition: filter 1.2s ease-in-out;
}

/* ==========================================================================
   SCREENSAVER FULL-SCREEN CLOCK OVERLAYS
   ========================================================================== */
.screensaver-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at center, #0b1120 0%, #030712 100%);
  z-index: 999999;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
  color: white;
  text-align: center;
}

.screensaver-overlay.active {
  opacity: 1;
}

.screensaver-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.ss-time {
  font-size: 8rem;
  font-weight: 800;
  font-family: var(--font-heading);
  letter-spacing: -2px;
  background: linear-gradient(135deg, #ffffff 40%, rgba(255,255,255,0.4) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 20px rgba(255,255,255,0.15));
  animation: pulseGlow 4s infinite alternate;
}

.ss-date, .ss-analog-date {
  font-size: 1.8rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.5px;
}

.ss-tap-dismiss {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.3);
  margin-top: 40px;
  text-transform: uppercase;
  letter-spacing: 2px;
  animation: blinkOpacity 2s infinite ease-in-out;
}

/* Analog Screensaver Clock face styling */
.analog-clock-face {
  width: 280px;
  height: 280px;
  border-radius: 50%;
  border: 6px solid rgba(255, 255, 255, 0.15);
  position: relative;
  background: rgba(255, 255, 255, 0.02);
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.4), inset 0 0 30px rgba(255, 255, 255, 0.03);
  margin: 0 auto 10px auto;
}

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

.hour-hand {
  width: 8px;
  height: 70px;
  background: white;
  margin-left: -4px;
  z-index: 3;
}

.minute-hand {
  width: 5px;
  height: 100px;
  background: rgba(255, 255, 255, 0.7);
  margin-left: -2.5px;
  z-index: 2;
}

.second-hand {
  width: 2px;
  height: 110px;
  background: var(--accent-color, #ec4899);
  margin-left: -1px;
  z-index: 1;
}

.analog-center {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-color, #ec4899);
  position: absolute;
  top: 50%;
  left: 50%;
  margin-top: -7px;
  margin-left: -7px;
  z-index: 4;
  border: 2px solid white;
}

/* Add hour ticks inside clock face */
.analog-clock-face::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255,255,255,0.25) 0deg 1deg, transparent 1deg 30deg);
  -webkit-mask: radial-gradient(circle, transparent 90%, black 90%);
  mask: radial-gradient(circle, transparent 90%, black 90%);
}

@keyframes pulseGlow {
  0% { filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.05)); }
  100% { filter: drop-shadow(0 0 25px rgba(255, 255, 255, 0.2)); }
}

@keyframes blinkOpacity {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.8; }
}

/* ==========================================
   PHASE 6: QUALITY OF LIFE FEATURES STYLES
   ========================================== */

/* 1. Title Auto-Suggestions Chips */
.title-suggestions {
  display: flex;
  gap: 8px;
  padding: 6px 4px;
  overflow-x: auto;
  width: 100%;
  scrollbar-width: none;
  margin-top: 6px;
}
.title-suggestions::-webkit-scrollbar {
  display: none;
}
.suggestion-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-smooth);
}
.suggestion-chip:hover {
  background: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
  box-shadow: 0 0 8px var(--accent-glow);
  transform: translateY(-1px);
}
/* For light themes make suggestions highly visible */
body.theme-solar .suggestion-chip,
body.theme-nordic .suggestion-chip,
body.theme-mint .suggestion-chip,
body.theme-sakura .suggestion-chip {
  background: rgba(0, 0, 0, 0.04);
  color: #000000;
  border-color: rgba(0, 0, 0, 0.1);
}
body.theme-solar .suggestion-chip:hover,
body.theme-nordic .suggestion-chip:hover,
body.theme-mint .suggestion-chip:hover,
body.theme-sakura .suggestion-chip:hover {
  background: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
}

/* 2. Live Countdown Badges */
.countdown-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.68rem;
  font-weight: 700;
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
  margin-top: 4px;
  width: fit-content;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.08);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.countdown-badge.leaving-soon {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.25);
  animation: pulse-countdown 1.5s infinite alternate;
}
.countdown-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: currentColor;
}
@keyframes pulse-countdown {
  0% { opacity: 0.65; }
  100% { opacity: 1; }
}
/* Light theme accessibility text overrides */
body.theme-solar .countdown-badge,
body.theme-nordic .countdown-badge,
body.theme-mint .countdown-badge,
body.theme-sakura .countdown-badge {
  background: rgba(239, 68, 68, 0.08);
  color: #b91c1c;
  border-color: rgba(239, 68, 68, 0.2);
}
body.theme-solar .countdown-badge.leaving-soon,
body.theme-nordic .countdown-badge.leaving-soon,
body.theme-mint .countdown-badge.leaving-soon,
body.theme-sakura .countdown-badge.leaving-soon {
  background: rgba(217, 119, 6, 0.1);
  color: #b45309;
  border-color: rgba(217, 119, 6, 0.2);
}

/* 3. Multi-Day Progress Indicator */
.multi-day-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  width: fit-content;
  margin-top: 4px;
}
body.theme-solar .multi-day-badge,
body.theme-nordic .multi-day-badge,
body.theme-mint .multi-day-badge,
body.theme-sakura .multi-day-badge {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
  color: #000000;
}
.multi-day-progress-bar {
  display: flex;
  gap: 3px;
  margin-top: 6px;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
}
body.theme-solar .multi-day-progress-bar,
body.theme-nordic .multi-day-progress-bar,
body.theme-mint .multi-day-progress-bar,
body.theme-sakura .multi-day-progress-bar {
  background: rgba(0, 0, 0, 0.06);
}
.multi-day-progress-fill {
  height: 100%;
  border-radius: 2px;
}

/* 4. Weather Details & 5-Day Forecast Grid */
.weather-forecast-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-top: 12px;
}
@media (max-width: 580px) {
  .weather-forecast-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
  }
  .weather-forecast-card {
    padding: 8px 2px !important;
    gap: 4px !important;
  }
  .wf-day {
    font-size: 0.6rem !important;
  }
  .wf-icon {
    font-size: 1.1rem !important;
    margin: 2px 0 !important;
  }
  .wf-temp-range {
    font-size: 0.65rem !important;
  }
  .wf-precip {
    font-size: 0.55rem !important;
  }
}
.weather-forecast-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-sm);
  text-align: center;
  transition: var(--transition-smooth);
}
body.theme-solar .weather-forecast-card,
body.theme-nordic .weather-forecast-card,
body.theme-mint .weather-forecast-card,
body.theme-sakura .weather-forecast-card {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.06);
}
.weather-forecast-card:hover {
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.15);
}
body.theme-solar .weather-forecast-card:hover,
body.theme-nordic .weather-forecast-card:hover,
body.theme-mint .weather-forecast-card:hover,
body.theme-sakura .weather-forecast-card:hover {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.12);
}
.wf-day {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.wf-icon {
  font-size: 1.8rem;
  margin: 4px 0;
}
.wf-temp-range {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main);
}
.wf-precip {
  font-size: 0.65rem;
  color: #3b82f6;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 2px;
}

/* 5. Burn-in Protection Shifts */
.screensaver-content {
  transition: transform 8s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

/* --- High-Density Responsive Height Adjustments for Hallway Kiosk Tablets --- */
@media (min-width: 1024px) and (max-height: 800px) {
  .app-container {
    padding: 16px;
    gap: 16px;
  }
  .sidebar {
    gap: 16px;
  }
  .glass-panel {
    padding: 16px;
  }
  .brand-panel {
    padding: 12px 16px;
  }
  .brand-img-emblem {
    width: 60px;
    height: 60px;
  }
  .brand-title {
    font-size: 1.55rem;
  }
  .clock-panel {
    padding: 16px;
  }
  .digital-clock {
    font-size: 2.6rem;
  }
  .calendar-date {
    font-size: 0.85rem;
    margin-bottom: 4px;
  }
  .greeting-text {
    font-size: 0.78rem;
  }
  .btn {
    padding: 10px 16px;
    font-size: 0.9rem;
  }
  .family-filter-container {
    padding: 10px 16px !important;
  }
}

/* --- Mobile DWA Form Sizing & Badge Grid Overlaps Rectifications --- */
@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  
  .form-row > .form-group {
    min-width: 0 !important;
    margin-bottom: 14px !important;
  }

  /* Force absolute box-sizing and full-width stretching for form inputs to prevent page clipping */
  .form-input,
  input[type="date"].form-input,
  input[type="time"].form-input {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    min-height: 46px;
    display: block;
  }

  /* Stack modal buttons vertically for clear, tap-friendly layout on narrow screens */
  .modal-actions {
    flex-direction: column-reverse !important;
    width: 100% !important;
    gap: 10px !important;
  }
  
  .modal-actions .btn {
    width: 100% !important;
    justify-content: center !important;
    padding: 12px !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
  }
}

@media (max-width: 480px) {
  .assignee-grid,
  .flag-picker-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  .assignee-checkbox-label,
  .flag-badge {
    padding: 8px !important;
    font-size: 0.78rem !important;
  }
}

/* --- Theme-Consistent Family dropdown presets for light themes --- */
body.theme-solar .family-member-row,
body.theme-nordic .family-member-row,
body.theme-mint .family-member-row,
body.theme-sakura .family-member-row {
  background: rgba(0, 0, 0, 0.02) !important;
  border-color: var(--glass-border) !important;
}

body.theme-solar .family-member-row:hover,
body.theme-nordic .family-member-row:hover,
body.theme-mint .family-member-row:hover,
body.theme-sakura .family-member-row:hover {
  background: rgba(0, 0, 0, 0.05) !important;
}

body.theme-solar .family-member-row.active,
body.theme-nordic .family-member-row.active,
body.theme-mint .family-member-row.active,
body.theme-sakura .family-member-row.active {
  background: rgba(0, 0, 0, 0.06) !important;
  border-color: var(--accent-color) !important;
  box-shadow: 0 0 8px var(--accent-glow) !important;
}

/* --- Block Webpage Scrollbars (Eliminate light colored vertical bar) --- */
@media (max-width: 1023px) {
  .calendar-view-container {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    padding-bottom: 100px !important; /* Ensure last elements (like Sunday) clear the fixed bottom nav bar */
  }
  .calendar-view-container::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
  }
}

/* --- Butter-Smooth DWA Swipe Slide-In Transitions --- */
@keyframes slide-in-right {
  0% {
    transform: translateX(30px);
    opacity: 0.7;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slide-in-left {
  0% {
    transform: translateX(-30px);
    opacity: 0.7;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

.swipe-transition-right {
  animation: slide-in-right 0.28s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.swipe-transition-left {
  animation: slide-in-left 0.28s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

/* Ensure absolute scrollbar suppression on any element undergoing active swipe animation */
.swipe-transition-right::-webkit-scrollbar,
.swipe-transition-left::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.swipe-transition-right,
.swipe-transition-left {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

/* ==========================================================================
   KIOSK & DWA AUTHENTICATION PORTAL PREMIUM CUSTOM STYLES
   ========================================================================== */
#authModal .modal-content {
  background: rgba(15, 23, 42, 0.95) !important; /* Premium ultra-dark slate */
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.65) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
}

/* Compatibility with light themes (Nordic, Solar, Sakura, Mint) */
body.theme-nordic #authModal .modal-content,
body.theme-solar #authModal .modal-content,
body.theme-mint #authModal .modal-content,
body.theme-sakura #authModal .modal-content {
  background: rgba(240, 246, 252, 0.96) !important; /* Premium light slate */
  border: 1px solid rgba(15, 23, 42, 0.12) !important;
  box-shadow: 0 25px 50px rgba(15, 23, 42, 0.22) !important;
}

body.theme-nordic #authModal h2,
body.theme-solar #authModal h2,
body.theme-mint #authModal h2,
body.theme-sakura #authModal h2 {
  color: #0f172a !important;
}

body.theme-nordic #authModal p,
body.theme-solar #authModal p,
body.theme-mint #authModal p,
body.theme-sakura #authModal p {
  color: #475569 !important;
}

body.theme-nordic #authModal .form-label,
body.theme-solar #authModal .form-label,
body.theme-mint #authModal .form-label,
body.theme-sakura #authModal .form-label {
  color: #0f172a !important;
}

body.theme-nordic #authModal .form-input,
body.theme-solar #authModal .form-input,
body.theme-mint #authModal .form-input,
body.theme-sakura #authModal .form-input {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1.5px solid rgba(15, 23, 42, 0.15) !important;
}

body.theme-nordic #authModal #authToggleText,
body.theme-solar #authModal #authToggleText,
body.theme-mint #authModal #authToggleText,
body.theme-sakura #authModal #authToggleText {
  color: #475569 !important;
}

/* General premium style overlays */
#authModal .form-input {
  transition: all 0.25s ease;
  border-radius: 8px !important;
}

#authModal .form-input:focus {
  border-color: #6366f1 !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2) !important;
  transform: translateY(-1px);
}

#authModal .btn-primary {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

#authModal .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

#authModal .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05) !important;
}

body.theme-nordic #authModal .btn-secondary:hover,
body.theme-solar #authModal .btn-secondary:hover,
body.theme-mint #authModal .btn-secondary:hover,
body.theme-sakura #authModal .btn-secondary:hover {
  background: rgba(15, 23, 42, 0.05) !important;
}

/* Dynamic theme-consistent Password Visibility eye toggle icon styling */
#btnTogglePasswordVisibility {
  color: var(--text-muted) !important;
  transition: var(--transition-smooth);
}

#btnTogglePasswordVisibility:hover {
  color: var(--text-main) !important;
}

/* --- Tactile Paper Texture Setting Overlay --- */
.paper-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-image: url("paper_texture.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: 9999;
}

/* Default / Dark Themes: elegant subtle overlay blending */
body.paper-enabled .paper-overlay {
  display: block;
  mix-blend-mode: overlay;
  opacity: 0.20; /* Soft, natural paper creases on dark themes without whitewashing */
}

/* Light Themes: multiply blending for authentic paper color and shadow */
body.theme-solar.paper-enabled .paper-overlay,
body.theme-nordic.paper-enabled .paper-overlay,
body.theme-mint.paper-enabled .paper-overlay,
body.theme-sakura.paper-enabled .paper-overlay {
  display: block;
  mix-blend-mode: multiply;
  opacity: 0.45; /* Crisp watercolor paper look on light themes */
}

/* ==========================================
   AI EVENT SCANNER AND SEGMENTED CONTROL
   ========================================== */

/* Segmented Control for Event Input Mode */
.segmented-control {
  display: flex;
  background: rgba(15, 23, 42, 0.05);
  border-radius: var(--border-radius-md, 8px);
  padding: 4px;
  border: 1px solid rgba(15, 23, 42, 0.08);
}
body.theme-nordic .segmented-control {
  background: rgba(15, 23, 42, 0.04);
  border-color: rgba(15, 23, 42, 0.06);
}
.segmented-btn {
  flex: 1;
  background: none;
  border: none;
  padding: 8px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted, #94a3b8);
  cursor: pointer;
  border-radius: calc(var(--border-radius-md, 8px) - 2px);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.segmented-btn.active {
  background: var(--card-bg, #ffffff);
  color: var(--accent-color, #6366f1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* AI Scanning Loading Overlay */
.ai-scanning-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.ai-scanning-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.ai-scanning-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 32px;
  border-radius: var(--border-radius-lg, 12px);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}
.ai-scanning-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(168, 85, 247, 0.2);
  border-top-color: #a855f7;
  border-radius: 50%;
  animation: ai-spin 1s linear infinite;
}
@keyframes ai-spin {
  to { transform: rotate(360deg); }
}

/* Custom icon contrast overrides */
.settings-card-label i.fa-magic {
  color: #a855f7;
}
body.theme-nordic .settings-card-label i.fa-magic,
body.theme-mint .settings-card-label i.fa-magic,
body.theme-sakura .settings-card-label i.fa-magic,
body.theme-solar .settings-card-label i.fa-magic {
  color: #7c3aed;
}

/* Password eye button styling */
.btn-toggle-password {
  opacity: 0.6;
  transition: opacity 0.2s ease;
}
.btn-toggle-password:hover {
  opacity: 1;
}
