@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700&family=DM+Serif+Display&display=swap');

:root {
  --brand-bg: #0f1623;
  --brand-surface: #1a2333;
  --brand-surface2: #212d42;
  --brand-accent: #4ecdc4;
  --brand-accent2: #a8edea;
  --brand-text: #e8edf5;
  --brand-muted: #8896a8;
  --brand-danger: #ff6b6b;
  --brand-success: #51cf66;
  --brand-warning: #ffd43b;
  --brand-border: rgba(255,255,255,0.07);
  --brand-glow: 0 0 40px rgba(78, 205, 196, 0.15);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  background-color: var(--brand-bg) !important;
  color: var(--brand-text) !important;
  font-family: 'DM Sans', sans-serif !important;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

/* MudBlazor overrides */
.mud-layout {
  background-color: var(--brand-bg) !important;
}

.mud-appbar {
  background: linear-gradient(135deg, #0f1623 0%, #1a2333 100%) !important;
  border-bottom: 1px solid var(--brand-border) !important;
  backdrop-filter: blur(20px) !important;
  box-shadow: 0 4px 30px rgba(0,0,0,0.3) !important;
}

  .mud-appbar .mud-typography {
    font-family: 'DM Serif Display', serif !important;
    font-size: 1.4rem !important;
    background: linear-gradient(135deg, #4ecdc4, #a8edea) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
  }

.mud-drawer {
  background: #111827 !important;
  border-right: 1px solid var(--brand-border) !important;
}

.mud-drawer-header {
  background: #111827 !important;
  padding: 24px 16px !important;
  border-bottom: 1px solid var(--brand-border) !important;
}

.mud-nav-link {
  color: var(--brand-muted) !important;
  border-radius: 10px !important;
  margin: 4px 8px !important;
  transition: all 0.2s ease !important;
}

  .mud-nav-link:hover {
    background: rgba(78, 205, 196, 0.1) !important;
    color: var(--brand-accent) !important;
    transform: translateX(4px) !important;
  }

  .mud-nav-link.active {
    background: linear-gradient(135deg, rgba(78, 205, 196, 0.2), rgba(168, 237, 234, 0.1)) !important;
    color: var(--brand-accent) !important;
    border-left: 3px solid var(--brand-accent) !important;
  }

.mud-card {
  background: var(--brand-surface) !important;
  border: 1px solid var(--brand-border) !important;
  border-radius: 16px !important;
  transition: all 0.3s ease !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2) !important;
}

  .mud-card:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 12px 40px rgba(0,0,0,0.3), var(--brand-glow) !important;
    border-color: rgba(78, 205, 196, 0.3) !important;
  }

.mud-paper {
  background: var(--brand-surface) !important;
  border: 1px solid var(--brand-border) !important;
  border-radius: 16px !important;
}

.mud-button-filled-primary {
  background: linear-gradient(135deg, #4ecdc4, #44b8b0) !important;
  color: #0f1623 !important;
  font-weight: 600 !important;
  border-radius: 10px !important;
  box-shadow: 0 4px 20px rgba(78, 205, 196, 0.3) !important;
  transition: all 0.2s ease !important;
}

  .mud-button-filled-primary:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 30px rgba(78, 205, 196, 0.4) !important;
  }

.mud-input-slot {
  color: var(--brand-text) !important;
}

.mud-input-outlined .mud-input-outlined-border {
  border-color: var(--brand-border) !important;
}

.mud-input-outlined:hover .mud-input-outlined-border {
  border-color: var(--brand-accent) !important;
}

.mud-input-label {
  color: var(--brand-muted) !important;
}

  .mud-input-label.mud-input-label-inputcontrol {
    color: var(--brand-muted) !important;
  }

.mud-table {
  background: var(--brand-surface) !important;
  border-radius: 16px !important;
  overflow: hidden !important;
}

.mud-table-head .mud-table-cell {
  background: var(--brand-surface2) !important;
  color: var(--brand-muted) !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  font-size: 0.75rem !important;
  letter-spacing: 0.08em !important;
}

.mud-table-row:hover .mud-table-cell {
  background: rgba(78, 205, 196, 0.05) !important;
}

.mud-table-cell {
  color: var(--brand-text) !important;
  border-bottom: 1px solid var(--brand-border) !important;
}

.mud-alert {
  border-radius: 12px !important;
}

.mud-snackbar {
  border-radius: 12px !important;
}

/* Stat cards on dashboard */
.stat-card {
  background: linear-gradient(135deg, var(--brand-surface) 0%, var(--brand-surface2) 100%);
  border: 1px solid var(--brand-border);
  border-radius: 20px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

  .stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #4ecdc4, #a8edea);
    border-radius: 20px 20px 0 0;
  }

  .stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.3), var(--brand-glow);
  }

