:root {
  --bg-dark: #0b132b;
  --card-bg: #ffffff;
  --card-border: rgba(15, 23, 42, 0.08);
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary: #f1f5f9;
  --secondary-hover: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --accent-1: #f97316;
  --accent-2: #3b82f6;
  --success: #10b981;
  --warning: #f59e0b;
}

#main-logo {
  max-height: 120px;
  width: auto;
  object-fit: contain;
  margin-bottom: 0.5rem;
}

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

body {
  font-family: "Outfit", sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  position: relative;
  overflow-x: hidden;
  line-height: 1.6;
}

/* Background animated orbs */
.background-orbs {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  z-index: -1;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.5;
  animation: float 20s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
}

.orb-1 {
  width: 400px;
  height: 400px;
  background: var(--primary);
  top: -10%;
  left: -10%;
}

.orb-2 {
  width: 500px;
  height: 500px;
  background: var(--accent-1);
  bottom: -20%;
  right: -10%;
  animation-delay: -5s;
}

.orb-3 {
  width: 300px;
  height: 300px;
  background: var(--accent-2);
  top: 40%;
  left: 40%;
  animation-delay: -10s;
}

@keyframes float {
  0% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(50px, 50px) scale(1.1);
  }
  100% {
    transform: translate(-50px, 100px) scale(0.9);
  }
}

/* Layout */
.container {
  width: 100%;
  max-width: 800px;
  padding: 3rem 1.5rem;
  z-index: 1;
}

.header {
  text-align: center;
  margin-bottom: 3rem;
  animation: fade-in-down 0.8s ease-out;
}

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

.glow-text {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  letter-spacing: -1.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
}

.logo-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 90px;
  height: 90px;
  background: linear-gradient(135deg, var(--primary), var(--accent-2));
  color: white;
  border-radius: 50%;
  font-size: 3.8rem;
  font-weight: 800;
  box-shadow: 0 0 25px rgba(239, 68, 68, 0.5);
  margin-right: 2px;
}

.highlight {
  background: linear-gradient(to right, #ffffff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header p {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 500px;
  margin: 0.5rem auto 2rem;
}

/* Main Navigation Tabs */
.main-nav {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2.5rem;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.02);
  border-radius: 20px;
  border: 1px solid var(--card-border);
  backdrop-filter: blur(10px);
}

.nav-item {
  padding: 0.8rem 1.5rem;
  border-radius: 12px;
  color: var(--text-muted);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

.nav-item.active {
  color: white;
  background: var(--primary);
  box-shadow: 0 4px 15px rgba(197, 161, 83, 0.3);
}

.main-tab-content {
  display: none;
  animation: fade-in-up 0.4s ease-out;
}

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

/* Cards (Glassmorphism) */
.glass-card,
.upload-card,
.results-card {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 2.5rem;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.1);

  animation: fade-in-up 0.6s ease-out;
  transition: all 0.3s ease;
}

/* Login Overlay */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
}

.login-box {
  width: 90%;
  max-width: 400px;
  padding: 2rem;
}

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

/* Tabs */
.tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  padding: 0.4rem;
  margin-bottom: 2rem;
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.8rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn.active {
  background: var(--secondary);
  color: var(--text-main);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.tab-logo-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, var(--primary), var(--accent-2));
  color: white;
  border-radius: 50%;
  font-size: 0.9rem;
  font-weight: 800;
  margin-right: -2px;
}

.tab-content {
  display: none;
  animation: fade-in 0.3s;
}

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

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

/* Drop Zone */
.drop-zone {
  border: 2px dashed rgba(239, 68, 68, 0.5);
  border-radius: 16px;
  padding: 3rem 2rem;
  text-align: center;
  background: rgba(239, 68, 68, 0.05);
  transition: all 0.3s ease;
  cursor: pointer;
}

.drop-zone.dragover {
  background: rgba(239, 68, 68, 0.15);
  border-color: var(--primary);
  transform: scale(1.02);
}

.drop-icon {
  font-size: 4rem;
  color: var(--primary);
  margin-bottom: 1rem;
  filter: drop-shadow(0 0 10px rgba(197, 161, 83, 0.3));
}

