/* 
   CSS VARIABLES & RESET
    */
:root {
  /* Spacing - converted to small percentages */
  --space-xs: 0.4%;
  --space-sm: 0.6%;
  --space-md: 0.9%;
  --space-lg: 1.1%;
  --space-xl: 1.5%;
  --space-xxl: 2.1%;
  
  /* Sizing - REVERTED to rem for better font scaling */
  --size-xxs: 1.0rem;
  --size-xs: 1.2rem;
  --size-sm: 1.4rem;
  --size-md: 1.6rem;
  --size-lg: 1.8rem;
  --size-xl: 2rem;
  --size-xxl: 2.2rem;
  
  /* Effects - REVERTED borders and shadows to px */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  
  /* Modal-specific variables - REVERTED borders and radius to px */
  --modal-border-radius: 24px;
  --modal-padding: 1.5%;
  --modal-padding-mobile: 1.5%;
  
  /* Form variables - REVERTED borders to px */
  --input-padding: 1% 1.25%;
  --input-border-radius: 12px;
  
  /* Close button variables - REVERTED to px */
  --close-btn-size: 40px;
}

:root {
  /* Common Node Properties - REVERTED borders and shadows to px */
  --node-border-radius: 12px;
  --node-border-width: 2px;
  --node-padding: 1.2% 1.6%;
  --node-min-width: 16%;
  --node-max-width: 30%;
  --node-min-height: 6%;
  
  /* Canvas Properties - REVERTED borders to px */
  --canvas-grid-size: 2%;
  --canvas-border-radius: 8px;
  --canvas-min-height: 40%;
  
  /* Animation Durations */
  --animation-fast: 0.2s;
  --animation-normal: 0.3s;
  --animation-slow: 0.6s;
  --animation-easing: cubic-bezier(0.4, 0, 0.2, 1);
  --animation-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { box-sizing: border-box; }

body {
  font-family: system-ui, -apple-system, sans-serif;
  padding: 0;
  padding-top: 60px;
  min-height: 100vh;
  height: 100vh;
  overflow-x: hidden; /* Prevent horizontal scroll */
  position: relative;
}

* {
  box-sizing: border-box;
  max-width: 100%;
}

html {
  overflow-x: hidden;
}

/* 
   BASE TYPOGRAPHY
    */
h1, h2, .card-title {
  margin: 0 0 var(--space-xl) 0;
  text-align: center;
}

.card-title {
  margin: 0 0 var(--space-xl) 0;
  text-align: center;
  font-size: var(--size-xl);
}

h1 { font-size: var(--size-xxl); }
h2, .card-title { font-size: var(--size-xl); }
h3 {
  font-size: var(--size-md);
  margin: 0 0 var(--space-md) 0;
}
h4 {
  font-size: var(--size-sm);
  margin: var(--space-md) 0 var(--space-sm) 0;
}

/* 
  UTILITY CLASSES
   */
.permission-check,
.info-note {
 border-radius: var(--radius-sm);
 padding: var(--space-sm) var(--size-xs);
 margin: var(--space-sm) 0;
 font-size: var(--size-sm);
}

.global-permission {
 max-width: 100%;
 margin: 0 auto var(--space-xl);
 border-radius: var(--radius-sm);
 padding: var(--space-lg);
 text-align: center;
}

/* Status and countdown styles */
.status {
  margin-top: var(--space-md);
  font-size: var(--size-sm);
}

.countdown {
  font-weight: 500;
}

/* Check button styles */
.check-btn {
  border: none;
  width: 4.5%;
  height: 100%;
  min-width: 44px; /* REVERTED to px for minimum touch target */
  cursor: pointer;
  font-size: var(--size-lg);
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.check-btn:hover {
  transform: scale(1.05);
}

/* Fix for card min heights */
.counter-card,
.trackables-card,
.diet-card,
.motivation-card,
.tool-card {
  min-height: fit-content;
}

/* Ensure progress text stays on one line */
.progress-text > span {
  white-space: nowrap;
}

.vision-content[data-type="redgifs"] {
  aspect-ratio: 16 / 9;
  display: block !important;
  align-items: normal !important;
  justify-content: normal !important;
  min-height: auto !important;
}

/* ========================================
   METADATA BADGES
   ======================================== */

.schedule-badge, 
.trackable-due-date, 
.trackable-status, 
.trackable-streak, 
.child-count-badge, 
.goal-badge, 
.tag-badge {
  font-size: var(--size-xxs); 
  font-weight: 500;
  padding: 4px 8px; /* REVERTED to px */
  border-radius: 3px; /* REVERTED to px */
  margin-left: 0.5%;
  white-space: nowrap;
}

.trackable-status { 
  text-transform: uppercase; 
  letter-spacing: 0.5px; /* REVERTED to px */
}

.priority-star { 
  font-size: 1.2rem; 
  margin-left: 0.5%; 
}

.tag-badge {
  font-family: monospace;
  font-size: var(--size-xxs); 
}

/* ========================================
   PROGRESS BARS & DISPLAYS
   ======================================== */

.progress-bar {
  width: 100%;
  height: 8px; /* REVERTED to px */
  border-radius: 4px; /* REVERTED to px */
  overflow: hidden;
  margin-top: var(--space-xs);
  position: relative;
}

.progress-fill {
  height: 100%;
  border-radius: 4px; /* REVERTED to px */
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.progress-fill::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  transform: translateX(-100%);
  animation: shimmer 2s infinite;
}

.progress-checkmark {
  position: absolute;
  top: 50%;
  right: 8px; /* REVERTED to px */
  transform: translateY(-50%) scale(0);
  font-weight: bold;
  font-size: 1.2rem; 
  transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.progress-checkmark.visible {
  transform: translateY(-50%) scale(1);
}

.progress-mini {
  height: 6px; /* REVERTED to px */
  border-radius: 3px; /* REVERTED to px */
  overflow: hidden;
  margin-top: var(--space-xs);
  position: relative;
}

.progress-mini > div {
  height: 100%;
  border-radius: 3px; /* REVERTED to px */
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}