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

:root {
  /* Google Colors */
  --google-blue: #4285F4;
  --google-red: #EA4335;
  --google-yellow: #FBBC05;
  --google-green: #34A853;
  
  /* Material 3 / Expressive Surface Colors (Light Mode Base) */
  --md-sys-color-background: #F6F7F9;
  --md-sys-color-surface: #FFFFFF;
  --md-sys-color-surface-variant: #E1E2EC;
  --md-sys-color-on-surface: #202124;
  --md-sys-color-on-surface-variant: #5F6368;
}

/* Dark Theme Overrides */
[data-theme="dark"] {
  --md-sys-color-background: #202124;
  --md-sys-color-surface: #282A2D;
  --md-sys-color-surface-variant: #3C4043;
  --md-sys-color-on-surface: #E8EAED;
  --md-sys-color-on-surface-variant: #9AA0A6;
}

:root {
  --md-sys-color-primary: var(--google-blue);
  --md-sys-color-on-primary: #FFFFFF;
  --md-sys-color-primary-container: #D3E3FD;
  --md-sys-color-on-primary-container: #041E49;

  --md-sys-color-secondary: var(--google-green);
  --md-sys-color-error: var(--google-red);

  /* Typography */
  --font-family: 'Outfit', sans-serif;
  
  /* Shapes */
  --shape-large: 28px;
  --shape-medium: 16px;
  --shape-small: 8px;

  /* Elevation */
  --elevation-1: 0px 1px 3px 1px rgba(0, 0, 0, 0.15), 0px 1px 2px 0px rgba(0, 0, 0, 0.30);
  --elevation-2: 0px 2px 6px 2px rgba(0, 0, 0, 0.15), 0px 1px 2px 0px rgba(0, 0, 0, 0.30);
  --elevation-3: 0px 1px 3px 0px rgba(0,0,0,0.30), 0px 4px 8px 3px rgba(0,0,0,0.15);
}

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

body {
  font-family: var(--font-family);
  background-color: var(--md-sys-color-background);
  color: var(--md-sys-color-on-surface);
  line-height: 1.5;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  
  /* Grid Background inspired by Google Doodles */
  background-image: 
    linear-gradient(rgba(0,0,0,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  background-position: center top;
  
  /* Smooth transitions for theme toggle */
  transition: background-color 0.4s ease, color 0.4s ease;
}

[data-theme="dark"] body {
  background-image: 
    linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
}



/* Header & Hero */
.app-header {
  padding: 2rem 1rem;
  text-align: center;
  position: relative;
  z-index: 2;
}

.header-top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  max-width: 800px;
  margin: 0 auto 2rem auto;
  padding: 0 1rem;
}

.gdg-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 1rem;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--md-sys-color-on-surface-variant);
}



.hero-title {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, var(--google-blue), var(--google-red), var(--google-yellow), var(--google-green));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--md-sys-color-on-surface-variant);
  max-width: 600px;
  margin: 0 auto 2rem auto;
}

/* Main Container */
.container {
  max-width: 600px; /* Narrower to match the card style in screenshots */
  margin: 0 auto;
  padding: 0 1rem 4rem 1rem;
  position: relative;
  z-index: 2;
}

/* Material Cards - Doodle Inspired */
.card {
  background: var(--md-sys-color-surface);
  border-radius: var(--shape-large);
  border: 1px solid rgba(0, 0, 0, 0.1);
  /* Stacked card effect */
  box-shadow: 
    -6px 6px 0px 0px rgba(0, 0, 0, 0.03),
    -12px 12px 0px 0px rgba(0, 0, 0, 0.01),
    0px 10px 30px rgba(0,0,0,0.05);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.4s ease, background-color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 
    -8px 8px 0px 0px rgba(0, 0, 0, 0.04),
    -16px 16px 0px 0px rgba(0, 0, 0, 0.02),
    0px 20px 50px rgba(0,0,0,0.15); /* Stronger shadow backdrop */
}

[data-theme="dark"] .card {
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 
    -6px 6px 0px 0px rgba(255, 255, 255, 0.03),
    -12px 12px 0px 0px rgba(255, 255, 255, 0.01),
    0px 10px 30px rgba(0,0,0,0.5);
}

[data-theme="dark"] .card:hover {
  box-shadow: 
    -8px 8px 0px 0px rgba(255, 255, 255, 0.04),
    -16px 16px 0px 0px rgba(255, 255, 255, 0.02),
    0px 20px 50px rgba(0,0,0,0.8);
}