.drop-zone h3 {
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.drop-zone p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

/* File Info */
.file-info {
  display: flex;
  align-items: center;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 12px;
  padding: 1rem;
  margin-top: 1rem;
  animation: fade-in-up 0.3s;
}

.file-icon {
  color: var(--success);
  font-size: 1.5rem;
  margin-right: 1rem;
}

#file-name {
  flex: 1;
  font-weight: 600;
}

/* Forms */
.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-muted);
}

textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 1rem;
  color: var(--text-main);
  font-family: inherit;
  font-size: 1rem;
  resize: vertical;
  transition: border-color 0.3s;
}

textarea:focus {
  outline: none;
  border-color: var(--accent-1);
}

/* Buttons */
.btn {
  font-family: inherit;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--primary);
  color: white;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}

.btn-secondary {
  background: var(--secondary);
  color: var(--text-main);
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

.btn-secondary:hover {
  background: var(--secondary-hover);
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  border-radius: 8px;
}

.btn-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-action {
  width: 100%;
  background: linear-gradient(45deg, var(--primary), var(--accent-1));
  color: white;
  padding: 1.2rem;
  font-size: 1.2rem;
  margin-top: 2rem;
  border-radius: 16px;
  box-shadow: 0 10px 20px -10px rgba(239, 68, 68, 0.8);
}

.btn-action:hover:not(:disabled) {
  box-shadow: 0 15px 30px -10px rgba(239, 68, 68, 1);
  transform: translateY(-2px);
}

.btn-action:disabled {
  background: var(--secondary);
  color: var(--text-muted);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn-icon {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--text-main);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

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

/* Loading State */
.loading-state {
  text-align: center;
  padding: 4rem 0;
}

.spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-left-color: var(--accent-1);
  border-right-color: var(--accent-2);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1.5rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Results Card */
.results-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--card-border);
}

.warning-banner {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--warning);
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

/* Markdown styling */
.markdown-body {
  line-height: 1.8;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text-main);
}

.markdown-body h1 {
  font-size: 2rem;
  background: linear-gradient(90deg, var(--text-main), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.markdown-body ul,
.markdown-body ol {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}

.markdown-body li {
  margin-bottom: 0.5rem;
}

.markdown-body strong {
  color: var(--accent-1);
  font-weight: 600;
}

.markdown-body p {
  margin-bottom: 1.5rem;
}

.hidden {
  display: none !important;
}

.mt-20 {
  margin-top: 20px;
}

/* Header Main & Streak */
.header {
  text-align: center;
  margin-bottom: 2rem;
  animation: fade-in-down 0.8s ease-out;
  position: relative;
  padding-top: 1rem;
}

.header-main {
  display: flex;
  justify-content: center;
  align-items: center;
}

.header-actions {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 10;
}

.streak-circle {
  position: relative;
  width: 100px;
  height: 100px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(15px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  animation:
    scale-up 0.5s ease-out,
    glow-pulse 3s infinite ease-in-out;
}

@media (max-width: 600px) {
  .header-actions {
    top: 0.2rem;
    right: 0.2rem;
  }
  .streak-circle {
    width: 80px;
    height: 80px;
  }
  .streak-emoji {
    font-size: 1.2rem;
  }
  .streak-number {
    font-size: 1.6rem !important;
  }
  .progress-ring {
    width: 80px !important;
    height: 80px !important;
    top: 0 !important;
    left: 0 !important;
  }
}

@keyframes scale-up {
  from {
    transform: scale(0.5);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes glow-pulse {
  0%,
  100% {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  }
  50% {
    box-shadow: 0 10px 40px rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.2);
  }
}

.progress-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.progress-ring__circle {
  stroke-dasharray: 289;
  stroke-dashoffset: 0;
  filter: drop-shadow(0 0 8px var(--primary));
  transition: stroke-dashoffset 0.5s ease;
}

.streak-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  z-index: 2;
}

.streak-emoji {
  font-size: 1.6rem;
}

.streak-number {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--accent-1);
  text-shadow: 0 0 15px rgba(248, 113, 113, 0.6);
  line-height: 1;
  transition: all 0.3s;
}

.streak-number.long-streak {
  font-size: 1.6rem;
}

.streak-label-tag {
  position: absolute;
  bottom: -10px;
  background: var(--primary);
  color: white;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

/* Strava Section */
.strava-section {
  margin-bottom: 2rem;
  animation: fade-in-up 0.7s ease-out;
}

.strava-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  border-radius: 20px;
  background: rgba(252, 76, 2, 0.08);
  border: 1px solid rgba(252, 76, 2, 0.2);
}

.strava-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.strava-icon {
  font-size: 2rem;
  color: #fc4c02; /* Strava Orange */
}

.strava-status-text {
  font-weight: 600;
}

.btn-strava {
  background: #fc4c02;
  color: white;
  padding: 0.6rem 1.2rem;
  font-size: 1rem;
  box-shadow: 0 4px 15px rgba(252, 76, 2, 0.3);
}

.btn-strava:hover {
  background: #e34402;
  box-shadow: 0 6px 20px rgba(252, 76, 2, 0.5);
}

/* Notes Card */
.notes-card {
  padding: 1.5rem 2rem;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid var(--card-border);
}

.notes-card h3 {
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
}

.notes-hint {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.notes-card textarea {
  min-height: 80px;
  font-size: 0.95rem;
}

.notes-status {
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--success);
  opacity: 0;
  transition: opacity 0.3s;
  text-align: right;
}

.notes-status.visible {
  opacity: 1;
}

/* Responsive fixes */
@media (max-width: 600px) {
  .strava-card {
    flex-direction: column;
    gap: 1.5rem;
    text-align: center;
  }
  .glow-text {
    font-size: 2.2rem;
  }
  .main-nav {
    gap: 0.25rem;
    padding: 0.25rem;
  }
  .nav-item {
    padding: 0.6rem 0.4rem;
    font-size: 0.85rem;
  }
}

/* Integration Items */
.integration-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.02);
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid var(--card-border);
}

