/**
 * ATHLYTX DASHBOARD STYLES
 * Converted from inline styles to use design system tokens
 * Version: 2.0.0
 */

/* ============================================
   BODY & LAYOUT OVERRIDES
   ============================================ */

html {
  height: 100%;
}

body {
  background: linear-gradient(135deg, #0a0e27 0%, #1e2659 30%, #2c1810 70%, #0f0a1a 100%) !important;
  background-attachment: fixed !important;
  background-size: cover !important;
  background-repeat: no-repeat !important;
  min-height: 100vh;
  width: 100%;
  color: white;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  padding-top: 80px; /* Account for fixed header */
  padding-bottom: 80px; /* Account for fixed footer - much smaller now */
}

.dashboard {
  flex: 1 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 80px - 80px); /* Full height minus header and footer */
}

.container {
  width: 100%;
  max-width: 1600px;
  padding: 0 var(--space-4);
}

/* ============================================
   READINESS STATUS HERO
   ============================================ */

.readiness-status-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  margin-bottom: var(--space-10);
  padding-top: var(--space-2);
  padding-bottom: 0;
}

.readiness-icon {
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.9);
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
  animation: pulse 2s ease-in-out infinite;
}

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

.readiness-icon.optimal {
  color: #10b981;
}

.readiness-icon.good {
  color: #3b82f6;
}

.readiness-icon.moderate {
  color: #f59e0b;
}

.readiness-icon.low {
  color: #ef4444;
}

.readiness-text {
  text-align: left;
}

.readiness-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 4px;
}

.readiness-message {
  font-size: 20px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
  line-height: 1.3;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ============================================
   SCORE HERO SECTION - RESPONSIVE
   ============================================ */

.score-hero-section {
  margin: 20px 0 20px 0;
}

.score-hero-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
}

.metrics-side-card {
  background: rgba(255,255,255,0.08);
  padding: 16px 24px;
  border-radius: 12px;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.1);
  min-width: 120px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.metric-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.metric-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: rgba(255,255,255,0.95);
  line-height: 1;
}

.metric-label {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.6);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-divider {
  height: 1px;
  background: rgba(255,255,255,0.1);
  margin: 4px 0;
}

.score-center {
  text-align: center;
  flex-shrink: 0;
}

.score-circle-wrapper {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 0 auto 20px auto;
}

.score-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.score-ring-bg {
  fill: none;
  stroke: rgba(255,255,255,0.1);
  stroke-width: 12;
}

.score-ring-progress {
  fill: none;
  /* stroke color is set dynamically by JavaScript based on score */
  stroke-width: 12;
  stroke-linecap: round;
  stroke-dasharray: 565;
  stroke-dashoffset: 565;
  transition: stroke-dashoffset 1s ease-out, stroke 0.3s ease;
}

.score-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.score-number {
  font-size: 6rem;
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(135deg, #667eea, #764ba2, #f093fb);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.score-max {
  font-size: 0.85rem;
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 600;
}

.score-status-container {
  max-width: 300px;
  margin: 0 auto;
}

.score-status-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.95);
}

.score-insight {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.4;
}

.score-badge-container {
  text-align: center;
  margin-top: 24px;
}

.data-sources-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  padding: 8px 16px;
  background: rgba(0,0,0,0.2);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.confidence-tip {
  margin-top: 8px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.75);
}
.confidence-tip .confidence-cta {
  color: #93c5fd;
  text-decoration: underline;
  cursor: pointer;
}
.data-sources-badge[data-tooltip]:hover::after,
.data-sources-badge [data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.85);
  color: #fff;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.75rem;
  line-height: 1.3;
  width: 240px;
  text-align: center;
  pointer-events: none;
  z-index: 10;
}

/* Position readiness on desktop - above the score */
.score-hero-container .readiness-status-hero {
  position: absolute;
  top: -70px;
  left: 50%;
  transform: translateX(-50%);
  width: auto;
  min-width: 400px;
}

.score-hero-section {
  position: relative;
}

@media (max-width: 768px) {
  .score-hero-section {
    margin-top: 100px; /* Ensure it clears the fixed header with breathing room */
  }

  .score-hero-container {
    flex-direction: column;
    gap: 0;
    padding: 0 16px;
  }

  /* Reset readiness positioning on mobile - make it part of flex flow */
  .score-hero-container .readiness-status-hero {
    position: static;
    transform: none;
    left: auto;
    top: auto;
    min-width: auto;
  }

  /* Mobile order: Score -> Readiness -> Recovery/Strain -> Sleep/HRV */
  .score-center {
    order: 1;
    margin-bottom: 24px;
  }

  .readiness-status-hero {
    order: 2;
    width: 100%;
    max-width: 320px;
    margin: 0 0 20px 0;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    gap: 12px;
  }

  .readiness-icon {
    width: 36px;
    height: 36px;
  }

  .readiness-icon svg {
    width: 100%;
    height: 100%;
  }

  .readiness-label {
    font-size: 10px;
    margin-bottom: 2px;
    letter-spacing: 0.8px;
  }

  .readiness-message {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.25;
  }

  .metrics-side-card:first-child {
    order: 3; /* Recovery/Strain after readiness */
    margin-top: 0;
  }

  .metrics-side-card:last-child {
    order: 4; /* Sleep/HRV last */
    margin-top: 16px;
  }

  .metrics-side-card {
    width: 100%;
    max-width: 320px;
    padding: 14px 20px;
    flex-direction: row;
    justify-content: space-around;
  }

  .metric-divider {
    width: 1px;
    height: auto;
    margin: 0;
  }

  .score-circle-wrapper {
    width: 220px;
    height: 220px;
  }

  .score-number {
    font-size: 6.5rem;
  }

  .score-max {
    font-size: 0.85rem;
  }

  .score-status-title {
    font-size: 1.1rem;
  }

  .score-insight {
    font-size: 0.85rem;
  }

  .metric-value {
    font-size: 1.6rem;
  }

  .metric-label {
    font-size: 0.65rem;
  }
}

@media (max-width: 480px) {
  .score-circle-wrapper {
    width: 200px;
    height: 200px;
  }

  .score-number {
    font-size: 5.5rem;
  }

  .score-max {
    font-size: 0.8rem;
  }

  .metrics-side-card {
    max-width: 280px;
    padding: 12px 16px;
  }

  .metric-value {
    font-size: 1.4rem;
  }

  .metric-label {
    font-size: 0.6rem;
  }

  .score-status-title {
    font-size: 1rem;
  }

  .score-insight {
    font-size: 0.8rem;
  }
}

