/* Styles for Φυσικά Ε' Δημοτικού - Kid-Friendly PWA */

:root {
  --primary: #4A90E2;
  --primary-dark: #2C3E50;
  --secondary: #FF6B6B;
  --accent: #FFD166;
  --success: #06D6A0;
  --warning: #F78C6B;
  --bg-gradient: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 100%);
  --card-bg: #FFFFFF;
  --text-color: #2D3748;
  --text-muted: #718096;
  --border-radius: 18px;
  --box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --font-heading: 'Fredoka', cursive, sans-serif;
  --font-body: 'Comfortaa', cursive, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-body);
  background: var(--bg-gradient);
  color: var(--text-color);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
}

/* Container */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 2px solid rgba(74, 144, 226, 0.15);
  box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}

.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  transition: var(--transition);
}

.icon-btn:hover {
  background: rgba(74, 144, 226, 0.1);
}

.hamburger {
  width: 24px;
  height: 3px;
  background: var(--primary-dark);
  position: relative;
  border-radius: 2px;
}

.hamburger::before, .hamburger::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 3px;
  background: var(--primary-dark);
  border-radius: 2px;
  left: 0;
}

.hamburger::before { top: -7px; }
.hamburger::after { top: 7px; }

.logo-area {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.app-icon {
  font-size: 2rem;
  animation: float 3s ease-in-out infinite;
}

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

.logo-text h1 {
  font-size: 1.3rem;
  color: var(--primary-dark);
  line-height: 1.1;
}

.sub-logo {
  font-size: 0.72rem;
  color: var(--primary);
  font-weight: 700;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.star-badge {
  background: #FFF9E6;
  border: 2px solid var(--accent);
  color: #D97706;
  padding: 6px 14px;
  border-radius: 20px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(255, 209, 102, 0.3);
}

.pwa-install-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 20px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(74, 144, 226, 0.3);
  transition: var(--transition);
}

.pwa-install-btn:hover {
  transform: translateY(-2px);
  background: #3B7DD8;
}

.hidden {
  display: none !important;
}

/* Drawer / Sidebar */
.drawer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 200;
}

.sidebar-drawer {
  position: fixed;
  top: 0;
  left: -320px;
  width: 320px;
  height: 100vh;
  background: var(--card-bg);
  z-index: 201;
  box-shadow: 5px 0 25px rgba(0,0,0,0.15);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  padding: 20px;
  overflow-y: auto;
}

.sidebar-drawer.open {
  transform: translateX(320px);
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 15px;
  border-bottom: 2px solid #E2E8F0;
}

.close-btn {
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--text-muted);
  cursor: pointer;
}

.search-box {
  margin: 15px 0;
}

.search-box input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #E2E8F0;
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
}

.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
}

.chapters-nav-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.chapter-accordion-item {
  border: 1px solid #E2E8F0;
  border-radius: 14px;
  overflow: hidden;
  background: #F8FAFC;
}

.chapter-accordion-header {
  padding: 12px 15px;
  font-family: var(--font-heading);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}

.chapter-accordion-header:hover {
  background: #EDF2F7;
}

.chapter-lessons-sublist {
  display: none;
  flex-direction: column;
  background: white;
  border-top: 1px solid #E2E8F0;
}

.chapter-accordion-item.expanded .chapter-lessons-sublist {
  display: flex;
}

.lesson-nav-btn {
  padding: 10px 15px 10px 25px;
  text-align: left;
  border: none;
  background: none;
  font-family: var(--font-body);
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--text-color);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lesson-nav-btn:hover, .lesson-nav-btn.active {
  background: #EBF8FF;
  color: var(--primary);
  font-weight: 700;
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 20px;
  padding-bottom: 90px; /* Space for bottom nav */
}

