/* ==========================================
   0. DESIGN SYSTEM & DESIGN TOKENS
   ========================================== */

:root {
  /* Color Palette (Deep Slate & Vibrant Emerald) */
  --bg-main: #0a0c10;
  --bg-card: rgba(18, 22, 28, 0.65);
  --bg-card-hover: rgba(25, 30, 38, 0.8);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-color-hover: rgba(255, 255, 255, 0.16);
  
  --primary: #10b981; /* Emerald Green */
  --primary-hover: #059669;
  --primary-glow: rgba(16, 185, 129, 0.25);
  
  --accent: #3b82f6; /* Electric Blue */
  --accent-glow: rgba(59, 130, 246, 0.25);
  
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-inverse: #0a0c10;
  
  --discord-purple: #5865f2;
  --discord-purple-hover: #4752c4;
  
  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.2);
  
  /* Fonts & Shadows */
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  --shadow-soft: 0 4px 30px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 20px rgba(16, 185, 129, 0.15);
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  
  --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================
   1. RESET & BASE LAYOUTS
   ========================================== */

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

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  padding-bottom: 60px; /* footer offset */
}

/* Ambient glow blobs */
.ambient-glow {
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  filter: blur(140px);
  z-index: -1;
  opacity: 0.15;
  pointer-events: none;
  animation: float-glow 20s infinite ease-in-out alternate;
}

.glow-1 {
  background: var(--primary);
  top: -100px;
  right: -50px;
}

.glow-2 {
  background: var(--accent);
  bottom: 10%;
  left: -150px;
  animation-delay: -5s;
}

@keyframes float-glow {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(60px, 40px) scale(1.15); }
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* ==========================================
   2. HEADER & LOGO
   ========================================== */

header {
  border-bottom: 1px solid var(--border-color);
  background: rgba(10, 12, 16, 0.8);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.25rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  cursor: default;
}

.brand-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.2);
  transition: var(--transition-smooth);
}

.logo-group:hover .brand-logo {
  transform: scale(1.08) rotate(3deg);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
}

.logo-text h1 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  line-height: 1.1;
  background: linear-gradient(to right, #ffffff, #d1d5db);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-subtitle {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--primary);
  display: block;
}

.status-panel {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  padding: 0.4rem 0.85rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  box-shadow: var(--shadow-glow);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--primary);
  display: inline-block;
}

.pulsing {
  animation: beacon 2s infinite ease-in-out;
}

@keyframes beacon {
  0% { transform: scale(0.9); opacity: 0.6; }
  50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 10px var(--primary); }
  100% { transform: scale(0.9); opacity: 0.6; }
}

/* ==========================================
   3. BUTTONS & ACTIONS
   ========================================== */

.btn {
  font-family: var(--font-heading);
  font-weight: 600;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-size: 0.875rem;
  transition: var(--transition-smooth);
}

.btn-primary {
  background-color: var(--primary);
  color: var(--text-inverse);
  box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
}

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

.btn-discord {
  background-color: var(--discord-purple);
  color: var(--text-main);
  box-shadow: 0 4px 14px rgba(88, 101, 242, 0.25);
}

.btn-discord:hover {
  background-color: var(--discord-purple-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(88, 101, 242, 0.35);
}

.btn-block {
  width: 100%;
  padding: 0.85rem;
}

.user-profile-pill {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 0.35rem 0.85rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: var(--transition-smooth);
}

.user-profile-pill:hover {
  border-color: var(--border-color-hover);
  background: rgba(255, 255, 255, 0.08);
}

.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--primary);
}

.btn-logout {
  background: transparent;
  color: var(--text-muted);
  border: none;
  font-size: 0.8rem;
  cursor: pointer;
  margin-left: 0.5rem;
  transition: var(--transition-smooth);
}

.btn-logout:hover {
  color: var(--danger);
}

/* ==========================================
   4. LAYOUTS & CARDS (GLASSMORPHISM)
   ========================================== */

.app-layout {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 460px 1fr;
  gap: 2rem;
  align-items: start;
}

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

/* Premium Glassmorphic Cards */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 2rem;
  box-shadow: var(--shadow-soft);
  transition: var(--transition-smooth);
}

.card:hover {
  border-color: var(--border-color-hover);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
}

.card-title-icon {
  background: rgba(255, 255, 255, 0.05);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--primary);
  border: 1px solid var(--border-color);
}

.card-header h2 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: 0.3px;
}

/* ==========================================
   5. DYNAMIC FORM COMPONENTS & SLIDERS
   ========================================== */

.form-group {
  margin-bottom: 1.75rem;
}

.form-label {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.label-help {
  font-size: 0.75rem;
  color: var(--accent);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.label-help:hover {
  text-decoration: underline;
  color: #60a5fa;
}

/* Dynamic Interactive Chips */
.course-chips, .day-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.55rem 0.9rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.chip:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--border-color-hover);
  color: var(--text-main);
}

.chip.active {
  background: rgba(16, 185, 129, 0.12);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.1);
  font-weight: 600;
}