/* ============================================
   GARMIN TAB RESPONSIVE
   ============================================ */

/* Garmin Hero Stats Grid - Make responsive */
#garmin > div[style*="grid-template-columns: repeat(4, 1fr)"] {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 16px !important;
}

@media (max-width: 1200px) {
  #garmin > div[style*="grid-template-columns: repeat(4, 1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }
}

@media (max-width: 768px) {
  #garmin > div[style*="grid-template-columns: repeat(4, 1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  /* Shrink stat cards on mobile with proper spacing */
  #garmin > div[style*="grid-template-columns"] > div {
    padding: 12px 14px !important;
    min-height: auto !important;
  }

  /* Label - smaller and tighter */
  #garmin > div[style*="grid-template-columns"] > div > div[style*="font-size: 0.85rem"] {
    font-size: 0.65rem !important;
    margin-bottom: 6px !important;
    line-height: 1.2 !important;
  }

  /* Value - prominent but not huge */
  #garmin > div[style*="grid-template-columns"] > div > div[style*="font-size: 2.5rem"] {
    font-size: 1.6rem !important;
    margin-bottom: 2px !important;
    line-height: 1 !important;
  }

  /* Subtitle - compact */
  #garmin > div[style*="grid-template-columns"] > div > div[style*="font-size: 0.9rem"] {
    font-size: 0.7rem !important;
    line-height: 1.2 !important;
    margin-top: 2px !important;
  }

  /* Hide background icons on mobile - reduces clutter */
  #garmin > div[style*="grid-template-columns"] > div > i.fas {
    display: none !important;
  }
}

@media (max-width: 480px) {
  #garmin > div[style*="grid-template-columns: repeat(4, 1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  /* Compact 2x2 grid on small mobile */
  #garmin > div[style*="grid-template-columns"] > div {
    padding: 10px 12px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    min-height: auto !important;
  }

  /* Very compact but readable font sizes for 2x2 */
  #garmin > div[style*="grid-template-columns"] > div > div[style*="font-size: 0.85rem"] {
    font-size: 0.6rem !important;
    margin-bottom: 4px !important;
    line-height: 1.1 !important;
  }

  #garmin > div[style*="grid-template-columns"] > div > div[style*="font-size: 2.5rem"] {
    font-size: 1.5rem !important;
    margin-bottom: 2px !important;
    line-height: 1 !important;
  }

  #garmin > div[style*="grid-template-columns"] > div > div[style*="font-size: 0.9rem"] {
    font-size: 0.65rem !important;
    line-height: 1.2 !important;
    margin-top: 2px !important;
  }

  /* Make Garmin header more compact on mobile */
  #garmin > div[style*="background: linear-gradient(135deg, rgba(0,112,192"] {
    padding: 16px !important;
    margin-bottom: 16px !important;
  }

  #garmin > div[style*="background: linear-gradient(135deg, rgba(0,112,192"] img {
    height: 36px !important;
  }

  #garmin > div[style*="background: linear-gradient(135deg, rgba(0,112,192"] > div[style*="font-size: 11px"] {
    font-size: 9px !important;
    margin-bottom: 8px !important;
  }
}

/* Analytics grid responsive for all tabs including Garmin */
@media (max-width: 768px) {
  .analytics-grid {
    grid-template-columns: 1fr !important;
    gap: var(--space-4) !important;
  }

  /* Activities list should not span on mobile */
  .analytics-grid > .analytics-card[style*="grid-column: span 2"] {
    grid-column: span 1 !important;
  }
}

@media (max-width: 768px) {
  /* Make container flex so we can reorder children on mobile */
  .dashboard .container {
    display: flex;
    flex-direction: column;
  }

  /* Mobile order: Score section (containing score + readiness inside + metrics) -> Tabs */
  .score-hero-section {
    order: 1;
  }

  /* Tab nav and content should come after score section */
  .tab-nav-wrapper {
    order: 2;
  }

  .tab-content-wrapper {
    order: 3;
  }

  .readiness-text {
    text-align: center;
  }

  .readiness-message {
    font-size: 16px;
  }
}

/* ============================================
   MAIN LOGO (ABOVE TABS)
   ============================================ */

.main-logo-container {
  text-align: center;
  margin-bottom: var(--space-8);
  padding-top: 0;
}

.main-logo {
  height: 120px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
  transition: transform var(--duration-normal) var(--ease-out);
}

.main-logo:hover {
  transform: scale(1.02);
}

@media (max-width: 768px) {
  .main-logo {
    height: 80px;
  }

  /* Mobile tabs: make them horizontally scrollable, bigger touch targets */
  .tab-nav-wrapper {
    position: sticky;
    top: 64px;
    z-index: 900;
    background: var(--glass-2);
    padding: 6px 8px;
    border-bottom: 1px solid var(--border-1);
  }

  .tab-nav {
    gap: 6px;
    overflow-x: auto;
    padding: 4px;
    scroll-snap-type: x mandatory;
  }

  .tab-button {
    flex: 0 0 auto;
    padding: 10px 14px;
    font-size: 14px;
    scroll-snap-align: start;
    border-radius: 10px;
  }

  .tab-scroll-indicator { display: none; }

  /* Move Athlytx score higher and enlarge on mobile */
  .score-hero-section {
    margin-top: 8px;
  }

  .score-circle-wrapper {
    transform: scale(1.1);
  }

  .score-number {
    font-size: 56px;
  }

  .score-max {
    font-size: 14px;
  }
}

/* ============================================
   FIXED HEADER
   ============================================ */

.main-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--glass-2);
  backdrop-filter: blur(var(--blur-xl));
  -webkit-backdrop-filter: blur(var(--blur-xl));
  border-bottom: 1px solid var(--border-1);
  box-shadow: var(--shadow-lg);
}

.header-container {
  max-width: 1600px;
  margin: 0 auto;
  padding: var(--space-2) var(--space-6);
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: var(--space-4);
  position: relative;
}

.header-left {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex: 0 0 auto;
}

.header-logo {
  height: 50px;
  width: auto;
  object-fit: contain;
}