.integration-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.integration-actions {
  display: flex;
  gap: 0.5rem;
}

.mt-10 {
  margin-top: 10px;
}
.mt-15 {
  margin-top: 15px;
}

/* Weight Dashboard */
.weight-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.stat-card {
  padding: 1.5rem;
  text-align: center;
}

.stat-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stat-card h2 {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--accent-1);
}

.stat-card .unit {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 400;
}

.stat-meta {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

.chart-container {
  height: 250px;
  width: 100%;
  position: relative;
  margin-top: 1rem;
  overflow: hidden;
}

.chart-placeholder {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 12px;
}

.weight-svg-chart {
  overflow: visible;
}

.chart-line {
  fill: none;
  stroke: var(--primary);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.5));
}

.chart-area {
  fill: url(#chart-gradient);
  opacity: 0.2;
}

.chart-point {
  fill: var(--accent-1);
  stroke: var(--bg-deep);
  stroke-width: 2;
}

.chart-axis {
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 1;
}

.chart-label {
  fill: var(--text-muted);
  font-size: 10px;
}

/* Food Logging */
.meal-input-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.meal-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.image-previews {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.preview-img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.meal-entry {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.meal-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.meal-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.meal-images-grid {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.meal-img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 12px;
}

.ai-feedback {
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(239, 68, 68, 0.05);
  border-left: 3px solid var(--primary);
  border-radius: 4px 12px 12px 4px;
  font-size: 0.9rem;
  line-height: 1.6;
}

.ai-feedback h4 {
  color: var(--accent-1);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Meal Editing */
.edit-textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 10px;
  color: var(--text-light);
  font-family: inherit;
  resize: vertical;
}

.loading-opacity {
  opacity: 0.5;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.meal-text {
  line-height: 1.6;
}

/* Timeline & Notes History */
.timeline {
  position: relative;
  padding-left: 1.5rem;
  border-left: 2px solid rgba(255, 255, 255, 0.05);
}

.timeline-item {
  position: relative;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: calc(-1.5rem - 6px);
  top: 5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 10px var(--primary);
}

.timeline-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.timeline-text {
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  padding: 2rem;
  overflow-y: auto;
  border-radius: 24px;
}

.full-history-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.history-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 1rem;
  border-radius: 12px;
}

.history-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.history-card-body textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 10px;
  border-radius: 8px;
  font-family: inherit;
  resize: vertical;
}

.action-btns {
  display: flex;
  gap: 0.5rem;
}

.btn-danger {
  background: #4b1a1a;
  color: #ff4d4d;
  border: 1px solid #7d2a2a;
}

.btn-danger:hover {
  background: #7d2a2a;
  color: #fff;
}

/* History Table */
.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  text-align: left;
}

.history-table th,
.history-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--card-border);
}