.chip-day {
  padding: 0.55rem 0.75rem;
  text-align: center;
  min-width: 44px;
  justify-content: center;
}

.chip-day.active {
  background: rgba(59, 130, 246, 0.12);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.1);
}

/* Premium Time Slider styling */
.range-value {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
}

.slider-container {
  position: relative;
  height: 40px;
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
}

.slider-track-bg {
  position: absolute;
  height: 6px;
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  pointer-events: none;
}

.slider-track-highlight {
  position: absolute;
  height: 6px;
  background: linear-gradient(to right, var(--primary), var(--accent));
  border-radius: 3px;
  pointer-events: none;
}

.slider-handle {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  background: transparent;
  position: absolute;
  pointer-events: none;
  outline: none;
}

.slider-handle::-webkit-slider-thumb {
  -webkit-appearance: none;
  pointer-events: auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text-main);
  border: 3px solid var(--primary);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  transition: transform 0.1s ease;
}

.slider-handle::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  background: var(--primary);
}

.slider-handle::-moz-range-thumb {
  pointer-events: auto;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text-main);
  border: 3px solid var(--primary);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Premium Segmented control styling */
.players-toggle {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  padding: 4px;
  border-radius: var(--radius-sm);
}

.hidden-radio {
  display: none;
}

.toggle-option {
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.65rem 0.25rem;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-smooth);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.toggle-option:hover {
  color: var(--text-main);
}

.hidden-radio:checked + .toggle-option {
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Optional checked states with color accents */
#players-4:checked + .toggle-option {
  background-color: var(--primary);
  color: var(--text-inverse);
  box-shadow: 0 2px 8px var(--primary-glow);
}

/* Input Fields */
.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 1.1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  pointer-events: none;
}

input[type="text"] {
  width: 100%;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  padding: 0.85rem 1.1rem 0.85rem 2.6rem;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: var(--transition-smooth);
}

input[type="text"]:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(0, 0, 0, 0.3);
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.1);
}

/* ==========================================
   6. BANNERS & NOTIFICATIONS
   ========================================== */

.banner {
  background: rgba(59, 130, 246, 0.06);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1.25rem;
  margin-bottom: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.05);
  animation: slide-down 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slide-down {
  from { transform: translateY(-10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.banner-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #93c5fd;
}

.banner-content strong {
  color: #ffffff;
}

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

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

.banner-close:active {
  transform: scale(0.9);
}

/* ==========================================
   7. DASHBOARD LIST & GRID CARDS
   ========================================== */

.rules-container {
  min-height: 300px;
}

.no-rules {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 350px;
  color: var(--text-muted);
  gap: 1rem;
}

.no-rules i {
  font-size: 3rem;
  color: rgba(255, 255, 255, 0.05);
}

.no-rules h3 {
  font-family: var(--font-heading);
  color: var(--text-main);
  font-size: 1.15rem;
}

.no-rules p {
  font-size: 0.85rem;
  max-width: 320px;
}

.rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

/* Glassmorphic Grid Cards for Alert Rules */
.rule-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: var(--transition-smooth);
}

.rule-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-color-hover);
  transform: translateY(-2px);
}

.rule-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.rule-course-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.rule-delete-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 4px;
  border-radius: 4px;
  transition: var(--transition-smooth);
}

.rule-delete-btn:hover {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.08);
}

.rule-details {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.rule-detail-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.rule-detail-item i {
  width: 14px;
  text-align: center;
  color: var(--primary);
  font-size: 0.75rem;
}

.rule-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
  border-top: 1px solid var(--border-color);
  padding-top: 0.75rem;
  font-size: 0.7rem;
}

.rule-owner {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.rule-badge {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
  color: var(--accent);
  padding: 0.2rem 0.5rem;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.65rem;
}

/* ==========================================
   8. MODALS & DIALOGS
   ========================================== */

.modal {
  display: none; /* hidden by default */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
  animation: fade-in 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: rgba(18, 22, 28, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  max-width: 520px;
  width: 90%;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  animation: zoom-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes zoom-in {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.modal-header h3 i {
  color: var(--discord-purple);
}

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

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

.modal-body {
  padding: 1.5rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.help-steps {
  margin-top: 1rem;
  padding-left: 1.25rem;
}

.help-steps li {
  margin-bottom: 1.25rem;
}

.help-steps strong {
  color: var(--text-main);
  display: block;
  margin-bottom: 0.25rem;
}

/* ==========================================
   9. FOOTER
   ========================================== */

footer {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  background: rgba(10, 12, 16, 0.9);
}

.footer-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  width: 100%;
}

.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  min-height: 350px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.loading-spinner i {
  color: var(--primary);
  font-size: 1.2rem;
}

.hidden {
  display: none !important;
}

/* ==========================================
   10. PREMIUM TEE-TIME INSIGHTS & TABS
   ========================================== */

/* Tab Switching System */
.nav-tabs {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
  position: relative;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition-smooth);
  position: relative;
}

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

.tab-btn.active {
  color: var(--primary);
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.15);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.05);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -0.85rem;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--primary);
  box-shadow: 0 0 8px var(--primary);
  border-radius: 2px;
}