.header-tagline {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  white-space: nowrap;
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* Hamburger Menu Button (Mobile Only) */
.hamburger-btn {
  display: none; /* Hidden by default on desktop */
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 24px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
  transition: transform 0.3s ease;
}

.hamburger-line {
  width: 100%;
  height: 3px;
  background-color: white;
  border-radius: 2px;
  transition: all 0.3s ease;
  transform-origin: center;
}

/* Hamburger animation when menu is open */
.hamburger-btn.active .hamburger-line:nth-child(1) {
  transform: translateY(10.5px) rotate(45deg);
}

.hamburger-btn.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.hamburger-btn.active .hamburger-line:nth-child(3) {
  transform: translateY(-10.5px) rotate(-45deg);
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
  .hamburger-btn {
    display: flex;
    order: 3; /* Move to the right */
    margin-left: auto;
  }

  .header-left {
    order: 1;
    flex: 0 0 auto;
  }

  .header-right {
    position: fixed;
    top: 70px; /* Below header */
    left: 0;
    right: 0;
    background: linear-gradient(135deg, rgba(10,14,39,0.98) 0%, rgba(30,38,89,0.98) 50%, rgba(44,24,16,0.98) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(102,126,234,0.3);
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-3);
    padding: var(--space-6) var(--space-5);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    order: 2;
  }

  .header-right.mobile-menu-open {
    max-height: calc(100vh - 70px);
    opacity: 1;
    overflow-y: auto;
    padding-bottom: var(--space-8);
  }

  /* Mobile-optimized menu items */
  .header-right > * {
    width: 100%;
    margin-bottom: 0;
  }

  /* Status badges - Stack them nicely */
  .readiness-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 20px;
    font-size: 1rem;
    border-radius: 12px;
    background: rgba(102,126,234,0.15);
    border: 1px solid rgba(102,126,234,0.3);
    margin-bottom: var(--space-3);
    min-height: 56px; /* Touch-friendly */
  }

  #garminHeaderBadge {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 20px;
    font-size: 1rem;
    border-radius: 12px;
    margin-bottom: var(--space-3);
    min-height: 56px; /* Touch-friendly */
  }

  /* Action buttons - Large touch targets */
  .header-right button {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 16px 20px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px;
    min-height: 56px; /* Touch-friendly */
    transition: all 0.2s ease;
    border: 1px solid rgba(255,255,255,0.1);
  }

  .header-right button:active {
    transform: scale(0.98);
  }

  .sync-btn {
    background: linear-gradient(135deg, rgba(16,185,129,0.2), rgba(5,150,105,0.2));
    border-color: rgba(16,185,129,0.4);
  }

  .refresh-btn {
    background: rgba(59,130,246,0.15);
    border-color: rgba(59,130,246,0.3);
  }

  /* Navigation links - Card style */
  .header-right .nav-link {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 16px 20px;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    min-height: 56px;
    transition: all 0.2s ease;
    text-decoration: none;
    color: rgba(255,255,255,0.9);
  }

  .header-right .nav-link:active {
    transform: scale(0.98);
    background: rgba(255,255,255,0.1);
  }

  /* Elite button - Premium style */
  .header-right .elite-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px 24px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 12px;
    min-height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 20px rgba(102,126,234,0.4);
    border: none;
    margin-top: var(--space-4);
    transition: all 0.2s ease;
  }

  .header-right .elite-btn:active {
    transform: scale(0.98);
    box-shadow: 0 2px 10px rgba(102,126,234,0.3);
  }

  /* Divider between sections */
  .header-right .sync-btn {
    margin-top: var(--space-4);
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: var(--space-4);
  }

  .header-container {
    padding: var(--space-3) var(--space-4);
    gap: var(--space-3);
  }

  .header-logo {
    height: 36px;
  }

  /* Smooth scrolling for mobile menu */
  .header-right.mobile-menu-open {
    -webkit-overflow-scrolling: touch;
  }
}

.readiness-pill {
  display: inline-block;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: var(--glass-3);
  backdrop-filter: blur(var(--blur-md));
  -webkit-backdrop-filter: blur(var(--blur-md));
  border: 1px solid var(--border-1);
  color: white;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

.elite-btn {
  display: inline-block;
  background: var(--gradient-primary);
  color: white;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: var(--radius-lg);
  font-weight: var(--weight-medium);
  font-size: var(--text-sm);
  box-shadow: var(--glow-primary);
  transition: all var(--duration-normal) var(--ease-out);
}

.elite-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--glow-brand);
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  transition: color var(--duration-fast) var(--ease-out);
}

.nav-link:hover {
  color: var(--text-primary);
}

/* Old header styles - deprecated */
.header {
  text-align: center;
  margin-bottom: var(--space-10);
  padding: var(--space-8) var(--space-5);
  display: none; /* Hidden since we're using .main-header now */
}