.history-table th {
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.5px;
}

.history-table tr:last-child td {
  border-bottom: none;
}

.badge {
  transition: all 0.3s ease;
}
.badge:hover {
  transform: scale(1.1);
}

/* Custom Interactive InBody KPI Tooltip */
.kpi-custom-tooltip {
  position: absolute;
  z-index: 10000;
  background: var(--card-bg, #ffffff);
  color: var(--text-main, #1f2937);
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  font-size: 0.82rem;
  line-height: 1.45;
  box-shadow:
    0 16px 36px rgba(0, 0, 0, 0.16),
    0 4px 12px rgba(0, 0, 0, 0.08);
  width: 320px;
  max-width: 90vw;
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 0.15s ease,
    transform 0.15s ease;
  white-space: normal;
  text-align: left;
}

.kpi-custom-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.kpi-custom-tooltip .tooltip-header {
  font-weight: 700;
  font-size: 0.88rem;
  color: #1d4ed8;
  margin-bottom: 0.45rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  padding-bottom: 0.35rem;
}

.kpi-custom-tooltip .tooltip-badge {
  font-size: 0.72rem;
  background: #eff6ff;
  color: #2563eb;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 600;
  white-space: nowrap;
}

.kpi-custom-tooltip .tooltip-body {
  color: #374151;
}

.kpi-custom-tooltip .tooltip-body p {
  margin-bottom: 0.4rem;
}

.kpi-custom-tooltip .tooltip-body ul {
  margin: 0.35rem 0;
  padding-left: 1.2rem;
}

.kpi-custom-tooltip .tooltip-body li {
  margin-bottom: 0.25rem;
}

.kpi-cell-interactive {
  cursor: pointer;
  transition: background 0.15s ease;
}

.kpi-cell-interactive:hover {
  background: rgba(37, 99, 235, 0.06) !important;
}

/* =========================================================
   BodyStreak Look & Feel Theme (2026 App Store Redesign)
   ========================================================= */

body {
  background: linear-gradient(145deg, #0b132b 0%, #162447 52%, #1f1638 100%);
  background-attachment: fixed;
  color: #0f172a;
}

.container {
  max-width: 920px;
  padding: 1.75rem 1.25rem 4rem;
}

/* Top Bar */
.bs-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 1rem;
  margin-bottom: 1.5rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(12px);
  color: #e2e8f0;
  font-size: 0.85rem;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.bs-topbar-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.bs-user-email-wrap {
  color: #cbd5e1;
  font-weight: 500;
}

.bs-plan-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.4px;
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.bs-plan-badge.trial {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.4);
}

.bs-plan-badge.free {
  background: rgba(148, 163, 184, 0.2);
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.35);
}

.bs-logout-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #f8fafc;
  padding: 0.4rem 0.8rem;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: background 0.15s ease;
}

.bs-logout-btn:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.45);
}

/* Header */
.bs-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.bs-header-logo-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  padding: 0.65rem 1.35rem;
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
  margin-bottom: 0.75rem;
}

.bs-header-logo-pill #main-logo {
  max-height: 44px;
  margin: 0;
}

.bs-header-tagline {
  color: #cbd5e1;
  font-size: 0.95rem;
  margin-top: 0.4rem;
}

.bs-header .streak-circle {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.bs-header .streak-number {
  color: #ffffff;
}

.bs-header .streak-label-tag {
  background: #f97316;
  color: #ffffff;
}

/* Main Navigation */
.bs-main-nav {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(12px);
  border-radius: 16px;
  padding: 0.35rem;
  gap: 0.35rem;
  margin-bottom: 1.75rem;
}

.bs-main-nav .nav-item {
  color: #cbd5e1;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.65rem 1rem;
  transition: all 0.18s ease;
}

.bs-main-nav .nav-item:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.bs-main-nav .nav-item.active {
  background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
}

.bs-main-nav .nav-item[data-main-tab="streak-tab"].active {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  box-shadow: 0 6px 18px rgba(249, 115, 22, 0.35);
}

.bs-main-nav .nav-item[data-main-tab="streak-tab"].active i {
  color: #ffffff !important;
}

/* White Widget-Style Cards */
.glass-card {
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.24);
  color: #0f172a;
}