/* Tab Content Visibility */
.tab-content {
  transition: opacity 0.3s ease;
}

.tab-content.hidden {
  display: none !important;
}

/* Insights Dashboard Container */
.insights-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  animation: fade-in 0.3s ease-out;
}

/* Stat Cards Row */
.insights-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

@media (max-width: 1024px) {
  .insights-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .insights-stats-grid {
    grid-template-columns: 1fr;
  }
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  box-shadow: var(--shadow-soft);
  transition: var(--transition-smooth);
}

.stat-card:hover {
  border-color: var(--border-color-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.stat-icon {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--primary);
  box-shadow: var(--shadow-glow);
  flex-shrink: 0;
}

/* Alternate glow for some icons to make the UI pop */
.insights-stats-grid .stat-card:nth-child(2) .stat-icon {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.2);
  color: var(--accent);
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.1);
}

.stat-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  overflow: hidden;
}

.stat-info h3 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.stat-info p {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.stat-info span {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.4);
}

/* Charts Grid */
.insights-charts-grid, .insights-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

@media (max-width: 1024px) {
  .insights-charts-grid, .insights-detail-grid {
    grid-template-columns: 1fr;
  }
}

.chart-card {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.chart-wrapper {
  position: relative;
  width: 100%;
  min-height: 280px;
  flex-grow: 1;
  margin-top: 1rem;
}

/* Lead Time Notice Custom Components */
.lead-time-indicators {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 1rem;
}

.lead-indicator {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.lead-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.lead-label span:nth-child(2) {
  color: var(--primary);
  font-family: var(--font-heading);
}

.progress-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.02);
}

.progress {
  height: 100%;
  border-radius: 10px;
  background: linear-gradient(to right, var(--primary), var(--accent));
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.25);
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
}

/* Insights Header & Date Range Display */
.insights-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.insights-header-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.insights-header h2 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-main);
  background: linear-gradient(135deg, #ffffff 40%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0;
}

.insights-header .subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

.insights-header .subtitle span {
  color: var(--primary);
  font-weight: 600;
  font-family: var(--font-heading);
}

.insights-badge .badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.15);
  color: var(--primary);
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

@media (max-width: 768px) {
  .insights-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.25rem;
  }
}

/* ==========================================
   10. GLOBAL SETTINGS PANEL & SWITCHES
   ========================================== */

.global-settings-panel {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: var(--transition-smooth);
}

.global-settings-panel:hover {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.global-settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
}

.settings-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-main);
}

.settings-title i {
  color: var(--primary);
  font-size: 1.1rem;
}

.settings-title h3 {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
}

/* Premium IOS-Style Toggle Switch */
.switch-container {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  position: relative;
  user-select: none;
}

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

.switch-container input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.switch-slider {
  width: 44px;
  height: 24px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 30px;
  position: relative;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.switch-slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 2px;
  bottom: 2px;
  background-color: #ffffff;
  border-radius: 50%;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
}

.switch-container input:checked + .switch-slider {
  background-color: var(--primary);
  border-color: var(--primary-glow);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.switch-container input:checked + .switch-slider::before {
  transform: translateX(20px);
}

/* Deactivated state for global mute */
.global-settings-body.muted {
  opacity: 0.45;
  pointer-events: none;
}

/* Schedule Inputs Styling */
.schedule-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 600px) {
  .schedule-inputs {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

.schedule-select-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.schedule-select-group label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
}

/* Premium Select Box */
.select-premium {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.select-premium:focus {
  border-color: var(--primary);
  background: rgba(0, 0, 0, 0.35);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.08);
}

.settings-save-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px dashed rgba(255, 255, 255, 0.06);
  padding-top: 1rem;
}

.settings-timezone {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.settings-timezone i {
  color: var(--accent);
}

.settings-saved-feedback {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: fade-in 0.3s ease;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Rule Card Compact Switches & Dimming */
.rule-card-switch {
  display: flex;
  align-items: center;
}

.rule-card-switch .switch-slider {
  width: 38px;
  height: 20px;
}

.rule-card-switch .switch-slider::before {
  width: 14px;
  height: 14px;
  left: 2px;
  bottom: 2px;
}

.rule-card-switch input:checked + .switch-slider::before {
  transform: translateX(18px);
}

.switch-text {
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 0.25rem;
  width: 42px;
}

.rule-card-switch input:checked ~ .switch-text {
  color: var(--primary);
}

.rule-card-switch input:not(:checked) ~ .switch-text {
  color: var(--text-muted);
}

/* Dimmed Inactive Card Mode */
.rule-card.inactive {
  opacity: 0.55;
  filter: grayscale(25%);
  border-color: rgba(255, 255, 255, 0.04);
  background: rgba(255, 255, 255, 0.005);
}

.rule-card.inactive:hover {
  opacity: 0.75;
  border-color: rgba(255, 255, 255, 0.08);
}

.rule-card.inactive .rule-course-title {
  color: var(--text-muted);
}

.rule-card.inactive .rule-detail-item i {
  color: var(--text-muted);
}

