/* Import Material Icons (still used in some components) */
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0');

/* Bootstrap 5 Light Theme */

/* Global Resets */
* {
  box-sizing: border-box;
}

/* Base Styles */
html, body {
  width: 100%;
  height: 100%;
  font-family: var(--font-body, 'Inter', sans-serif);
  color: #1e293b;
  background-color: #f8fafc;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.011em;
  line-height: 1.6;
}

/* Headings use DM Sans */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6,
.display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
  font-family: var(--font-heading, 'DM Sans', sans-serif);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: #0f172a;
}

/* Smaller body text lighter */
.text-muted {
  color: #64748b !important;
}

small, .small {
  color: #64748b;
}

/* Links */
a {
  color: #0d9488;
  transition: color 0.2s ease;
}

a:hover {
  color: #0f766e;
}

#app {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Main Content Area */
main {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* Material Icons (still used in some places) */
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 8px;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 8px;
  border: 2px solid #f1f5f9;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Firefox Scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 #f1f5f9;
}

/* =============================================
   Enhanced Bootstrap Cards
   ============================================= */
.card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg, 16px);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-card-border, linear-gradient(90deg, #0d9488, #6366f1, #14b8a6));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.08), 0 4px 10px -3px rgba(0,0,0,0.04);
}

.card:hover::before {
  opacity: 1;
}

.card-body {
  font-family: var(--font-body, 'Inter', sans-serif);
}

.card-title {
  font-family: var(--font-heading, 'DM Sans', sans-serif);
  font-weight: 600;
  color: #0f172a;
}

/* =============================================
   Card-Glass – Frosted for auth pages
   ============================================= */
.card-glass {
  background: rgba(255, 255, 255, 0.82) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border: 1px solid rgba(255, 255, 255, 0.6) !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0,0,0,0.03);
}

/* =============================================
   Auth Page – Animated gradient background
   ============================================= */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem 1rem;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #f0fdfa 0%, #ede9fe 50%, #ecfeff 100%);
}

.auth-page::before,
.auth-page::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  animation: authBlob 12s ease-in-out infinite alternate;
}

.auth-page::before {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #14b8a6 0%, transparent 70%);
  top: -150px;
  right: -100px;
}

.auth-page::after {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #818cf8 0%, transparent 70%);
  bottom: -120px;
  left: -80px;
  animation-delay: -6s;
}

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

/* =============================================
   Auth Brand Icon – Gradient circle + pulse
   ============================================= */
.auth-brand-icon {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--gradient-brand, linear-gradient(135deg, #0d9488, #6366f1));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  animation: brandPulse 3s ease-in-out infinite;
  box-shadow: 0 0 30px rgba(13, 148, 136, 0.3);
}

.auth-brand-icon i {
  font-size: 2.5rem;
  color: #fff;
}

@keyframes brandPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(13,148,136,0.25); }
  50%      { box-shadow: 0 0 35px rgba(13,148,136,0.45); }
}

/* =============================================
   Dashboard Hero – Gradient welcome section
   ============================================= */
.dashboard-hero {
  padding: 2rem 2rem 1.5rem;
  border-radius: var(--radius-lg, 16px);
  background: var(--gradient-brand-subtle, linear-gradient(135deg, rgba(13,148,136,0.06), rgba(99,102,241,0.06)));
  border: 1px solid #e2e8f0;
  margin-bottom: 1.5rem;
}