/* Login / Register Overlay */
.login-overlay {
  background: linear-gradient(
    145deg,
    rgba(11, 19, 43, 0.96) 0%,
    rgba(22, 36, 71, 0.96) 52%,
    rgba(31, 22, 56, 0.96) 100%
  ) !important;
  backdrop-filter: blur(18px);
}

.bs-auth-card {
  width: 100%;
  max-width: 430px;
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  border-radius: 24px !important;
  padding: 2rem !important;
  color: #f8fafc !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45) !important;
}

.bs-auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 1.35rem;
}

.bs-logo-pill {
  background: #ffffff;
  border-radius: 16px;
  padding: 0.7rem 1.35rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.28);
  margin-bottom: 0.75rem;
}

.bs-logo-pill img {
  height: 38px;
  width: auto;
  display: block;
}

.bs-auth-subtitle {
  color: #cbd5e1;
  font-size: 0.9rem;
  margin: 0;
}

.bs-auth-segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  padding: 0.3rem;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 1.25rem;
}

.bs-seg-btn {
  background: transparent;
  border: none;
  color: #cbd5e1;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.6rem 0.5rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.bs-seg-btn.active {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.bs-auth-card label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 0.35rem;
}

.bs-auth-input {
  width: 100%;
  padding: 0.8rem 0.95rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(15, 23, 42, 0.78);
  color: #ffffff;
  font-size: 0.95rem;
  outline: none;
}

.bs-auth-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.bs-pw-hint {
  font-size: 0.74rem;
  color: #94a3b8;
  margin-top: 0.35rem;
}

.bs-auth-link {
  font-size: 0.83rem;
  color: #93c5fd;
  text-decoration: none;
  font-weight: 500;
}

.bs-auth-link:hover {
  text-decoration: underline;
}

.bs-auth-error {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 10px;
  padding: 0.6rem 0.8rem;
  text-align: center;
  margin-bottom: 1rem;
  font-size: 0.85rem;
}

.bs-auth-submit {
  background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%) !important;
  border: none !important;
  border-radius: 12px !important;
  padding: 0.85rem 1.25rem !important;
  font-weight: 700 !important;
  font-size: 0.95rem !important;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}

.bs-auth-footer {
  margin-top: 1.35rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: #94a3b8;
  gap: 0.5rem;
}

.bs-auth-footer-links {
  display: flex;
  gap: 0.85rem;
}

.bs-auth-footer-links a {
  color: #cbd5e1;
  text-decoration: none;
}

.bs-auth-footer-links a:hover {
  color: #ffffff;
  text-decoration: underline;
}

/* Primary Buttons */
.btn-primary {
  background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
  border: none;
  border-radius: 12px;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #4338ca 100%);
}

/* Framed Streak Card inside white widget card */
#streak-hero-container {
  border-radius: 22px !important;
  border: 4px solid #ffffff !important;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.22) !important;
}

/* =========================================================
   Mockup 1:1 Layout — Navbar, Hero Combo Card & Recent List
   ========================================================= */

.bs-app-shell {
  max-width: 1020px;
  padding: 1.5rem 1.25rem 4rem;
}

.bs-navbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.15rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.bs-navbar-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.bs-nav-logo-pill {
  background: #ffffff;
  border-radius: 14px;
  padding: 0.45rem 0.9rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.bs-nav-logo-pill #main-logo {
  height: 28px;
  max-height: 28px;
  width: auto;
  margin: 0;
  display: block;
}

.bs-navbar .bs-main-nav {
  margin: 0;
  padding: 0.25rem;
  border-radius: 13px;
  display: inline-flex;
  flex-wrap: wrap;
  width: auto;
}

.bs-navbar .bs-main-nav .nav-item {
  padding: 0.45rem 0.9rem;
  font-size: 0.82rem;
  border-radius: 10px;
}

.bs-navbar-right {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: #cbd5e1;
}

/* Hero Combo Card (exact Mockup layout) */
.bs-combo-card {
  padding: 1.25rem !important;
  display: grid;
  grid-template-columns: minmax(250px, 5fr) 7fr;
  gap: 1.5rem;
  align-items: stretch;
}

@media (max-width: 760px) {
  .bs-combo-card {
    grid-template-columns: 1fr;
  }
}