.header h1 {
  font-size: var(--text-5xl);
  color: white;
  margin-bottom: var(--space-4);
  font-weight: var(--weight-black);
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.header p {
  color: white;
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

/* ============================================
   TOP NAVIGATION
   ============================================ */

.top-nav {
  position: fixed;
  top: var(--space-4);
  left: var(--space-4);
  display: flex;
  gap: var(--space-2);
  z-index: var(--z-modal);
  flex-wrap: wrap;
}

.nav-link {
  background: var(--glass-2);
  backdrop-filter: blur(var(--blur-lg));
  -webkit-backdrop-filter: blur(var(--blur-lg));
  border: 1px solid var(--border-1);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  cursor: pointer;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: white;
  box-shadow: var(--shadow-sm);
  transition: all var(--duration-normal) var(--ease-out);
  text-decoration: none;
  display: inline-block;
  white-space: nowrap;
}

.nav-link:hover {
  background: var(--glass-3);
  border-color: var(--border-2);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ============================================
   DEVICE CARDS
   ============================================ */

.devices-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.device-card {
  background: var(--glass-2);
  backdrop-filter: blur(var(--blur-lg));
  -webkit-backdrop-filter: blur(var(--blur-lg));
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  border: 1px solid var(--border-1);
  box-shadow: var(--shadow-lg);
  transition: transform var(--duration-normal) var(--ease-out),
              box-shadow var(--duration-normal) var(--ease-out),
              background var(--duration-moderate) var(--ease-out),
              border var(--duration-moderate) var(--ease-out);
}

.device-card:hover {
  background: var(--glass-3);
  border-color: var(--border-2);
  box-shadow: var(--shadow-xl);
}

.device-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.device-icon {
  width: 55px;
  height: 55px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: var(--text-lg);
}

.device-icon img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.device-info h3 {
  color: var(--text-primary);
  font-size: var(--text-lg);
  margin-bottom: var(--space-1);
}

.device-info p {
  color: var(--text-secondary);
  font-size: var(--text-xs);
}

/* ============================================
   BUTTONS
   ============================================ */

.connect-btn {
  width: 100%;
  padding: var(--space-3) var(--space-5);
  border: none;
  border-radius: var(--radius-lg);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
}

.btn-whoop { background: var(--brand-whoop); }
.btn-garmin { background: var(--brand-garmin); }
.btn-oura { background: var(--brand-oura); }
.btn-strava { background: var(--brand-strava); }

.connect-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.connect-btn:active {
  transform: translateY(-1px) scale(0.98);
}

.disconnect-btn {
  width: 100%;
  padding: var(--space-2) var(--space-4);
  border: 2px solid rgba(220, 38, 38, 0.7);
  border-radius: var(--radius-md);
  background: var(--color-error-bg);
  backdrop-filter: blur(var(--blur-md));
  -webkit-backdrop-filter: blur(var(--blur-md));
  color: var(--text-primary);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
  font-size: var(--text-sm);
}

.disconnect-btn:hover {
  background: rgba(220, 38, 38, 0.8);
  border-color: rgba(220, 38, 38, 0.9);
  color: white;
}

.refresh-btn {
  background: var(--glass-2);
  backdrop-filter: blur(var(--blur-lg));
  -webkit-backdrop-filter: blur(var(--blur-lg));
  border: 1px solid var(--border-1);
  padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-full);
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: white;
  box-shadow: var(--shadow-sm);
  transition: all var(--duration-normal) var(--ease-out);
}

.refresh-btn:hover {
  background: var(--glass-3);
  border-color: var(--border-2);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ============================================
   ANALYTICS CARDS
   ============================================ */

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.analytics-card {
  background: var(--glass-2);
  backdrop-filter: blur(var(--blur-lg));
  -webkit-backdrop-filter: blur(var(--blur-lg));
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-1);
  margin-bottom: var(--space-5);
}

.analytics-card h3 {
  color: var(--text-primary);
  margin-bottom: var(--space-3);
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
}

.analytics-card {
  color: var(--text-secondary);
}

/* ============================================
   AI INSIGHTS CARD STYLING
   ============================================ */

.ai-insights-hero {
  position: relative;
  overflow: hidden;
}

.ai-insights-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #667eea 0%, #10b981 100%);
  box-shadow: 0 2px 12px rgba(102, 126, 234, 0.4);
}

.ai-insights-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding-top: 8px;
}

.ai-icon-large {
  flex-shrink: 0;
  filter: drop-shadow(0 4px 12px rgba(102, 126, 234, 0.3));
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-8px);
  }
}

.ai-insights-header h3 {
  margin: 0;
  background: linear-gradient(135deg, #667eea 0%, #10b981 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 24px;
  font-weight: 700;
}

.ai-insight-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  margin: 10px 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-insight-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(102, 126, 234, 0.3);
  transform: translateX(4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.ai-insight-icon {
  font-size: 32px;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.ai-insight-content {
  flex: 1;
}

.ai-insight-content strong {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 8px;
  letter-spacing: 0.3px;
}

.ai-insight-content p {
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.75);
  margin: 0;
}

/* ============================================
   DATA SUMMARY
   ============================================ */

.data-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.summary-card {
  background: var(--glass-2);
  backdrop-filter: blur(var(--blur-lg));
  -webkit-backdrop-filter: blur(var(--blur-lg));
  border: 1px solid var(--border-1);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  text-align: center;
  position: relative;
}

.summary-value {
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  color: var(--color-primary);
  display: block;
}

.summary-label {
  color: var(--text-secondary);
  font-size: var(--text-xs);
  margin-top: var(--space-1);
}

/* ============================================
   CHART CONTAINER
   ============================================ */

.chart-container {
  width: 100%;
  height: 240px;
  margin-top: var(--space-3);
}

/* ============================================
   DATA CONNECTIONS
   ============================================ */

.data-connections {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
  background: var(--glass-2);
  backdrop-filter: blur(var(--blur-lg));
  -webkit-backdrop-filter: blur(var(--blur-lg));
  border: 1px solid var(--border-1);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
}

.connection-badge {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
}

.connection-badge.connected {
  background: transparent;
  color: inherit;
}

.connection-badge.disconnected {
  background: transparent;
  color: inherit;
}

/* ============================================
   INSIGHT CARDS
   ============================================ */

.insight-card {
  background: var(--glass-3);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  margin: var(--space-2) 0;
  border-left: 4px solid var(--color-success);
}

.insight-card h4 {
  color: var(--text-primary);
  margin-bottom: var(--space-2);
  font-size: var(--text-lg);
}

.insight-card p {
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
}

/* Tab-specific insight card styling */
#running .insight-card h4,
#oura .insight-card h4,
#strava .insight-card h4,
#whoop .insight-card h4 {
  color: var(--text-primary);
}

#running .insight-card p,
#oura .insight-card p,
#strava .insight-card p,
#whoop .insight-card p {
  color: var(--text-secondary);
}

/* Insight card variants */
.insight-card.high {
  border-left-color: var(--color-error);
  background: var(--color-error-bg);
}

.insight-card.positive {
  border-left-color: var(--color-success);
  background: var(--color-success-bg);
}

.insight-card.medium {
  border-left-color: var(--color-warning);
  background: var(--color-warning-bg);
}

/* Insight category filter dropdown */
#insightCategoryFilter {
  background: var(--glass-3);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-base);
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
}

#insightCategoryFilter:hover {
  background: var(--glass-4);
  border-color: var(--border-2);
}

#insightCategoryFilter:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(103, 126, 234, 0.2);
}

#insightCategoryFilter option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* ============================================
   FOOTER
   ============================================ */

/* Old footer - deprecated */
.footer {
  display: none;
}

/* ============================================
   FIXED FOOTER
   ============================================ */

.main-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 999;
  background: var(--glass-2);
  backdrop-filter: blur(var(--blur-xl));
  -webkit-backdrop-filter: blur(var(--blur-xl));
  border-top: 1px solid var(--border-1);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
  padding: var(--space-3) var(--space-4);
  text-align: center;
}

.footer-brands {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  margin-bottom: var(--space-2);
}

.footer-brands-label {
  font-size: 10px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: var(--weight-medium);
}

