/* style.css */

/* ==========================================================================
   1. Multi-Theme Definitions (Dual-Color Light Schemes)
   ========================================================================== */

/* Theme 1: Indigo & Rose (Default) */
:root,
[data-theme="indigo-rose"] {
  --theme-primary: #4f46e5;
  --theme-primary-hover: #4338ca;
  --theme-primary-subtle: #eef2ff;
  --theme-primary-border: #c7d2fe;

  --theme-secondary: #f43f5e;
  --theme-secondary-hover: #e11d48;
  --theme-secondary-subtle: #ffe4e6;
  --theme-secondary-border: #fecdd3;
}

/* Theme 2: Ocean Blue & Emerald */
[data-theme="ocean-emerald"] {
  --theme-primary: #0284c7;
  --theme-primary-hover: #0369a1;
  --theme-primary-subtle: #e0f2fe;
  --theme-primary-border: #bae6fd;

  --theme-secondary: #10b981;
  --theme-secondary-hover: #059669;
  --theme-secondary-subtle: #d1fae5;
  --theme-secondary-border: #a7f3d0;
}

/* Theme 3: Teal & Amber */
[data-theme="teal-amber"] {
  --theme-primary: #0d9488;
  --theme-primary-hover: #0f766e;
  --theme-primary-subtle: #ccfbf1;
  --theme-primary-border: #99f6e4;

  --theme-secondary: #f59e0b;
  --theme-secondary-hover: #d97706;
  --theme-secondary-subtle: #fef3c7;
  --theme-secondary-border: #fde68a;
}

/* Theme 4: Violet & Coral */
[data-theme="violet-coral"] {
  --theme-primary: #7c3aed;
  --theme-primary-hover: #6d28d9;
  --theme-primary-subtle: #f3e8ff;
  --theme-primary-border: #ddd6fe;

  --theme-secondary: #f97316;
  --theme-secondary-hover: #ea580c;
  --theme-secondary-subtle: #ffedd5;
  --theme-secondary-border: #fed7aa;
}

/* Base Canvas & Typography Variables */
:root {
  --bg-main: #f8fafc;
  --card-bg: #ffffff;
  --border-subtle: #e2e8f0;
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --sidebar-width: 260px;

  /* Dynamic Bootstrap Overrides */
  --bs-primary: var(--theme-primary);
  --bs-primary-hover-bg: var(--theme-primary-hover);
  --bs-primary-hover-border: var(--theme-primary-hover);
  --bs-primary-bg-subtle: var(--theme-primary-subtle);
  --bs-primary-border-subtle: var(--theme-primary-border);
  --bs-link-color: var(--theme-primary);
  --bs-link-hover-color: var(--theme-primary-hover);
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-dark);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   2. Layout, Sidebar & Top Navigation Bar
   ========================================================================== */
@media (min-width: 992px) {
  .app-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--sidebar-width);
    z-index: 1000;
    background-color: #ffffff;
    border-right: 1px solid var(--border-subtle);
    overflow-y: auto;
  }

  .main-wrapper {
    margin-left: var(--sidebar-width);
  }
}

.navbar-custom {
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-subtle);
}

/* Dynamic Text Utilities */
.text-theme-primary {
  color: var(--theme-primary) !important;
}

.text-theme-secondary {
  color: var(--theme-secondary) !important;
}

/* Sidebar Links */
.nav-link-custom {
  color: #475569;
  font-weight: 600;
  font-size: 1rem;
  min-height: 50px;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  text-decoration: none;
}

.nav-link-custom:hover {
  color: var(--text-dark);
  background-color: #f1f5f9;
}

.nav-link-custom.active {
  font-weight: 600;
  color: var(--theme-primary) !important;
  background-color: var(--theme-primary-subtle) !important;
  border-left: 3px solid var(--theme-primary);
}

.nav-link-custom:focus-visible,
.app-nav-link:focus-visible,
.skip-to-content:focus-visible {
  outline: 3px solid var(--theme-secondary);
  outline-offset: 3px;
}

.sidebar-submenu .nav-link-custom {
  padding-left: 2.5rem;
  font-size: 0.95rem;
  min-height: 46px;
}