/* Bottom Nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100vw;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  display: flex;
  justify-content: space-around;
  padding: 8px 0;
  border-top: 2px solid rgba(74, 144, 226, 0.15);
  box-shadow: 0 -4px 15px rgba(0,0,0,0.05);
  z-index: 100;
}

.nav-tab {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.75rem;
  transition: var(--transition);
  padding: 4px 12px;
  border-radius: 12px;
}

.nav-tab .tab-icon {
  font-size: 1.4rem;
  margin-bottom: 2px;
}

.nav-tab.active {
  color: var(--primary);
}

.nav-tab.active .tab-icon {
  transform: scale(1.15);
}

/* Hero & Dashboard Views */
.hero-banner {
  background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
  color: white;
  border-radius: var(--border-radius);
  padding: 28px 24px;
  margin-bottom: 25px;
  box-shadow: var(--box-shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.hero-banner::after {
  content: "⚡⚛️🔬";
  position: absolute;
  right: -10px;
  bottom: -10px;
  font-size: 5rem;
  opacity: 0.15;
}

.hero-content {
  max-width: 600px;
}

.hero-content h2 {
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.hero-content p {
  font-size: 0.95rem;
  opacity: 0.95;
  line-height: 1.5;
}

.section-title {
  font-size: 1.4rem;
  color: var(--primary-dark);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Chapter Cards Grid */
.chapters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.chapter-card {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 22px;
  box-shadow: var(--box-shadow);
  transition: var(--transition);
  border: 2px solid transparent;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
}

.chapter-card:hover {
  transform: translateY(-5px);
  border-color: var(--primary);
}

.chapter-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.chapter-icon {
  font-size: 2.2rem;
  background: #EBF8FF;
  width: 55px;
  height: 55px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
}

.chapter-card-title h3 {
  font-size: 1.15rem;
  color: var(--primary-dark);
}

.chapter-card-title span {
  font-size: 0.8rem;
  color: var(--primary);
  font-weight: 700;
}

.chapter-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 16px;
}

.chapter-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  font-family: var(--font-heading);
  color: var(--primary-dark);
  border-top: 1px solid #EDF2F7;
  padding-top: 12px;
}

/* Lesson View Styling */
.lesson-container {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 28px;
  box-shadow: var(--box-shadow);
  max-width: 900px;
  margin: 0 auto;
}

.lesson-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 15px;
}

.lesson-header-title {
  font-size: 1.8rem;
  color: var(--primary-dark);
  margin-bottom: 15px;
}

.mascot-box {
  background: #FFF9E6;
  border-left: 5px solid var(--accent);
  padding: 16px 20px;
  border-radius: 12px;
  display: flex;
  align-items: flex-start;
  gap: 15px;
  margin-bottom: 25px;
  box-shadow: 0 4px 12px rgba(255, 209, 102, 0.15);
}

.mascot-avatar {
  font-size: 2.5rem;
}

.mascot-content h4 {
  color: #B45309;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.mascot-content p {
  font-size: 0.88rem;
  color: #78350F;
  line-height: 1.4;
}

.theory-body {
  font-size: 0.95rem;
  line-height: 1.7;
  color: #334155;
  margin-bottom: 30px;
}

.theory-body h3 {
  color: var(--primary-dark);
  font-size: 1.25rem;
  margin: 20px 0 10px 0;
}

.theory-body ul, .theory-body ol {
  margin-left: 20px;
  margin-bottom: 15px;
}

.theory-body li {
  margin-bottom: 6px;
}

/* Interactive Experiment Playground Box */
.experiment-playground {
  background: #F1F5F9;
  border: 2px dashed #CBD5E1;
  border-radius: 18px;
  padding: 24px;
  margin: 30px 0;
  text-align: center;
}

.experiment-header {
  margin-bottom: 18px;
}

.experiment-header h3 {
  font-size: 1.3rem;
  color: var(--primary-dark);
}

.experiment-header p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.sim-canvas-box {
  background: white;
  border-radius: 14px;
  padding: 20px;
  min-height: 250px;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

/* Quiz Box */
.quiz-section {
  background: linear-gradient(135deg, #F0FDF4 0%, #DCFCE7 100%);
  border: 2px solid #86EFAC;
  border-radius: 18px;
  padding: 25px;
  margin-top: 35px;
}

.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.quiz-header h3 {
  color: #166534;
  font-size: 1.3rem;
}

.question-card {
  background: white;
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}

.question-text {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 14px;
}

.options-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 600px) {
  .options-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.option-btn {
  background: #F8FAFC;
  border: 2px solid #E2E8F0;
  padding: 12px 16px;
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 0.88rem;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
}

.option-btn:hover {
  background: #EBF8FF;
  border-color: var(--primary);
}

.option-btn.correct {
  background: #DCFCE7 !important;
  border-color: #22C55E !important;
  color: #15803D !important;
  font-weight: 700;
}

.option-btn.incorrect {
  background: #FEE2E2 !important;
  border-color: #EF4444 !important;
  color: #B91C1C !important;
}

.quiz-feedback {
  margin-top: 15px;
  padding: 12px;
  border-radius: 10px;
  font-size: 0.88rem;
  line-height: 1.4;
}

.quiz-feedback.success {
  background: #DCFCE7;
  color: #166534;
}

.quiz-feedback.error {
  background: #FEE2E2;
  color: #991B1B;
}

.quiz-score-summary {
  text-align: center;
  padding: 20px;
}

.stars-awarded {
  font-size: 2.5rem;
  margin: 10px 0;
  animation: bounce 1s infinite alternate;
}

@keyframes bounce {
  from { transform: translateY(0); }
  to { transform: translateY(-10px); }
}

.primary-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 25px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
  transition: var(--transition);
  display: inline-block;
  margin-top: 15px;
}

.primary-btn:hover {
  background: #357ABD;
  transform: translateY(-2px);
}

/* Virtual Experiments Canvas Controls */
.sim-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 15px;
}

.sim-btn {
  background: var(--primary-dark);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}

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

/* Progress View Badge Grid */
.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 15px;
  margin-top: 20px;
}

.badge-card {
  background: white;
  border-radius: 14px;
  padding: 15px;
  text-align: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
  border: 2px solid #E2E8F0;
}

.badge-card.unlocked {
  border-color: var(--accent);
  background: #FFFDF0;
}

.badge-icon {
  font-size: 2.2rem;
  margin-bottom: 6px;
}

.badge-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary-dark);
}

/* Responsive tweaks */
@media (max-width: 640px) {
  .hero-banner {
    padding: 20px 16px;
  }
  .hero-content h2 {
    font-size: 1.4rem;
  }
  .lesson-container {
    padding: 18px;
  }
  .lesson-header-title {
    font-size: 1.4rem;
  }
}
