/* Glass Morphism Gaming Blog Animations - Fixed Version */

/* CSS Variables for Glass Morphism Theme */
:root {
  --glass-bg: rgba(255, 255, 255, 0.1);
  --glass-bg-strong: rgba(255, 255, 255, 0.15);
  --glass-border: rgba(255, 255, 255, 0.2);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  --glass-shadow-hover: 0 12px 48px rgba(0, 0, 0, 0.15);
  --purple-accent: rgba(123, 68, 193, 1);
  --purple-accent-light: rgba(123, 68, 193, 0.8);
  --purple-accent-subtle: rgba(123, 68, 193, 0.2);
  --purple-gradient: linear-gradient(135deg, rgba(123, 68, 193, 0.2), rgba(147, 51, 234, 0.1));
  --text-primary: rgba(255, 255, 255, 0.9);
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.5);
}

/* Override body font with Merriweather */
.blog-detail-content {
  font-family: 'Merriweather', Georgia, serif !important;
}

/* Glass morphism base class */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  box-shadow: var(--glass-shadow);
  padding: 2rem;
  margin: 2rem auto;
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
  background: var(--glass-bg-strong);
  box-shadow: var(--glass-shadow-hover);
  transform: translateY(-4px);
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--purple-gradient);
}

/* Headers with Merriweather font */
.glass-card h2,
.glass-card h3,
.stat-title {
  font-family: 'Merriweather', Georgia, serif;
  font-weight: 700;
  color: var(--text-primary);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* 1. Parent Concern Stat Animation */
.parent-concern-stat {
  max-width: 500px;
  text-align: center;
  opacity: 0;
  transform: translateY(50px);
  transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.parent-concern-stat.animate {
  opacity: 1;
  transform: translateY(0);
}

.stat-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: brightness(0) saturate(100%) invert(50%) sepia(88%) saturate(1025%) hue-rotate(231deg) brightness(94%) contrast(101%);
  opacity: 0.8;
}

.stat-number {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 6rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--purple-accent), #9333ea);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 1rem;
  text-shadow: 0 4px 8px rgba(123, 68, 193, 0.3);
  position: relative;
}

.stat-number::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--purple-gradient);
  border-radius: 2px;
}

.stat-text {
  font-size: 1.4rem;
  color: var(--text-secondary);
  font-weight: 300;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.8s ease 0.5s;
  font-family: 'Merriweather', Georgia, serif;
}

.parent-concern-stat.animate .stat-text {
  opacity: 1;
  transform: translateY(0);
}

.stat-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  margin-top: 1rem;
  font-style: italic;
  font-family: 'Merriweather', Georgia, serif;
}

/* 2. Gaming Hours Comparison Chart */
.gaming-hours-comparison {
  max-width: 700px;
  opacity: 0;
  transform: translateY(50px);
  transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.gaming-hours-comparison.animate {
  opacity: 1;
  transform: translateY(0);
}

.hours-chart-title {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 1.5rem;
  font-family: 'Merriweather', Georgia, serif;
}

.hours-chart-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hours-chart-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: brightness(0) saturate(100%) invert(50%) sepia(88%) saturate(1025%) hue-rotate(231deg) brightness(94%) contrast(101%);
  opacity: 0.8;
}