.patient-nav-hint {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
}

.skip-to-content {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 3000;
  padding: 0.65rem 0.9rem;
  color: #fff;
  background: var(--theme-primary);
  border-radius: 0.5rem;
  transform: translateY(-200%);
  transition: transform 0.2s ease;
}

.skip-to-content:focus {
  transform: translateY(0);
}

@media (max-width: 991.98px) {
  .app-sidebar .offcanvas-body {
    padding-bottom: 2rem !important;
  }

  .nav-link-custom {
    min-height: 54px;
    font-size: 1.05rem;
  }
}

/* User Avatar (Secondary Tone) */
.avatar-circle {
  width: 36px;
  height: 36px;
  background-color: var(--theme-secondary);
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

/* ==========================================================================
   3. Dual-Tone Action Buttons & Badges
   ========================================================================== */
/* Primary CTA Button (Uses Primary Theme Color) */
.btn-primary-theme,
.btn-primary {
  background-color: var(--theme-primary) !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 8px;
  padding: 9px 20px;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  transition: all 0.2s ease;
}

.btn-primary-theme:hover,
.btn-primary:hover {
  background-color: var(--theme-primary-hover) !important;
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
}

/* Secondary Action Button (Uses Secondary Theme Color) */
.btn-secondary-theme {
  background-color: var(--theme-secondary) !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 8px;
  padding: 9px 20px;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  transition: all 0.2s ease;
}

.btn-secondary-theme:hover {
  background-color: var(--theme-secondary-hover) !important;
  color: #ffffff !important;
  transform: translateY(-1px);
}

.btn-outline-theme {
  border: 1px solid var(--border-subtle);
  color: var(--text-dark);
  border-radius: 8px;
  padding: 7px 18px;
  font-weight: 600;
  background: #ffffff;
  transition: all 0.2s ease;
}

.btn-outline-theme:hover {
  background-color: #f8fafc;
  border-color: #cbd5e1;
  color: var(--text-dark);
}

/* Subtles & Dynamic Badges */
.bg-primary-subtle {
  background-color: var(--theme-primary-subtle) !important;
}

.bg-secondary-subtle {
  background-color: var(--theme-secondary-subtle) !important;
}

.border-primary-subtle {
  border-color: var(--theme-primary-border) !important;
}

.border-secondary-subtle {
  border-color: var(--theme-secondary-border) !important;
}

/* ==========================================================================
   4. Practice Cards & Banners
   ========================================================================== */
.mit-hero-card {
  background-color: #ffffff;
  border: 1px solid var(--border-subtle);
  border-left: 5px solid var(--theme-primary);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.exercise-card {
  background-color: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.exercise-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

/* ==========================================================================
   5. Universal Practice Modal Overlay & Animations
   ========================================================================== */
.modal-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(15, 23, 42, 0.5) !important;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 99999 !important;
}

.modal-content-custom {
  background: #ffffff !important;
  color: var(--text-dark) !important;
  width: 92%;
  max-width: 600px;
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 1.75rem;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.15);
  position: relative;
  animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal-sentence-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 1.25rem 0;
  padding: 1rem;
  background-color: #f8fafc;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
}

.modal-word-badge {
  font-size: 1.1rem;
  font-weight: 700;
  padding: 0.6rem 0.25rem;
  border-radius: 6px;
  color: #64748b;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  transition: all 0.2s ease;
  text-align: center;
}

/* Highlights current spoken word using Secondary Theme Color */
.modal-word-badge.active-word {
  background-color: var(--theme-secondary) !important;
  color: #ffffff !important;
  border-color: var(--theme-secondary) !important;
  transform: scale(1.05);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.punch-container {
  height: 80px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.giant-punch {
  font-size: 3.8rem;
  user-select: none;
}

.punch-hit {
  animation: heavyTap 0.22s ease-in-out;
}

@keyframes heavyTap {
  0% {
    transform: scale(1) translateY(0);
  }
  50% {
    transform: scale(1.3) translateY(10px);
    color: #ef4444;
  }
  100% {
    transform: scale(1) translateY(0);
  }
}

.modal-syllable-display {
  font-size: 2.2rem;
  font-weight: 800;
  padding: 0.5rem 1.5rem;
  border-radius: 8px;
  display: inline-block;
  min-width: 150px;
  border: 1px solid var(--border-subtle);
  background-color: #ffffff;
}

.modal-pitch-hint {
  font-size: 0.95rem;
  font-weight: 700;
  color: #64748b;
  margin-top: 0.75rem;
  height: 26px;
}

.modal-controls-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: #f8fafc;
  padding: 1rem;
  border-radius: 8px;
  margin-top: 1.25rem;
  border: 1px solid var(--border-subtle);
}

.progress-bar-theme {
  background-color: var(--theme-primary, #4f46e5) !important;
  transition:
    background-color 0.3s ease,
    width 0.4s ease;
}

.pagination .page-link {
  color: var(--theme-primary, #4f46e5);
  border-color: #e5e7eb;
}

.pagination .page-link:hover {
  color: var(--theme-primary-hover, #4338ca);
  background-color: var(--theme-light, #f0fdf4);
  border-color: #d1d5db;
}

.pagination .page-item.active .page-link {
  background-color: var(--theme-primary, #4f46e5) !important;
  border-color: var(--theme-primary, #4f46e5) !important;
  color: #ffffff !important;
}

/* Category Filter Tabs Styling */
.nav-pills .nav-link {
  color: var(--theme-text, #374151);
  border: 1px solid var(--theme-border, #e5e7eb);
  border-radius: 50rem;
  padding: 0.35rem 1rem;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.nav-pills .nav-link.active {
  background-color: var(--theme-primary, #4f46e5) !important;
  color: #ffffff !important;
  border-color: var(--theme-primary, #4f46e5) !important;
}

.form-check-input.text-theme-primary:checked {
  background-color: var(--theme-primary, #4f46e5) !important;
  border-color: var(--theme-primary, #4f46e5) !important;
}
/* Shared page loader. Change these selectors to redesign every loading state. */
.app-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.18s ease,
    visibility 0.18s ease;
}

.app-loading-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

.app-loading-spinner {
  width: 1.35rem;
  height: 1.35rem;
  border: 0.2rem solid rgba(79, 70, 229, 0.2);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: app-loader-spin 0.7s linear infinite;
}
.VaaniSetu-loading-logo {
  width: 190px;
  height: 190px;
  display: block;
  object-fit: contain;
}

.app-loading-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.app-loading-text {
  margin-top: 4px;
  font-size: 15px;
  font-weight: 600;
  color: #4b5563;
}

@keyframes app-loader-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Patient progress dashboard */
.dashboard-shell {
  max-width: 1440px;
}
.dashboard-hero {
  background: linear-gradient(135deg, var(--theme-primary-subtle), #fff 65%);
}
.dashboard-eyebrow {
  color: var(--theme-primary);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}
.dashboard-overall-card,
.dashboard-progress-card {
  background: #fff;
  border: 1px solid var(--border-subtle);
  border-radius: 1.25rem;
  box-shadow: 0 0.5rem 1.5rem rgba(15, 23, 42, 0.06);
  padding: 1.5rem;
}
.dashboard-overall-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.dashboard-overall-ring {
  --ring-size: 7.25rem;
  flex: 0 0 var(--ring-size);
  width: var(--ring-size);
  height: var(--ring-size);
  padding: 0.7rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(
    var(--theme-primary) calc(var(--progress) * 1%),
    var(--theme-primary-subtle) 0
  );
}
.dashboard-overall-ring > div {
  width: 100%;
  height: 100%;
  display: grid;
  place-content: center;
  text-align: center;
  border-radius: 50%;
  background: #fff;
}
.dashboard-overall-ring strong {
  font-size: 1.35rem;
  color: var(--theme-primary);
  line-height: 1;
}
.dashboard-overall-ring span {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 700;
  margin-top: 0.25rem;
}
.dashboard-chart-list {
  display: grid;
  gap: 0.8rem;
}
.dashboard-chart-row {
  display: grid;
  grid-template-columns: minmax(110px, 150px) 1fr 42px;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-dark);
  text-decoration: none;
  border-radius: 0.65rem;
  padding: 0.35rem 0.45rem;
}
.dashboard-chart-row:hover {
  background: var(--theme-primary-subtle);
  color: var(--text-dark);
}
.dashboard-chart-label {
  font-size: 0.9rem;
  font-weight: 700;
}
.dashboard-chart-label i {
  width: 1.3rem;
  color: var(--theme-primary);
}
.dashboard-chart-track,
.dashboard-progress-bar {
  height: 0.75rem;
  overflow: hidden;
  border-radius: 999px;
  background: var(--theme-primary-subtle);
}
.dashboard-chart-value {
  display: block;
  height: 100%;
  min-width: 0.35rem;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    var(--theme-primary),
    var(--theme-secondary)
  );
}
.dashboard-picture-card {
  border-top: 4px solid var(--theme-secondary) !important;
}
.dashboard-picture-icon {
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  flex: 0 0 3rem;
  border-radius: 0.9rem;
  background: var(--theme-secondary-subtle);
  color: var(--theme-secondary);
  font-size: 1.35rem;
}
.dashboard-percent-badge {
  display: inline-block;
  padding: 0.55rem 0.8rem;
  color: var(--theme-primary);
  background: var(--theme-primary-subtle);
  border-radius: 999px;
  font-weight: 800;
}
@media (max-width: 575.98px) {
  .dashboard-overall-card {
    align-items: flex-start;
  }
  .dashboard-overall-ring {
    --ring-size: 5.5rem;
  }
  .dashboard-chart-row {
    grid-template-columns: 1fr 42px;
  }
  .dashboard-chart-track {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

/* ==========================================================================
   10. Daily Quote Modal & Button Styles
   ========================================================================== */
.animate-pulse-slow {
  animation: pulse-slow 2s infinite ease-in-out;
}

@keyframes pulse-slow {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.15);
  }
}

.daily-quote-card {
  border: none !important;
  border-radius: 24px !important;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18) !important;
  overflow: hidden;
  background: #ffffff;
}

.daily-quote-header {
  background: linear-gradient(
    135deg,
    var(--theme-primary-subtle) 0%,
    #ffffff 100%
  );
  border-bottom: 1px solid var(--border-subtle) !important;
  padding: 1.25rem 1.75rem !important;
}

.daily-quote-image-container {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
  transition:
    transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.3s ease;
  border: 1px solid var(--border-subtle);
}

.daily-quote-image-container:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: 0 15px 35px rgba(15, 23, 42, 0.15);
}

.daily-quote-img {
  width: 100%;
  height: auto;
  max-height: 70vh;
  object-fit: contain;
  display: block;
}

.daily-quote-close-btn {
  transition: all 0.2s ease;
}

.daily-quote-close-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}
/* Theme-Adaptive Breadcrumb Styling */
.theme-breadcrumb-wrapper {
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border-subtle, #e2e8f0);
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.04);
}

/* Custom Angle Arrow Separator */
.theme-breadcrumb-wrapper .breadcrumb-item + .breadcrumb-item::before {
  content: "\f105"; /* FontAwesome angle-right */
  font-family: "Font Awesome 6 Free", "Font Awesome 5 Free";
  font-weight: 900;
  font-size: 0.85rem;
  color: var(--text-muted, #64748b);
  padding: 0 0.55rem;
}

/* Inactive Link Styling */
.theme-breadcrumb-wrapper .breadcrumb-item a {
  color: var(--theme-primary, #4f46e5);
  transition: all 0.2s ease;
}

.theme-breadcrumb-wrapper .breadcrumb-item a:hover {
  opacity: 0.8;
  transform: translateX(1px);
}

/* Active / Current Page Styling */
.theme-breadcrumb-wrapper .breadcrumb-item.active {
  color: var(--text-dark, #0f172a);
  background-color: var(--theme-primary-subtle, #eef2ff);
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
}

.theme-breadcrumb-wrapper .breadcrumb-item.active i {
  color: var(--theme-primary, #4f46e5);
}