.card-content {
  padding: 2.5rem 2rem;
  flex: 1;
}

.card-title {
  font-size: 2rem;
  font-weight: 500;
  margin-bottom: 2rem;
  color: var(--md-sys-color-on-surface);
  text-align: center;
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 1.5rem;
  position: relative;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--md-sys-color-on-surface-variant);
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 1rem 1.25rem;
  font-family: var(--font-family);
  font-size: 1rem;
  color: var(--md-sys-color-on-surface);
  background: var(--md-sys-color-background);
  border: 1px solid var(--md-sys-color-surface-variant);
  border-radius: var(--shape-medium);
  transition: all 0.3s ease;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--google-blue);
  box-shadow: 0 0 0 4px var(--md-sys-color-primary-container);
  background: var(--md-sys-color-surface);
}

/* Theme Toggle Button */
.top-right-actions {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  display: flex;
  gap: 0.5rem;
  z-index: 100;
}

.theme-toggle-btn, .nav-pill-btn {
  padding: 0.5rem 1.25rem;
  font-family: var(--font-family);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 100px;
  border: 1px solid var(--md-sys-color-surface-variant);
  background: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
  cursor: pointer;
  transition: all 0.4s ease;
}
.theme-toggle-btn:hover, .nav-pill-btn:hover {
  background: var(--md-sys-color-surface-variant);
}
.form-textarea {
  resize: vertical;
  min-height: 120px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-family);
  font-size: 1.125rem;
  font-weight: 500;
  padding: 1.25rem 2rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--google-blue);
  color: #FFFFFF;
  width: 100%; /* Full width for bottom attachment */
}

.btn-primary:hover:not(:disabled) {
  background: #3b78e7;
}

/* Specific styling for the submit button attached to the bottom of the card */
.card-bottom-btn {
  margin-top: auto;
  border-radius: 0 0 var(--shape-large) var(--shape-large);
  justify-content: space-between;
  padding: 1.5rem 2rem;
}

/* Specific styling for standalone pill buttons */
.btn-pill {
  border-radius: 100px;
  padding: 0.875rem 2rem;
  width: auto;
}

.btn-secondary {
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
}

.btn-secondary:hover {
  background: #C2D7FA;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--md-sys-color-surface-variant);
  color: var(--md-sys-color-on-surface-variant);
}

.btn-outline:hover {
  background: rgba(66, 133, 244, 0.05); /* Blue tint */
  border-color: var(--google-blue);
  color: var(--google-blue);
}

/* Question List & Items */
.question-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.question-item {
  background: var(--md-sys-color-surface);
  border-radius: var(--shape-large);
  padding: 1.5rem;
  box-shadow: var(--elevation-1);
  border-left: 6px solid var(--google-yellow);
}

.question-item.answered {
  border-left-color: var(--google-green);
}

.question-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.author-name {
  font-weight: 600;
  color: var(--md-sys-color-on-surface);
}

.question-time {
  font-size: 0.875rem;
  color: var(--md-sys-color-on-surface-variant);
}

.question-text {
  font-size: 1.125rem;
  color: var(--md-sys-color-on-surface);
  margin-bottom: 1rem;
}

.answer-box {
  background: var(--md-sys-color-primary-container);
  border-radius: var(--shape-medium);
  padding: 1.25rem;
  margin-top: 1rem;
}

.answer-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--md-sys-color-on-primary-container);
  margin-bottom: 0.5rem;
  display: block;
}

.answer-text {
  color: var(--md-sys-color-on-primary-container);
  font-weight: 500;
}

/* Admin Specific */
.tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--md-sys-color-surface-variant);
  padding-bottom: 1px;
}

.tab-btn {
  background: none;
  border: none;
  padding: 1rem 1.5rem;
  font-family: var(--font-family);
  font-size: 1rem;
  font-weight: 500;
  color: var(--md-sys-color-on-surface-variant);
  cursor: pointer;
  position: relative;
}

.tab-btn.active {
  color: var(--md-sys-color-primary);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--md-sys-color-primary);
  border-radius: 3px 3px 0 0;
}