.dashboard-hero h1 {
  background: var(--gradient-card-border, linear-gradient(90deg, #667eea, #764ba2, #42A5F5));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* =============================================
   Stat Icon – Gradient icon containers
   ============================================= */
.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}

.stat-icon i { font-size: 1.5rem; }

.stat-icon--primary   { background: linear-gradient(135deg, #0d9488, #14b8a6); }
.stat-icon--secondary { background: linear-gradient(135deg, #d97706, #f59e0b); }
.stat-icon--success   { background: linear-gradient(135deg, #059669, #34d399); }
.stat-icon--info      { background: linear-gradient(135deg, #6366f1, #818cf8); }
.stat-icon--tertiary  { background: linear-gradient(135deg, #6366f1, #a5b4fc); }

/* =============================================
   Quick Action Card – Hover lift + icon scale
   ============================================= */
.quick-action-card {
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.quick-action-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px -6px rgba(0,0,0,0.1);
}

.quick-action-card .action-icon {
  transition: transform 0.25s ease;
}

.quick-action-card:hover .action-icon {
  transform: scale(1.12);
}

/* =============================================
   Navbar Glass – Translucent with blur
   ============================================= */
.navbar-glass {
  background: linear-gradient(135deg, rgba(13,148,136,0.95), rgba(15,118,110,0.95)) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 20px rgba(13, 148, 136, 0.15);
}

.navbar-glass .nav-link {
  position: relative;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-weight: 500;
  letter-spacing: 0;
}

.navbar-glass .nav-link::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 0;
  height: 2px;
  background: #fff;
  transition: width 0.3s ease, left 0.3s ease;
}

.navbar-glass .nav-link:hover::after,
.navbar-glass .nav-link.active::after {
  width: 100%;
  left: 0;
}

/* =============================================
   Stagger Fade-In – Card grid entrance
   ============================================= */
@keyframes staggerFadeIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stagger-fade-in > * {
  opacity: 0;
  animation: staggerFadeIn 0.4s ease-out forwards;
}

.stagger-fade-in > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-fade-in > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-fade-in > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-fade-in > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-fade-in > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-fade-in > *:nth-child(6) { animation-delay: 0.3s; }
.stagger-fade-in > *:nth-child(7) { animation-delay: 0.35s; }
.stagger-fade-in > *:nth-child(8) { animation-delay: 0.4s; }

/* =============================================
   Gradient Brand Button
   ============================================= */
.btn-gradient-brand {
  background: var(--gradient-brand, linear-gradient(135deg, #0d9488, #6366f1));
  color: #fff;
  border: none;
  border-radius: var(--radius-md, 10px);
  font-family: var(--font-body, 'Inter', sans-serif);
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: box-shadow 0.3s ease, transform 0.2s ease;
}

.btn-gradient-brand:hover {
  color: #fff;
  box-shadow: 0 4px 18px rgba(13, 148, 136, 0.35);
  transform: translateY(-1px);
}

/* Enhanced .btn-primary */
.btn-primary {
  background: linear-gradient(135deg, #0d9488, #14b8a6) !important;
  border: none !important;
  border-radius: var(--radius-md, 10px) !important;
  font-family: var(--font-body, 'Inter', sans-serif);
  font-weight: 600;
  transition: box-shadow 0.3s ease, transform 0.2s ease;
}

.btn-primary:hover {
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.3);
}

/* Enhanced progress bar */
.progress-bar {
  background: var(--gradient-primary, linear-gradient(135deg, #0d9488, #14b8a6)) !important;
  border-radius: 6px;
}

/* Responsive breakpoints */
@media (max-width: 600px) {
  main {
    padding: 1rem;
  }
}

/* Badge & Form refinements */
.badge {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-weight: 600;
  letter-spacing: 0;
  border-radius: 8px;
}

.form-control, .form-select {
  font-family: var(--font-body, 'Inter', sans-serif);
  border-radius: var(--radius-md, 10px);
}

.form-label {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-weight: 500;
  color: #475569;
}

.btn {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-weight: 600;
  border-radius: var(--radius-md, 10px);
  letter-spacing: -0.01em;
}

.navbar-brand {
  font-family: var(--font-heading, 'DM Sans', sans-serif) !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--bs-secondary-color);
}

.empty-state .material-symbols-outlined,
.empty-state .fas,
.empty-state .far {
  font-size: 4rem;
  opacity: 0.5;
  margin-bottom: 1rem;
}

/* Backwards compatibility classes (Bootstrap already has these but using different names) */
.hidden {
  display: none !important;
}

.d-none {
  display: none !important;
}

/* Timeline Component */
.timeline {
  position: relative;
}

.timeline-item {
  display: flex;
  align-items: flex-start;
  position: relative;
}

.timeline-item i {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.timeline-item:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 11px;
  top: 24px;
  bottom: -12px;
  width: 2px;
  background: var(--bs-border-color);
}

/* ── PWA Install Banner ──────────────────────────────────────────────────── */

#pwa-install-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  background: #fff;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
  border-top: 1px solid #e2e8f0;
  border-radius: 16px 16px 0 0;
  padding: 0;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#pwa-install-banner.pwa-banner--visible {
  transform: translateY(0);
}

.pwa-banner-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  max-width: 600px;
  margin: 0 auto;
}

.pwa-banner-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  background: #1976D2;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.pwa-banner-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pwa-banner-title {
  font-size: 0.9rem;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pwa-banner-subtitle {
  font-size: 0.78rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pwa-banner-actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

@media (max-width: 400px) {
  .pwa-banner-inner {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .pwa-banner-actions {
    width: 100%;
    justify-content: flex-end;
  }
}