.footer-brands-logos {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.brand-logo {
  height: 24px;
  object-fit: contain;
  border-radius: var(--radius-md);
  transition: transform var(--duration-fast) var(--ease-out);
  opacity: 0.8;
}

.brand-logo:hover {
  transform: scale(1.05);
  opacity: 1;
}

.brand-logo-garmin {
  height: 28px;
}

.brand-logo-strava {
  height: 16px;
}

.brand-logo-whoop {
  height: 16px;
  filter: invert(1) brightness(2);
}

.brand-logo-oura {
  height: 24px;
}

.brand-separator {
  color: var(--text-tertiary);
  font-size: var(--text-sm);
  opacity: 0.5;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: var(--space-4);
  margin-bottom: var(--space-2);
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-tertiary);
  text-decoration: none;
  font-weight: var(--weight-normal);
  font-size: 11px;
  transition: color var(--duration-fast) var(--ease-out);
}

.footer-links a:hover {
  color: var(--text-secondary);
}

.footer-text {
  color: var(--text-tertiary);
  font-size: 10px;
  font-weight: var(--weight-normal);
  opacity: 0.7;
}

/* ============================================
   RUNNING TAB SPECIFIC STYLES
   ============================================ */

.trend-arrow {
  position: absolute;
  bottom: var(--space-5);
  right: var(--space-5);
  font-weight: bold;
  font-size: var(--text-xl);
}

.trend-arrow.up {
  color: var(--color-success);
}

.trend-arrow.down {
  color: var(--color-error);
}

.trend-arrow.neutral {
  color: var(--text-tertiary);
}

.record-item {
  padding: var(--space-4);
  border-bottom: 1px solid var(--border-1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-secondary);
}

.record-item strong {
  color: var(--text-primary);
}

.record-badge {
  background: var(--color-success);
  color: white;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
}

/* ============================================
   ERROR & LOADING STATES
   ============================================ */

.error-state {
  background: var(--color-error-bg);
  border: 2px solid rgba(220, 38, 38, 0.3);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  text-align: center;
  color: var(--color-error);
}

.loading-state {
  text-align: center;
  padding: var(--space-10);
  color: var(--text-secondary);
}

.loading-spinner {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 3px solid var(--glass-2);
  border-radius: var(--radius-full);
  border-top-color: var(--color-primary);
  animation: spin var(--duration-slow) ease-in-out infinite;
}

/* ============================================
   MOBILE RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
  html, body {
    background: linear-gradient(135deg, #0a0e27 0%, #1e2659 30%, #2c1810 70%, #0f0a1a 100%) !important;
  }

  .container {
    padding: var(--space-2);
    padding-top: 70px;
  }

  .header {
    padding: var(--space-5) var(--space-2);
    margin-bottom: var(--space-5);
  }

  .header img {
    height: 120px !important;
    margin-bottom: var(--space-4);
    max-width: 85%;
    object-fit: contain;
  }

  .header p {
    font-size: var(--text-base);
  }

  .top-nav {
    position: fixed;
    top: var(--space-2);
    left: var(--space-2);
    display: flex;
    gap: var(--space-1);
    z-index: var(--z-modal);
  }

  div[style*="position: fixed"] {
    position: fixed !important;
    top: 10px !important;
    right: 10px !important;
    display: flex !important;
    gap: 5px !important;
    z-index: 1000 !important;
  }

  .nav-link {
    padding: var(--space-2) var(--space-2);
    font-size: 11px;
    border-radius: var(--radius-md);
  }

  .refresh-btn {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-xs);
    border-radius: var(--radius-md);
  }

  .devices-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .device-card {
    padding: var(--space-5);
  }

  .analytics-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .analytics-card {
    padding: var(--space-5);
    margin-bottom: var(--space-4);
  }

  .analytics-card h3 {
    font-size: var(--text-xl);
  }

  .data-summary {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-2);
  }

  .summary-card {
    padding: var(--space-4);
  }

  .summary-value {
    font-size: var(--text-2xl);
  }

  .summary-label {
    font-size: var(--text-xs);
  }

  .chart-container {
    height: 250px;
  }

  #athlytxScore {
    font-size: 3rem !important;
  }

  #scoreStatus {
    font-size: 1rem !important;
  }

  .footer {
    margin-top: var(--space-10);
    padding: var(--space-4);
  }

  .footer-links {
    gap: var(--space-4);
  }

  .footer-links a {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
  }

  .connect-btn, .refresh-btn {
    min-height: 44px;
  }

  #stravaActivitiesList table {
    font-size: var(--text-xs);
  }

  #stravaActivitiesList th,
  #stravaActivitiesList td {
    padding: var(--space-2);
  }
}

@media (max-width: 480px) {
  .top-nav {
    top: var(--space-1);
    left: var(--space-1);
  }

  div[style*="position: fixed"] {
    top: 5px !important;
    right: 5px !important;
  }

  .nav-link, .refresh-btn {
    padding: var(--space-1) var(--space-2);
    font-size: 10px;
  }

  .container {
    padding-top: 60px;
  }

  .data-summary {
    grid-template-columns: 1fr;
  }

  .header img {
    height: 100px !important;
    max-width: 80%;
    object-fit: contain;
  }

  .header p {
    font-size: var(--text-sm);
  }
}

/* ============================================
   MICRO-ANIMATIONS & INTERACTIONS
   60fps GPU-accelerated animations
   ============================================ */

/* ===== RIPPLE EFFECT ===== */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: scale(0);
    animation: ripple-animation 0.6s ease-out;
    pointer-events: none;
    z-index: 10;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ===== BUTTON SCALE ON CLICK ===== */
.btn-scale-click {
    animation: btn-scale 0.2s ease;
}

@keyframes btn-scale {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.95);
    }
    100% {
        transform: scale(1);
    }
}

/* Ensure buttons can be animated */
button,
.connect-btn,
.disconnect-btn,
.refresh-btn,
.nav-tab {
    position: relative;
    overflow: hidden;
    will-change: transform;
}

/* ===== ICON ROTATION (REFRESH BUTTON) ===== */
.icon-rotate-hover {
    transition: transform 0.3s ease;
}

.icon-rotate-hover:hover {
    transform: rotate(180deg);
}

.icon-rotate-active {
    animation: icon-spin 0.6s ease-in-out;
}

@keyframes icon-spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* ===== SHIMMER LOADING EFFECT ===== */
.shimmer-effect {
    position: relative;
    overflow: hidden;
}

.shimmer-effect::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.2) 50%,
        transparent 100%
    );
    animation: shimmer 1.5s ease-in-out;
    pointer-events: none;
    z-index: 10;
}

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