/* Animations */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-slide-up {
  animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Toast Notification */
.toast-container {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--md-sys-color-on-surface);
  color: var(--md-sys-color-surface);
  padding: 1rem 1.5rem;
  border-radius: var(--shape-small);
  box-shadow: var(--elevation-3);
  font-weight: 500;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Brand Guideline SVG Background Shapes */
.bg-shape {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  opacity: 0.9;
}

.bg-shape svg rect,
.bg-shape svg polygon,
.bg-shape svg line,
.bg-shape svg g {
  transition: stroke 0.4s ease;
}

[data-theme="dark"] .bg-shape svg rect,
[data-theme="dark"] .bg-shape svg polygon,
[data-theme="dark"] .bg-shape svg line,
[data-theme="dark"] .bg-shape svg g[stroke="#111"] {
  stroke: rgba(255, 255, 255, 0.15);
}

/* Status Badges */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-pending {
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-primary);
}
.badge-answered {
  background: rgba(52, 168, 83, 0.1);
  color: var(--google-green);
}

/* Chrome Dino Splash Screen */
.splash-screen {
  position: fixed;
  inset: 0;
  background: var(--md-sys-color-background);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.splash-screen.hidden {
  opacity: 0;
  visibility: hidden;
}

.splash-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.dino-container {
  position: absolute;
  left: 20px;
  bottom: 0px;
  width: 44px;
  height: 47px;
  color: #535353;
  z-index: 10;
}

[data-theme="dark"] .dino-container,
[data-theme="dark"] .dino-cactus,
[data-theme="dark"] .dino-ground {
  color: #E8EAED;
  border-bottom-color: #E8EAED;
}

.dino {
  position: absolute;
  top: 0;
  left: 0;
}

.dino-img {
  position: absolute;
  top: 0;
  left: 0;
}

.dino-ground {
  position: absolute;
  bottom: 0px;
  left: 0;
  width: 200%;
  height: 2px;
  border-bottom: 2px dashed currentColor;
  animation: scrollGround 1s linear infinite;
  color: #535353;
}

.dino-cactus {
  position: absolute;
  bottom: 0px;
  right: -30px;
  width: 25px;
  height: 50px;
  color: #535353;
  animation: scrollCactus 2.6s linear forwards;
}

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

@keyframes scrollCactus {
  0% { transform: translateX(0); }
  100% { transform: translateX(-350px); }
}

/* Running Animation Logic */
@keyframes runBob {
  0% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
  100% { transform: translateY(0); }
}

.splash-screen:not(.jumping) .dino-img {
  animation: runBob 0.2s linear infinite;
}

/* Jumping Logic */
.splash-screen.jumping .dino-img { animation: none; }
.splash-screen.jumping .dino-ground { animation-play-state: paused; }

@keyframes dinoJump {
  0% { transform: translateY(0); }
  50% { transform: translateY(-70px); }
  100% { transform: translateY(0); }
}

.splash-screen.jumping .dino-container {
  animation: dinoJump 0.6s cubic-bezier(0.1, 0.7, 0.9, 0.3) forwards;
}

.splash-text {
  font-family: var(--font-family);
  font-weight: 500;
  font-size: 1.125rem;
  color: var(--md-sys-color-on-surface-variant);
  margin-top: 1rem;
}

/* Interactive Q&A Textarea: Speech Bubble */
.speech-bubble {
  border-radius: 24px;
  border-bottom-left-radius: 4px;
  padding: 1.5rem;
  font-size: 1.25rem;
  line-height: 1.5;
  resize: none;
  overflow: hidden;
  min-height: 80px;
  background: var(--md-sys-color-surface-variant);
  border: 2px solid transparent;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, min-height 0.3s ease, background 0.3s ease;
}

.speech-bubble:focus {
  border-color: var(--google-blue);
  box-shadow: 0 4px 12px rgba(66, 133, 244, 0.15);
  min-height: 120px;
  background: var(--md-sys-color-surface);
}

/* Rocket Launch Animation */
@keyframes launchRocket {
  0% { 
    transform: translate(0, 0) scale(1) rotate(0deg); 
    opacity: 1; 
  }
  20% { 
    transform: translate(-10px, 10px) scale(0.9) rotate(-10deg); 
  }
  100% { 
    transform: translate(500px, -500px) scale(1.5) rotate(45deg); 
    opacity: 0; 
  }
}

.rocket-launching {
  display: block !important;
  animation: launchRocket 1s cubic-bezier(0.5, 0, 0.2, 1) forwards;
}

/* Form Container Shrink Animation */
@keyframes shrinkAway {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(0.8); opacity: 0; pointer-events: none; }
}

.form-shrinking {
  animation: shrinkAway 0.5s ease forwards;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--md-sys-color-on-surface-variant);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  margin-bottom: 1rem;
  opacity: 0.5;
}

/* Mood Game Orbs */
.mood-orbs-container {
  position: relative;
  height: 150px;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}