.bs-streak-photo-card {
  position: relative;
  border-radius: 18px !important;
  overflow: hidden;
  background-color: #162447;
  background-size: cover;
  background-position: center;
  min-height: 245px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.14),
    0 10px 24px rgba(15, 23, 42, 0.22) !important;
  border: none !important;
}

.bs-streak-photo-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(
      circle at 30% 25%,
      rgba(255, 255, 255, 0.16),
      transparent 55%
    ),
    linear-gradient(to top, rgba(0, 0, 0, 0.52), rgba(0, 0, 0, 0.18));
  z-index: 1;
}

.bs-streak-photo-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 1.25rem;
}

.bs-streak-eyebrow {
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.95);
  text-transform: uppercase;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.55);
}

.bs-streak-big-num {
  font-size: 5rem;
  font-weight: 900;
  line-height: 1;
  color: #ffffff;
  margin: 0.25rem 0 0.1rem;
  text-shadow: 0 6px 18px rgba(0, 0, 0, 0.55);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.bs-streak-unit {
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 3px;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 0.75rem;
}

.bs-streak-today-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.48);
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 0.76rem;
  font-weight: 700;
  color: #34d399;
  backdrop-filter: blur(6px);
}

.bs-streak-today-pill.pending {
  color: #fbbf24;
}

.bs-combo-right {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0.25rem 0.25rem;
}

.bs-combo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid #f1f5f9;
}

.bs-combo-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #94a3b8;
}

.bs-combo-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
}

.bs-sync-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border-radius: 12px;
  border: none;
  background: #eff6ff;
  color: #2563eb;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}

.bs-sync-pill-btn:hover {
  background: #dbeafe;
}

.bs-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin: 1rem 0;
}

@media (max-width: 600px) {
  .bs-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.bs-kpi-tile {
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  border-radius: 16px;
  padding: 0.8rem;
}

.bs-kpi-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.74rem;
  font-weight: 600;
  color: #64748b;
}

.bs-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #cbd5e1;
  display: inline-block;
}

.bs-dot.green {
  background: #10b981;
}
.bs-dot.red {
  background: #ef4444;
}

.bs-kpi-val {
  font-size: 1.45rem;
  font-weight: 800;
  color: #0f172a;
  margin-top: 0.25rem;
}

.bs-kpi-unit {
  font-size: 0.75rem;
  font-weight: 600;
  color: #94a3b8;
}

.bs-combo-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid #f1f5f9;
  font-size: 0.76rem;
  color: #64748b;
}

.bs-source-pills {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.bs-source-pill {
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.74rem;
}

.bs-source-pill.strava {
  background: #fff7ed;
  color: #ea580c;
}

.bs-status-inline {
  font-weight: 600;
}

/* Dark Glass Recent Activities Card */
.bs-dark-glass-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(14px);
  border-radius: 20px;
  padding: 1.25rem 1.4rem;
  color: #f8fafc;
}

.bs-dark-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.bs-dark-card-head h3 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  color: #ffffff;
}

.bs-dark-card-head span {
  font-size: 0.76rem;
  color: #94a3b8;
}

.bs-recent-list {
  display: flex;
  flex-direction: column;
}

.bs-recent-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.bs-recent-row:first-child {
  border-top: none;
}

.bs-recent-left {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.bs-recent-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(249, 115, 22, 0.2);
  color: #fdba74;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.bs-recent-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: #ffffff;
}

.bs-recent-sub {
  font-size: 0.76rem;
  color: #94a3b8;
}

.bs-recent-right {
  text-align: right;
  flex-shrink: 0;
}

.bs-recent-metric {
  font-weight: 700;
  font-size: 0.9rem;
  color: #ffffff;
}

.bs-recent-empty {
  color: #94a3b8;
  font-size: 0.85rem;
  padding: 1rem 0;
  text-align: center;
}

/* App-only note (when web_access == false) & Legal Footer */
.bs-app-only-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.85rem 1.15rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-size: 0.84rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

.bs-app-only-note strong {
  color: #ffffff;
}

.bs-legal-footer {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: #94a3b8;
}

.bs-legal-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.bs-legal-links a {
  color: #cbd5e1;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
}

.bs-legal-links a:hover {
  color: #ffffff;
  text-decoration: underline;
}