/* ===== ERROR SHAKE ANIMATION ===== */
.shake-error {
    animation: shake 0.6s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

/* ===== SUCCESS CHECKMARK ANIMATION ===== */
.success-checkmark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
    pointer-events: none;
}

.checkmark-svg {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: block;
    stroke-width: 3;
    stroke: #10b981;
    stroke-miterlimit: 10;
    box-shadow: inset 0px 0px 0px #10b981;
    animation: checkmark-fill 0.4s ease-in-out 0.4s forwards,
               checkmark-scale 0.3s ease-in-out 0.9s both;
}

.checkmark-circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 3;
    stroke-miterlimit: 10;
    stroke: #10b981;
    fill: rgba(16, 185, 129, 0.1);
    animation: checkmark-stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark-check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    stroke: #10b981;
    animation: checkmark-stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

@keyframes checkmark-stroke {
    100% {
        stroke-dashoffset: 0;
    }
}

@keyframes checkmark-scale {
    0%, 100% {
        transform: none;
    }
    50% {
        transform: scale3d(1.1, 1.1, 1);
    }
}

@keyframes checkmark-fill {
    100% {
        box-shadow: inset 0px 0px 0px 30px #10b981;
    }
}

/* ===== PULSE RING ANIMATION ===== */
.pulse-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border: 3px solid rgba(16, 185, 129, 0.8);
    border-radius: inherit;
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    animation: pulse-ring-animation 1.5s ease-out;
    pointer-events: none;
    z-index: 5;
}