.mood-orb {
  position: absolute;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  animation: floatOrb 4s ease-in-out infinite alternate;
}

.mood-orb:hover {
  transform: scale(1.15) !important;
  z-index: 10;
}

.mood-orb.sad { background: #4285F4; left: 5%; top: 20px; animation-delay: 0s; }
.mood-orb.chill { background: #34A853; left: 30%; top: 70px; animation-delay: -1s; }
.mood-orb.energetic { background: #FBBC05; left: 55%; top: 10px; animation-delay: -2s; }
.mood-orb.focused { background: #EA4335; left: 80%; top: 60px; animation-delay: -3s; }

@keyframes floatOrb {
  0% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(10px, 15px) rotate(10deg); }
  100% { transform: translate(-10px, -15px) rotate(-10deg); }
}

/* Recommendation Card */
.rec-card {
  background: var(--md-sys-color-surface-variant);
  border-radius: 16px;
  padding: 1.5rem;
  width: 100%;
  max-width: 400px;
  text-align: left;
  border-left: 6px solid var(--google-blue);
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  animation: slideUp 0.5s ease-out forwards;
}

.rec-type {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(66, 133, 244, 0.1);
  color: var(--google-blue);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.rec-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.rec-artist {
  color: var(--md-sys-color-on-surface-variant);
  font-size: 1rem;
}

/* Interactive Rating System */
.rating-section {
  background: var(--md-sys-color-surface);
  border: 1px solid var(--md-sys-color-surface-variant);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.rating-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.rating-label {
  font-size: 1rem;
  font-weight: 500;
  color: var(--md-sys-color-on-surface-variant);
  text-align: left;
}

.rating-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--md-sys-color-surface-variant);
  border-radius: 100px;
  padding: 0.25rem;
  position: relative;
}

.rating-emoji {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  z-index: 2;
  font-family: var(--font-family);
  font-weight: 600;
  color: var(--md-sys-color-on-surface-variant);
  opacity: 0.7;
}

.rating-emoji:hover {
  transform: scale(1.2);
  opacity: 1;
}

/* Active states for each value mapping to Google Colors */
.rating-emoji.active {
  opacity: 1;
  transform: scale(1.2);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.rating-emoji[data-val="1"].active { background: #FCE8E6; border: 2px solid var(--google-red); color: var(--google-red); }
.rating-emoji[data-val="2"].active { background: #FEF7E0; border: 2px solid #F29900; color: #F29900; }
.rating-emoji[data-val="3"].active { background: #FFF3E0; border: 2px solid var(--google-yellow); color: var(--google-yellow); }
.rating-emoji[data-val="4"].active { background: #E6F4EA; border: 2px solid var(--google-green); color: var(--google-green); }
.rating-emoji[data-val="5"].active { background: #E8F0FE; border: 2px solid var(--google-blue); color: var(--google-blue); }

[data-theme="dark"] .rating-emoji[data-val="1"].active { background: rgba(234, 67, 53, 0.2); color: var(--google-red); }
[data-theme="dark"] .rating-emoji[data-val="2"].active { background: rgba(242, 153, 0, 0.2); color: #F29900; }
[data-theme="dark"] .rating-emoji[data-val="3"].active { background: rgba(251, 188, 5, 0.2); color: var(--google-yellow); }
[data-theme="dark"] .rating-emoji[data-val="4"].active { background: rgba(52, 168, 83, 0.2); color: var(--google-green); }
[data-theme="dark"] .rating-emoji[data-val="5"].active { background: rgba(66, 133, 244, 0.2); color: var(--google-blue); }

/* Confetti click animation */
@keyframes ratingPop {
  0% { transform: scale(0.8); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1.2); }
}

.rating-emoji.pop {
  animation: ratingPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Rank Badges */
.rank-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #fff;
  letter-spacing: 0.05em;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.rank-rookie { background: linear-gradient(135deg, #78909c, #546e7a); }
.rank-bronze { background: linear-gradient(135deg, #cd7f32, #a0522d); }
.rank-silver { background: linear-gradient(135deg, #b0bec5, #78909c); }
.rank-gold { background: linear-gradient(135deg, #ffca28, #f57f17); color: #333; text-shadow: none; }
.rank-platinum { background: linear-gradient(135deg, #e0f7fa, #80deea); color: #006064; text-shadow: none; }
.rank-diamond { background: linear-gradient(135deg, #b39ddb, #7e57c2); }
.rank-master { background: linear-gradient(135deg, #ef5350, #c62828); }
.rank-crimson { background: linear-gradient(135deg, #d32f2f, #880e4f); }
.rank-iridescent { background: linear-gradient(135deg, #ab47bc, #311b92); }
.rank-top250 { background: linear-gradient(135deg, #ffd54f, #ff6f00, #d32f2f); }

/* Leaderboard */
.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 0.5rem; /* for scrollbar */
}

.leaderboard-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: var(--md-sys-color-surface-variant);
  border-radius: var(--shape-medium);
  transition: transform 0.2s ease;
}

.leaderboard-item:hover {
  transform: translateX(4px);
  background: var(--md-sys-color-primary-container);
}

.leaderboard-user {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.leaderboard-pos {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--md-sys-color-primary);
  min-width: 30px;
}

.leaderboard-name {
  font-weight: 600;
  font-size: 1.1rem;
}

.leaderboard-score {
  font-weight: 700;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 1.1rem;
}

/* Flip Card Animation */
.flip-wrapper {
  perspective: 1000px;
  width: 100%;
  margin-top: 2rem;
}

.flip-card {
  display: grid;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
  width: 100%;
}

.flip-card.is-flipped {
  transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
  grid-area: 1 / 1;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  width: 100%;
  align-self: start;
}

.flip-card-back {
  transform: rotateY(180deg);
}

.flip-card-front > .card, .flip-card-back > .card {
  margin-top: 0 !important;
}

/* Feedback Analytics Dashboard */
.analytics-dashboard {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.analytics-summary {
  text-align: center;
  padding: 2rem !important;
}

.analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 600px) {
  .header-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
  }
  .header-top > div {
    display: flex;
    justify-content: center !important;
  }
  .top-right-actions {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    margin-bottom: 0;
  }
  .app-header {
    padding: 1rem;
  }
  .hero-title {
    font-size: 2rem;
  }
  .hero-subtitle {
    font-size: 1rem;
  }
  .card-content {
    padding: 1.5rem 1rem;
  }
  .btn {
    padding: 1rem 1.5rem;
    font-size: 1rem;
  }
  .card-bottom-btn {
    padding: 1rem 1.5rem;
  }
  .speech-bubble {
    font-size: 1rem;
  }
  .mood-orb {
    width: 45px;
    height: 45px;
    font-size: 1.25rem;
  }
  .rating-options {
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
  }
  .rating-emoji {
    width: 40px;
    height: 40px;
    font-size: 1.25rem;
  }
  .bg-shape {
    transform: scale(0.6) !important;
  }
  .analytics-grid {
    grid-template-columns: 1fr;
  }
}

.metric-card {
  padding: 1.5rem !important;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.metric-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 1.125rem;
}

.metric-value {
  color: var(--md-sys-color-on-surface-variant);
  font-size: 1rem;
}

.progress-bar-bg {
  width: 100%;
  height: 12px;
  background: var(--md-sys-color-surface-variant);
  border-radius: 100px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 100px;
  transition: width 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes geminiGlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.gemini-glow.active {
  background: transparent !important;
  overflow: visible !important;
  z-index: 1;
}

.gemini-glow::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: var(--shape-large);
  background: linear-gradient(90deg, #4285F4, #EA4335, #FBBC05, #34A853, #4285F4);
  background-size: 200% 200%;
  animation: geminiGlow 3s linear infinite;
  z-index: -2;
  filter: blur(12px);
  opacity: 0;
  transition: opacity 0.5s ease;
}

.gemini-glow::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--shape-large);
  background: var(--md-sys-color-surface);
  z-index: -1;
  opacity: 0;
  transition: opacity 0.5s ease;
}

@keyframes smoothFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.gemini-glow.active::before {
  opacity: 1;
  animation: geminiGlow 3s linear infinite, smoothFadeIn 0.6s ease-out forwards;
}

.gemini-glow.active::after {
  opacity: 1;
  animation: smoothFadeIn 0.6s ease-out forwards;
}

.radio-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  border-radius: 100px;
  border: 1px solid var(--md-sys-color-surface-variant);
  background: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.radio-pill:hover {
  background: var(--md-sys-color-surface-variant);
}

.radio-pill input[type="radio"] {
  display: none;
}

.radio-pill input[type="radio"]:checked + span {
  color: var(--google-blue);
  font-weight: 600;
}

.radio-pill:has(input[type="radio"]:checked) {
  border-color: var(--google-blue);
  background: rgba(66, 133, 244, 0.1);
}