.stat-number {
  font-family: 'DM Serif Display', serif;
  font-size: 2.5rem;
  color: var(--brand-accent);
  line-height: 1;
  margin-top: 8px;
}

.stat-label {
  color: var(--brand-muted);
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Timeline */
.mud-timeline-item-dot {
  background: var(--brand-accent) !important;
  box-shadow: 0 0 12px rgba(78, 205, 196, 0.5) !important;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--brand-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--brand-surface2);
  border-radius: 3px;
}

  ::-webkit-scrollbar-thumb:hover {
    background: var(--brand-accent);
  }

/* Page transitions */
.mud-main-content {
  animation: fadeIn 0.3s ease !important;
}

.mud-appbar .mud-icon-button {
  color: var(--brand-muted) !important;
}

  .mud-appbar .mud-icon-button:hover {
    color: var(--brand-accent) !important;
    background: rgba(78, 205, 196, 0.1) !important;
  }

.mud-appbar .mud-typography {
  color: var(--brand-text) !important;
}

/* Pill loader */
.pill-loader {
  min-height: 100vh;
  background: var(--brand-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-family: 'DM Sans', sans-serif;
}

.pill-logo {
  font-size: 3rem;
  animation: pulse 2s ease-in-out infinite;
}

.pill-title {
  font-family: 'DM Serif Display', serif;
  font-size: 1.8rem;
  background: linear-gradient(135deg, #4ecdc4, #a8edea);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.pill-subtitle {
  color: #8896a8;
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.pill-capsule {
  display: flex;
  align-items: center;
  width: 200px;
  height: 32px;
  margin-top: 8px;
}

.pill-capsule-left {
  width: 16px;
  height: 32px;
  background: #1a2333;
  border: 2px solid #4ecdc4;
  border-right: none;
  border-radius: 100px 0 0 100px;
  flex-shrink: 0;
}

.pill-capsule-right {
  width: 16px;
  height: 32px;
  background: #1a2333;
  border: 2px solid #4ecdc4;
  border-left: none;
  border-radius: 0 100px 100px 0;
  flex-shrink: 0;
}

.pill-capsule-body {
  flex: 1;
  height: 32px;
  background: #1a2333;
  border-top: 2px solid #4ecdc4;
  border-bottom: 2px solid #4ecdc4;
  overflow: hidden;
  position: relative;
}

.mud-card-content .mud-typography {
  color: var(--brand-text) !important;
}

/* Journal entry cards */
.journal-entry-text {
  color: var(--brand-text) !important;
}

.pill-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #4ecdc4, #a8edea);
  transition: width 0.3s ease;
  position: relative;
  overflow: hidden;
}

  .pill-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 1.5s ease infinite;
  }

.pill-progress-text {
  color: #4ecdc4;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
  }
}

@keyframes shimmer {
  0% {
    left: -100%;
  }

  100% {
    left: 100%;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 600px) {
  .navbar-email {
    display: none !important;
  }

  .mud-appbar .mud-typography-h6 {
    font-size: 1rem !important;
  }
}