@keyframes pulse-ring-animation {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

/* ===== CARD TILT EFFECT ===== */
.card-tilt {
    transform-style: preserve-3d;
    transition: transform 0.1s ease;
    will-change: transform;
}

/* Don't apply tilt on mobile devices */
@media (hover: none) {
    .card-tilt {
        transform: none !important;
    }
}

/* ===== TAB SWITCHING ANIMATIONS ===== */
.tab-content {
    display: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.tab-content.active {
    display: block;
    opacity: 1;
    animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== NAV TAB ANIMATIONS ===== */
.nav-tab {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-tab:not(.active):hover {
    transform: translateY(-2px);
}

.nav-tab.active {
    animation: tabActivate 0.3s ease;
}

@keyframes tabActivate {
    0% {
        transform: scale(0.95);
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
    }
}

/* ===== BOUNCE ANIMATION ===== */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.bounce {
    animation: bounce 0.6s ease;
}

/* ===== STATUS MESSAGE ANIMATIONS ===== */
.status-message {
    animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInRight {
    0% {
        transform: translateX(400px);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ===== DATA CARD ENTRANCE ANIMATIONS ===== */
.device-card,
.analytics-card,
.summary-card {
    animation: fadeInScale 0.5s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

.device-card:nth-child(1) { animation-delay: 0.05s; }
.device-card:nth-child(2) { animation-delay: 0.1s; }
.device-card:nth-child(3) { animation-delay: 0.15s; }
.device-card:nth-child(4) { animation-delay: 0.2s; }

@keyframes fadeInScale {
    0% {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ===== GLOW PULSE EFFECT ===== */
@keyframes glow-pulse {
    0%, 100% {
        box-shadow: 0 0 5px rgba(102, 126, 234, 0.5),
                    0 0 10px rgba(102, 126, 234, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.8),
                    0 0 30px rgba(102, 126, 234, 0.4);
    }
}

.glow-pulse {
    animation: glow-pulse 2s ease-in-out infinite;
}

/* ===== BUTTON INTERACTION CLASSES ===== */
.btn-hover-lift {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.btn-hover-lift:active {
    transform: translateY(0);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* ===== CHART ANIMATIONS ===== */
.chart-container {
    animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

/* ===== STATUS INDICATOR PULSE ===== */
.status-connected {
    position: relative;
}

.status-connected::before {
    content: '';
    position: absolute;
    top: -5px;
    right: -5px;
    width: 12px;
    height: 12px;
    background: #10b981;
    border-radius: 50%;
    animation: status-pulse 2s ease-in-out infinite;
}

@keyframes status-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
    }
}

/* ===== SMOOTH PAGE TRANSITIONS ===== */
body.animations-loaded {
    animation: pageLoad 0.6s ease;
}

@keyframes pageLoad {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

/* ===== HOVER GLOW FOR CARDS ===== */
.device-card:hover,
.analytics-card:hover {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4),
                0 0 20px rgba(102, 126, 234, 0.1);
}

/* ===== CONNECT BUTTON STATES ===== */
.connect-btn {
    position: relative;
}

.connect-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.1) 50%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.connect-btn:hover::before {
    opacity: 1;
    animation: shimmer 1.5s ease-in-out infinite;
}

/* ===== DATA REFRESH INDICATOR ===== */
.data-refreshing {
    position: relative;
    pointer-events: none;
}

.data-refreshing::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, #667eea, transparent);
    animation: loading-bar 1.5s ease-in-out infinite;
}

@keyframes loading-bar {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* ===== ACCESSIBILITY: PREFERS REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .ripple,
    .shimmer-effect::after,
    .pulse-ring,
    .success-checkmark {
        display: none !important;
    }

    .card-tilt {
        transform: none !important;
    }
}

/* ===== TOUCH DEVICE OPTIMIZATIONS ===== */
@media (hover: none) and (pointer: coarse) {
    /* Disable hover effects on touch devices */
    .icon-rotate-hover:hover {
        transform: none;
    }

    .btn-hover-lift:hover {
        transform: none;
        box-shadow: none;
    }

    /* Make tap targets larger */
    button,
    .connect-btn,
    .disconnect-btn,
    .refresh-btn,
    .nav-tab {
        min-height: 44px;
        min-width: 44px;
    }
}

/* ===== GPU ACCELERATION ===== */
button,
.connect-btn,
.disconnect-btn,
.refresh-btn,
.nav-tab,
.device-card,
.analytics-card,
.summary-card,
.tab-content {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */
.ripple,
.shimmer-effect::after,
.pulse-ring,
.success-checkmark {
    will-change: transform, opacity;
}

/* Remove will-change after animations load to save memory */
.animations-loaded button,
.animations-loaded .connect-btn,
.animations-loaded .disconnect-btn,
.animations-loaded .refresh-btn,
.animations-loaded .nav-tab {
    will-change: auto;
}

/* ===== FOCUS STYLES (ACCESSIBILITY) ===== */
button:focus-visible,
.connect-btn:focus-visible,
.disconnect-btn:focus-visible,
.refresh-btn:focus-visible,
.nav-tab:focus-visible {
    outline: 2px solid rgba(102, 126, 234, 0.8);
    outline-offset: 2px;
}

/* ============================================
   TAB NAVIGATION WRAPPER
   ============================================ */

.tab-nav-wrapper {
  position: relative;
  width: 100%;
  margin-top: 0;
  padding: var(--space-4) 0;
  z-index: 100;
  background: transparent;
}

.tab-nav {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  align-items: center;
  padding: 0 var(--space-4);
  flex-wrap: wrap;
}

.tab-button {
  background: var(--glass-2);
  backdrop-filter: blur(var(--blur-lg));
  -webkit-backdrop-filter: blur(var(--blur-lg));
  border: 1px solid var(--border-1);
  border-radius: var(--radius-full);
  padding: var(--space-3) var(--space-6);
  color: white;
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  white-space: nowrap;
}

.tab-button:hover {
  background: var(--glass-3);
  border-color: var(--border-2);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.tab-button.active {
  background: var(--glass-white-90);
  color: var(--color-primary);
  border-color: rgba(102, 126, 234, 0.5);
  box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
}

.tab-scroll-indicator {
  display: none;
}

/* ============================================
   TAB NAVIGATION COMPATIBILITY
   ============================================ */

/* Legacy tab support for backward compatibility */
.tab-content {
  display: none;
}

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

.nav-tabs {
  display: flex;
  justify-content: center;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
  flex-wrap: wrap;
}

.nav-tab {
  background: var(--glass-2);
  color: white;
  border: none;
  padding: var(--space-4) var(--space-8);
  border-radius: var(--radius-full);
  cursor: pointer;
  font-weight: var(--weight-semibold);
  transition: all var(--duration-moderate) var(--ease-out);
  backdrop-filter: blur(var(--blur-md));
  -webkit-backdrop-filter: blur(var(--blur-md));
}

.nav-tab.active {
  background: var(--glass-white-90);
  color: var(--color-primary);
}

/* Mobile tab navigation scrolling */
@media (max-width: 768px) {
  .nav-tabs,
  .tab-nav {
    display: flex;
    gap: var(--space-2);
    margin-bottom: var(--space-5);
    padding: 0 var(--space-2);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .nav-tabs::-webkit-scrollbar,
  .tab-nav::-webkit-scrollbar {
    display: none;
  }

  .nav-tab,
  .tab-button {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
    flex: 0 0 auto;
    min-width: fit-content;
    white-space: nowrap;
  }

  .tab-nav {
    margin-top: var(--space-2);
  }
}

@media (max-width: 480px) {
  .nav-tab,
  .tab-button {
    flex: 0 0 auto;
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-xs);
  }
}

/* ============================================
   RESPONSIVE STYLES - HEADER & FOOTER
   ============================================ */

@media (max-width: 1024px) {
  .header-tagline {
    display: none;
  }

  .header-right {
    gap: var(--space-2);
  }
}

@media (max-width: 768px) {
  body {
    padding-top: 70px; /* Compact header on mobile */
    padding-bottom: 200px; /* Adjusted footer on mobile */
  }

  .header-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
  }

  .header-left {
    flex-direction: column;
    justify-content: center;
    text-align: center;
    gap: var(--space-1);
  }

  .header-logo {
    height: 32px;
  }

  .header-tagline {
    font-size: 10px;
    display: block;
  }

  .header-right {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-2);
    width: 100%;
  }

  .readiness-pill,
  .refresh-btn,
  .elite-btn,
  .nav-link {
    font-size: 10px;
    padding: 6px 10px;
    white-space: nowrap;
    flex: 0 1 auto;
  }

  .container {
    padding: 0 var(--space-2);
  }

  .main-logo-container {
    margin-bottom: var(--space-4);
    padding-top: var(--space-2);
  }

  .devices-grid,
  .analytics-grid,
  .data-summary {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }

  .chart-container {
    height: 250px;
  }

  .main-footer {
    padding: var(--space-3) var(--space-2);
    position: relative;
    bottom: auto;
    left: auto;
    transform: none;
    width: 100%;
  }

  .footer-brands {
    flex-direction: column;
    gap: var(--space-2);
  }

  .footer-brands-label {
    font-size: 9px;
  }

  .footer-brands-logos {
    gap: var(--space-2);
    flex-wrap: wrap;
    justify-content: center;
  }

  .brand-logo {
    height: 24px;
  }

  .brand-logo-strava,
  .brand-logo-whoop {
    height: 14px;
  }

  .brand-logo-oura {
    height: 20px;
  }

  .brand-separator {
    font-size: 12px;
  }

  .footer-links {
    gap: var(--space-2);
    flex-wrap: wrap;
    justify-content: center;
  }

  .footer-links a {
    font-size: 10px;
    padding: 4px 8px;
  }

  .footer-text {
    font-size: 9px;
  }

}

@media (max-width: 480px) {
  body {
    padding-top: 60px;
    padding-bottom: 220px;
  }

  .header-container {
    padding: var(--space-2);
  }

  .header-logo {
    height: 28px;
  }

  .header-tagline {
    font-size: 9px;
  }

  .header-right {
    flex-direction: row;
    width: 100%;
    gap: 4px;
  }

  .readiness-pill,
  .refresh-btn,
  .elite-btn,
  .nav-link {
    font-size: 9px;
    padding: 5px 8px;
    flex: 1 1 auto;
    min-width: 0;
  }

  .main-logo {
    height: 60px;
  }

  .data-summary {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-2);
  }

  .summary-card {
    padding: var(--space-3);
  }

  .summary-value {
    font-size: var(--text-xl);
  }

  .summary-label {
    font-size: var(--text-xs);
  }

  .analytics-card {
    padding: var(--space-4);
  }

  .analytics-card h3 {
    font-size: var(--text-lg);
  }

  .footer-brands-logos {
    gap: var(--space-1);
  }

  .brand-logo {
    height: 20px;
  }

  .brand-logo-strava,
  .brand-logo-whoop {
    height: 12px;
  }

  .brand-logo-oura {
    height: 18px;
  }

  .brand-separator {
    font-size: 10px;
    margin: 0 2px;
  }
}

/* ============================================
   VERTICAL SIDEBAR NAVIGATION LAYOUT
   ============================================ */

/* App Layout Container */
.app-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* Sidebar */
.sidebar {
  width: 280px;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  background: rgba(10, 14, 39, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  padding: var(--space-6) 0;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.3);
}

.sidebar::-webkit-scrollbar {
  width: 4px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

.sidebar-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  padding: 0 var(--space-4);
}

/* Sidebar Logo */
.sidebar-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4) var(--space-2);
  margin-bottom: var(--space-4);
}

.sidebar-logo-img {
  height: 40px;
  width: auto;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
  transition: transform 0.2s ease;
}

.sidebar-logo:hover .sidebar-logo-img {
  transform: scale(1.05);
}

/* Sidebar Navigation */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

/* Sidebar Links */
.sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  font-size: 15px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  border: none;
  background: transparent;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  width: 100%;
  text-align: left;
}

/* Hover animation with backdrop */
.sidebar-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.05);
  opacity: 0;
  transition: opacity 0.2s ease;
  border-radius: 12px;
}

.sidebar-link:hover::before {
  opacity: 1;
}

.sidebar-link:hover {
  color: rgba(255, 255, 255, 0.95);
  transform: translateX(4px);
}

/* Active state with gradient */
.sidebar-link.active {
  color: white;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(147, 51, 234, 0.2) 100%);
  border: 1px solid rgba(59, 130, 246, 0.3);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
  transform: translateX(4px);
}

.sidebar-link.active::before {
  opacity: 0;
}

/* Sidebar Link Icon */
.sidebar-link-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
  opacity: 0.9;
  transition: transform 0.2s ease;
}

.sidebar-link:hover .sidebar-link-icon {
  transform: scale(1.1);
}

.sidebar-link.active .sidebar-link-icon {
  color: #3b82f6;
  transform: scale(1.15);
}

.sidebar-link-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Section Titles */
.sidebar-section-title {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: var(--space-4) var(--space-4) var(--space-2);
  margin-top: var(--space-4);
}

/* Sidebar Footer */
.sidebar-footer {
  margin-top: auto;
  padding-top: var(--space-6);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.sidebar-link-small {
  font-size: 13px;
  padding: var(--space-2) var(--space-4);
  color: rgba(255, 255, 255, 0.5);
}

/* Main Content Area */
.main-content {
  flex: 1;
  margin-left: 280px;
  min-height: 100vh;
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

/* Header (Slim version for sidebar layout) */
.main-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  height: 72px;
  background: rgba(10, 14, 39, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 900;
  transition: all 0.3s ease;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 var(--space-6);
  gap: var(--space-4);
}

/* Hamburger Button */
.hamburger-btn {
  display: none;
  width: 40px;
  height: 40px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: background 0.2s ease;
}

.hamburger-btn:hover {
  background: rgba(255, 255, 255, 0.05);
}

.hamburger-line {
  width: 24px;
  height: 2px;
  background: white;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.hamburger-btn.active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translateY(8px);
}

.hamburger-btn.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.hamburger-btn.active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translateY(-8px);
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex: 1;
}

.header-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  font-size: 14px;
  font-weight: 500;
  color: white;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.header-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.header-btn i {
  font-size: 14px;
}

/* Header User Section */
.header-user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.elite-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  font-size: 14px;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}

.elite-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

/* Readiness Pill in Header */
.readiness-pill {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  font-size: 13px;
  font-weight: 600;
  color: white;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  white-space: nowrap;
}

.readiness-pill i {
  font-size: 12px;
}

/* Sidebar Overlay for Mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Mobile Responsive Styles */
@media (max-width: 1023px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.active {
    display: block;
    opacity: 1;
  }

  .main-content {
    margin-left: 0;
  }

  .hamburger-btn {
    display: flex;
  }

  .header-container {
    padding: 0 var(--space-4);
  }

  .hide-mobile {
    display: none;
  }

  .header-actions {
    gap: var(--space-2);
  }

  .header-btn {
    padding: var(--space-2) var(--space-3);
  }

  .readiness-pill {
    font-size: 12px;
    padding: var(--space-2) var(--space-3);
  }
}

@media (max-width: 640px) {
  .readiness-pill {
    display: none;
  }

  .header-actions {
    gap: var(--space-2);
  }

  .header-btn span {
    display: none;
  }

  .header-btn {
    padding: var(--space-2);
    width: 40px;
    height: 40px;
    justify-content: center;
  }
}

/* ============================================
   FRAMER MOTION-STYLE ANIMATIONS
   ============================================ */

/* Smooth page transitions */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInFromLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Apply animations to tab panels */
.tab-panel {
  animation: fadeInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  padding-top: 16px;
  padding-bottom: 48px;
}

/* Staggered animations for cards */
.glass-card {
  animation: fadeInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:nth-child(1) { animation-delay: 0.05s; }
.glass-card:nth-child(2) { animation-delay: 0.1s; }
.glass-card:nth-child(3) { animation-delay: 0.15s; }
.glass-card:nth-child(4) { animation-delay: 0.2s; }
.glass-card:nth-child(5) { animation-delay: 0.25s; }

/* Smooth spring animations */
@keyframes spring {
  0% {
    transform: scale(0.95);
  }
  50% {
    transform: scale(1.02);
  }
  100% {
    transform: scale(1);
  }
}

.sidebar-link.active {
  animation: spring 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Micro-interactions */
.sidebar-link, .header-btn, .elite-btn {
  -webkit-tap-highlight-color: transparent;
}

/* Add smooth hover transitions */
* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Fix body padding for new layout */
body {
  padding-top: 0 !important;
}

.dashboard {
  padding-top: 0;
  min-height: auto;
}

/* ============================================
   ACCOUNT PAGE LAYOUT
   ============================================ */

/* Make Account page full-width on desktop */
#account {
  max-width: 100%;
  width: 100%;
}

#account .account-view {
  max-width: 100%;
  width: 100%;
}

/* Account page grid layout for desktop */
@media (min-width: 768px) {
  #account .account-profile-card {
    max-width: 100%;
  }

  #account .account-stats-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }

  #account .services-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
  }
}

/* Larger desktop - even more spacious */
@media (min-width: 1200px) {
  #account .account-stats-grid {
    gap: 32px;
  }

  #account .services-grid {
    gap: 24px;
  }

  #account .account-profile-card {
    padding: 48px !important;
  }

  #account .account-details-card {
    padding: 32px !important;
  }
}

/* Mobile - keep stacked layout */
@media (max-width: 767px) {
  #account .account-stats-grid {
    grid-template-columns: 1fr;
  }

  #account .services-grid {
    grid-template-columns: 1fr;
  }

  .hide-mobile {
    display: none;
  }
}