.age-group {
  margin-bottom: 2rem;
  opacity: 0;
  transform: translateX(-30px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.gaming-hours-comparison.animate .age-group {
  opacity: 1;
  transform: translateX(0);
}

.gaming-hours-comparison.animate .age-group:nth-child(2) { transition-delay: 0.1s; }
.gaming-hours-comparison.animate .age-group:nth-child(3) { transition-delay: 0.2s; }
.gaming-hours-comparison.animate .age-group:nth-child(4) { transition-delay: 0.3s; }
.gaming-hours-comparison.animate .age-group:nth-child(5) { transition-delay: 0.4s; }

.age-label {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  font-family: 'Merriweather', Georgia, serif;
}

.hours-bars {
  position: relative;
  height: 30px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 15px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.hours-bar {
  position: absolute;
  height: 100%;
  border-radius: 15px;
  transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0;
}

.gaming-hours-comparison.animate .hours-bar {
  width: var(--bar-width, 0);
}

.bar-recommended {
  background: linear-gradient(90deg, #10b981, #059669);
  z-index: 3;
}

.bar-actual {
  background: linear-gradient(90deg, var(--purple-accent), #9333ea);
  z-index: 2;
}

.bar-concerning {
  background: linear-gradient(90deg, #ef4444, #dc2626);
  z-index: 1;
}

.hours-legend {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-family: 'Merriweather', Georgia, serif;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.legend-dot.recommended { background: #10b981; }
.legend-dot.actual { background: var(--purple-accent); }
.legend-dot.concerning { background: #ef4444; }

/* 3. Skills Improvement Animation */
.skills-improvement {
  max-width: 800px;
  opacity: 0;
  transform: translateY(50px);
  transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.skills-improvement.animate {
  opacity: 1;
  transform: translateY(0);
}

.skills-chart-title {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 1.5rem;
  font-family: 'Merriweather', Georgia, serif;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.skill-item {
  text-align: center;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.skills-improvement.animate .skill-item {
  opacity: 1;
  transform: scale(1);
}

.skills-improvement.animate .skill-item:nth-child(1) { transition-delay: 0.1s; }
.skills-improvement.animate .skill-item:nth-child(2) { transition-delay: 0.2s; }
.skills-improvement.animate .skill-item:nth-child(3) { transition-delay: 0.3s; }
.skills-improvement.animate .skill-item:nth-child(4) { transition-delay: 0.4s; }
.skills-improvement.animate .skill-item:nth-child(5) { transition-delay: 0.5s; }

.skill-icon {
  width: 36px;
  height: 36px;
  margin: 0 auto 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.skill-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: brightness(0) saturate(100%) invert(50%) sepia(88%) saturate(1025%) hue-rotate(231deg) brightness(94%) contrast(101%);
  opacity: 0.8;
}

.skill-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  font-family: 'Merriweather', Georgia, serif;
}

.skill-bars {
  height: 120px;
  display: flex;
  align-items: flex-end;
  gap: 0.25rem;
  margin-bottom: 0.5rem;
}

.skill-bar {
  flex: 1;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px 4px 0 0;
  position: relative;
  overflow: hidden;
  transition: height 1.5s cubic-bezier(0.4, 0, 0.2, 1);
  height: 0;
}

.skills-improvement.animate .skill-bar {
  height: var(--bar-height, 0);
}

.skill-bar-traditional {
  background: linear-gradient(180deg, #6b7280, #4b5563);
}

.skill-bar-educational {
  background: linear-gradient(180deg, var(--purple-accent), #9333ea);
}

.skill-bar-combined {
  background: linear-gradient(180deg, #10b981, #059669);
}

.skill-percentage {
  position: absolute;
  top: 0.25rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  font-weight: 700;
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  font-family: 'Merriweather', Georgia, serif;
}

/* 4. Math Progress Visualization */
.math-progress {
  max-width: 700px;
  opacity: 0;
  transform: translateY(50px);
  transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.math-progress.animate {
  opacity: 1;
  transform: translateY(0);
}

.math-chart-title {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 1.5rem;
  font-family: 'Merriweather', Georgia, serif;
}

.math-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.math-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: brightness(0) saturate(100%) invert(50%) sepia(88%) saturate(1025%) hue-rotate(231deg) brightness(94%) contrast(101%);
  opacity: 0.8;
}

.grade-progress-container {
  margin-bottom: 2rem;
}

.grade-progress-item {
  margin-bottom: 2rem;
  opacity: 0;
  transform: translateX(-30px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.math-progress.animate .grade-progress-item {
  opacity: 1;
  transform: translateX(0);
}

.grade-label {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--purple-accent);
  margin-bottom: 0.75rem;
  font-family: 'Merriweather', Georgia, serif;
}

.progress-comparison {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.progress-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.method-label {
  min-width: 90px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-family: 'Merriweather', Georgia, serif;
}

.progress-bar-container {
  flex: 1;
  height: 24px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.progress-bar {
  height: 100%;
  border-radius: 12px;
  position: relative;
  width: 0;
  transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 0.5rem;
}

.math-progress.animate .progress-bar {
  width: var(--bar-width, 0);
}

.traditional-bar {
  background: linear-gradient(90deg, #6b7280, #4b5563);
}

.gaming-bar {
  background: linear-gradient(90deg, var(--purple-accent), #10b981);
}

.time-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: white;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  font-family: 'Merriweather', Georgia, serif;
}

.improvement-summary {
  text-align: center;
  margin-top: 2rem;
  opacity: 0;
  transform: scale(0.9);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.6s;
}

.math-progress.animate .improvement-summary {
  opacity: 1;
  transform: scale(1);
}

.improvement-text {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  font-family: 'Merriweather', Georgia, serif;
}

.improvement-highlight {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--purple-accent);
  margin: 0;
  font-family: 'Merriweather', Georgia, serif;
}

/* Improved Table Styling */
.post-content table {
  width: 100%;
  margin: 2.5rem 0;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--glass-shadow);
  font-family: 'Merriweather', Georgia, serif;
  table-layout: auto;
}

.post-content table thead {
  background: rgba(123, 68, 193, 0.1);
  border-bottom: 1px solid var(--glass-border);
}

.post-content table th {
  padding: 1.25rem 1.5rem;
  text-align: left;
  font-weight: 700;
  color: var(--text-primary);
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.post-content table td {
  padding: 1.25rem 1.5rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: top;
}

.post-content table tbody tr:last-child td {
  border-bottom: none;
}

.post-content table tbody tr {
  transition: background-color 0.3s ease;
}

.post-content table tbody tr:hover {
  background: rgba(123, 68, 193, 0.05);
}

/* First column styling */
.post-content table td:first-child {
  font-weight: 600;
  color: var(--purple-accent);
  white-space: nowrap;
  font-size: 0.85rem;
  width: auto;
}

/* Icon visibility toggle - add class 'hide-icons' to body to hide all icons */
body.hide-icons .stat-icon,
body.hide-icons .hours-chart-icon,
body.hide-icons .skill-icon,
body.hide-icons .math-icon,
.post-content[data-slug="redirecting-gaming-addiction"] .stat-icon,
.post-content[data-slug="redirecting-gaming-addiction"] .hours-chart-icon,
.post-content[data-slug="redirecting-gaming-addiction"] .skill-icon,
.post-content[data-slug="redirecting-gaming-addiction"] .math-icon {
  display: none !important;
}

body.hide-icons .stat-number,
body.hide-icons .hours-chart-title,
body.hide-icons .skills-chart-title,
body.hide-icons .math-chart-title,
.post-content[data-slug="redirecting-gaming-addiction"] .stat-number,
.post-content[data-slug="redirecting-gaming-addiction"] .hours-chart-title,
.post-content[data-slug="redirecting-gaming-addiction"] .skills-chart-title,
.post-content[data-slug="redirecting-gaming-addiction"] .math-chart-title {
  margin-top: 0;
}

/* Responsive icon sizing */
@media (max-width: 768px) {
  .stat-icon { width: 40px; height: 40px; }
  .hours-chart-icon { width: 32px; height: 32px; }
  .skill-icon { width: 28px; height: 28px; }
  .math-icon { width: 32px; height: 32px; }
}

/* Responsive table */
@media (max-width: 768px) {
  .post-content table {
    font-size: 0.85rem;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .post-content table th,
  .post-content table td {
    padding: 0.75rem 1rem;
    min-width: 120px;
  }
  
  .post-content table td:first-child {
    font-size: 0.75rem;
    white-space: normal;
    word-wrap: break-word;
    min-width: 140px;
    max-width: 140px;
  }
  
  .post-content table td:last-child {
    min-width: 200px;
  }
  
  /* Add scroll indicator */
  .post-content table::-webkit-scrollbar {
    height: 8px;
  }
  
  .post-content table::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
  }
  
  .post-content table::-webkit-scrollbar-thumb {
    background: rgba(123, 68, 193, 0.3);
    border-radius: 4px;
  }
}

/* Even smaller screens */
@media (max-width: 480px) {
  .post-content table {
    font-size: 0.8rem;
    margin: 1.5rem -1rem;
    border-radius: 0;
    width: calc(100% + 2rem);
  }
  
  .post-content table th,
  .post-content table td {
    padding: 0.6rem 0.8rem;
  }
  
  .post-content table td:first-child {
    font-size: 0.7rem;
    min-width: 120px;
    max-width: 120px;
  }
  
  .post-content table td:last-child {
    min-width: 180px;
  }
}

/* Animation state indicator */
.animate-on-scroll {
  position: relative;
}

.animate-on-scroll:not(.animate)::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, transparent, var(--purple-accent-subtle), transparent);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.5;
  animation: shimmer 3s infinite;
}

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

/* Reduce motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}