/*
 Theme Name:   Latein Ludus
 Theme URI:    https://latein-ludus.de
 Description:  Modernes WordPress Child-Theme fuer die Latein-Lernspiele-Plattform. Basiert auf Astra.
 Author:       IT-Kuebrich
 Author URI:   https://it-kuebrich.de
 Template:     astra
 Version:      1.0.0
 License:      GNU General Public License v2 or later
 Text Domain:  latein-ludus
*/

/* ============================================================
   LATEIN LUDUS – Custom Styles
   Modern & Clean Design mit Gamification
   ============================================================ */

/* === CSS Custom Properties === */
:root {
  --ll-primary: #2563eb;
  --ll-primary-dark: #1d4ed8;
  --ll-primary-light: #dbeafe;
  --ll-secondary: #f59e0b;
  --ll-secondary-dark: #d97706;
  --ll-accent: #10b981;
  --ll-accent-dark: #059669;
  --ll-dark: #0f172a;
  --ll-gray-900: #1e293b;
  --ll-gray-800: #334155;
  --ll-gray-700: #475569;
  --ll-gray-500: #64748b;
  --ll-gray-300: #cbd5e1;
  --ll-gray-200: #e2e8f0;
  --ll-gray-100: #f1f5f9;
  --ll-gray-50: #f8fafc;
  --ll-white: #ffffff;
  --ll-danger: #ef4444;
  --ll-gold: #f59e0b;
  --ll-silver: #94a3b8;
  --ll-bronze: #d97706;
  --ll-radius: 12px;
  --ll-radius-sm: 8px;
  --ll-radius-lg: 16px;
  --ll-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.04);
  --ll-shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 10px 24px rgba(0,0,0,0.06);
  --ll-shadow-lg: 0 10px 25px rgba(0,0,0,0.08), 0 20px 48px rgba(0,0,0,0.06);
  --ll-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --ll-font: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* === Global Resets & Base === */
body {
  font-family: var(--ll-font);
  color: var(--ll-gray-800);
  background: var(--ll-gray-50);
  line-height: 1.6;
}

a {
  color: var(--ll-primary);
  text-decoration: none;
  transition: var(--ll-transition);
}

a:hover {
  color: var(--ll-primary-dark);
}

/* === Header / Navigation === */
.ll-header {
  background: var(--ll-white);
  border-bottom: 1px solid var(--ll-gray-200);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: rgba(255,255,255,0.95);
}

.ll-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.ll-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--ll-dark);
}

.ll-logo img {
  height: 44px;
  width: auto;
}

.ll-logo span.highlight {
  color: var(--ll-primary);
}

.ll-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.ll-nav a {
  padding: 8px 16px;
  border-radius: var(--ll-radius-sm);
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--ll-gray-700);
  transition: var(--ll-transition);
}

.ll-nav a:hover,
.ll-nav a.active {
  background: var(--ll-primary-light);
  color: var(--ll-primary-dark);
}

.ll-nav-cta {
  background: var(--ll-primary) !important;
  color: var(--ll-white) !important;
  padding: 8px 20px !important;
  border-radius: 20px !important;
}

.ll-nav-cta:hover {
  background: var(--ll-primary-dark) !important;
  transform: translateY(-1px);
}

/* === Mobile Menu === */
.ll-menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--ll-gray-700);
}

@media (max-width: 768px) {
  .ll-menu-toggle { display: block; }
  .ll-nav {
    display: none;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--ll-white);
    flex-direction: column;
    padding: 16px;
    border-bottom: 1px solid var(--ll-gray-200);
    box-shadow: var(--ll-shadow-md);
  }
  .ll-nav.open { display: flex; }
}

/* === Hero Section === */
.ll-hero {
  background: linear-gradient(135deg, var(--ll-primary) 0%, #7c3aed 50%, #a855f7 100%);
  color: var(--ll-white);
  padding: 80px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.ll-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(255,255,255,0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255,255,255,0.08) 0%, transparent 40%);
}

.ll-hero-inner {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.ll-hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  margin-bottom: 16px;
  line-height: 1.2;
}

.ll-hero p {
  font-size: 1.15rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto 32px;
}

.ll-hero-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 40px;
}

.ll-hero-stat {
  text-align: center;
}

.ll-hero-stat .num {
  display: block;
  font-size: 2rem;
  font-weight: 800;
}

.ll-hero-stat .label {
  font-size: 0.85rem;
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* === Buttons === */
.ll-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 24px;
  font-weight: 600;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: var(--ll-transition);
}

.ll-btn-white {
  background: var(--ll-white);
  color: var(--ll-primary-dark);
  box-shadow: var(--ll-shadow);
}

.ll-btn-white:hover {
  transform: translateY(-2px);
  box-shadow: var(--ll-shadow-md);
  color: var(--ll-primary-dark);
}

.ll-btn-primary {
  background: var(--ll-primary);
  color: var(--ll-white);
}

.ll-btn-primary:hover {
  background: var(--ll-primary-dark);
  transform: translateY(-2px);
}

.ll-btn-outline {
  background: transparent;
  color: var(--ll-white);
  border: 2px solid rgba(255,255,255,0.4);
}

.ll-btn-outline:hover {
  background: rgba(255,255,255,0.15);
  border-color: var(--ll-white);
  color: var(--ll-white);
}

/* === Section Layout === */
.ll-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 64px 24px;
}

.ll-section-header {
  text-align: center;
  margin-bottom: 48px;
}

.ll-section-header h2 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--ll-dark);
  margin-bottom: 8px;
}

.ll-section-header p {
  color: var(--ll-gray-500);
  font-size: 1.05rem;
}

/* === Kategorie-Karten === */
.ll-categories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.ll-category-card {
  background: var(--ll-white);
  border-radius: var(--ll-radius-lg);
  padding: 32px;
  box-shadow: var(--ll-shadow);
  border: 1px solid var(--ll-gray-200);
  transition: var(--ll-transition);
  position: relative;
  overflow: hidden;
}

.ll-category-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}

.ll-category-card.konj::before { background: var(--ll-primary); }
.ll-category-card.dekl::before { background: var(--ll-secondary); }
.ll-category-card.perf::before { background: var(--ll-accent); }
.ll-category-card.extra::before { background: #8b5cf6; }

.ll-category-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--ll-shadow-lg);
}

.ll-category-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--ll-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 20px;
}

.konj .ll-category-icon { background: var(--ll-primary-light); }
.dekl .ll-category-icon { background: #fef3c7; }
.perf .ll-category-icon { background: #d1fae5; }
.extra .ll-category-icon { background: #ede9fe; }

.ll-category-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ll-dark);
  margin-bottom: 8px;
}

.ll-category-card p {
  color: var(--ll-gray-500);
  font-size: 0.95rem;
  margin-bottom: 20px;
}

.ll-category-games {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.ll-game-tag {
  background: var(--ll-gray-100);
  color: var(--ll-gray-700);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

.ll-category-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ll-game-count {
  font-size: 0.85rem;
  color: var(--ll-gray-500);
}

/* === Spiele-Grid === */
.ll-games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.ll-game-card {
  background: var(--ll-white);
  border-radius: var(--ll-radius);
  padding: 24px;
  box-shadow: var(--ll-shadow);
  border: 1px solid var(--ll-gray-200);
  transition: var(--ll-transition);
  display: flex;
  flex-direction: column;
}

.ll-game-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--ll-shadow-md);
  border-color: var(--ll-primary);
}

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

.ll-game-type-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--ll-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.ll-game-card h4 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ll-dark);
  line-height: 1.3;
}

.ll-game-card .ll-game-desc {
  color: var(--ll-gray-500);
  font-size: 0.9rem;
  flex-grow: 1;
  margin-bottom: 16px;
}

.ll-game-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--ll-gray-100);
}

.ll-difficulty {
  display: flex;
  gap: 3px;
}

.ll-difficulty-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ll-gray-200);
}

.ll-difficulty-dot.active { background: var(--ll-secondary); }

.ll-play-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: 20px;
  background: var(--ll-primary);
  color: var(--ll-white);
  font-weight: 600;
  font-size: 0.85rem;
  border: none;
  cursor: pointer;
  transition: var(--ll-transition);
}

.ll-play-btn:hover {
  background: var(--ll-primary-dark);
  transform: scale(1.05);
  color: var(--ll-white);
}

/* ============================================================
   RANGLISTE / LEADERBOARD
   ============================================================ */
.ll-leaderboard-section {
  background: linear-gradient(180deg, var(--ll-gray-50) 0%, var(--ll-white) 100%);
}

.ll-leaderboard-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 32px;
}

.ll-tab {
  padding: 8px 20px;
  border-radius: 20px;
  font-weight: 500;
  font-size: 0.9rem;
  border: 1px solid var(--ll-gray-200);
  background: var(--ll-white);
  color: var(--ll-gray-700);
  cursor: pointer;
  transition: var(--ll-transition);
}

.ll-tab:hover {
  border-color: var(--ll-primary);
  color: var(--ll-primary);
}

.ll-tab.active {
  background: var(--ll-primary);
  color: var(--ll-white);
  border-color: var(--ll-primary);
}

/* Podium Top 3 */
.ll-podium {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 40px;
  padding: 0 20px;
}

.ll-podium-place {
  text-align: center;
  position: relative;
}

.ll-podium-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 auto 8px;
  position: relative;
}

.ll-podium-place.gold .ll-podium-avatar {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: var(--ll-white);
  box-shadow: 0 4px 20px rgba(245,158,11,0.4);
  font-size: 1.8rem;
}

.ll-podium-place.silver .ll-podium-avatar {
  background: linear-gradient(135deg, #cbd5e1, #94a3b8);
  color: var(--ll-white);
  box-shadow: 0 4px 16px rgba(148,163,184,0.4);
}

.ll-podium-place.bronze .ll-podium-avatar {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: var(--ll-white);
  box-shadow: 0 4px 16px rgba(217,119,6,0.4);
}

.ll-podium-crown {
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.4rem;
}

.ll-podium-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--ll-dark);
  margin-bottom: 4px;
}

.ll-podium-score {
  font-size: 0.85rem;
  color: var(--ll-gray-500);
}

.ll-podium-bar {
  width: 120px;
  border-radius: var(--ll-radius-sm) var(--ll-radius-sm) 0 0;
  margin-top: 12px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12px;
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--ll-white);
}

.ll-podium-place.gold .ll-podium-bar {
  height: 140px;
  background: linear-gradient(180deg, #fbbf24, #f59e0b);
}

.ll-podium-place.silver .ll-podium-bar {
  height: 105px;
  background: linear-gradient(180deg, #cbd5e1, #94a3b8);
}

.ll-podium-place.bronze .ll-podium-bar {
  height: 80px;
  background: linear-gradient(180deg, #fbbf24, #d97706);
}

/* Ranglisten-Tabelle */
.ll-leaderboard-table {
  max-width: 800px;
  margin: 0 auto;
  background: var(--ll-white);
  border-radius: var(--ll-radius-lg);
  box-shadow: var(--ll-shadow);
  overflow: hidden;
  border: 1px solid var(--ll-gray-200);
}

.ll-lb-row {
  display: grid;
  grid-template-columns: 60px 1fr 120px 120px 100px;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--ll-gray-100);
  transition: var(--ll-transition);
}

.ll-lb-row:last-child { border-bottom: none; }

.ll-lb-row:hover {
  background: var(--ll-gray-50);
}

.ll-lb-row.header {
  background: var(--ll-gray-50);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ll-gray-500);
}

.ll-lb-rank {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--ll-gray-700);
}

.ll-lb-rank.top1 { color: var(--ll-gold); }
.ll-lb-rank.top2 { color: var(--ll-silver); }
.ll-lb-rank.top3 { color: var(--ll-bronze); }

.ll-lb-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ll-lb-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ll-primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ll-primary);
}

.ll-lb-name {
  font-weight: 600;
  color: var(--ll-dark);
}

.ll-lb-points {
  font-weight: 700;
  color: var(--ll-primary);
}

.ll-lb-progress {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ll-progress-bar {
  flex-grow: 1;
  height: 8px;
  background: var(--ll-gray-200);
  border-radius: 4px;
  overflow: hidden;
}

.ll-progress-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--ll-accent), #34d399);
  transition: width 0.6s ease;
}

.ll-lb-level {
  text-align: center;
}

.ll-level-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.8rem;
}

.ll-level-badge.beginner { background: #dbeafe; color: #1d4ed8; }
.ll-level-badge.advanced { background: #d1fae5; color: #059669; }
.ll-level-badge.expert { background: #fef3c7; color: #d97706; }
.ll-level-badge.master { background: #ede9fe; color: #7c3aed; }

/* === Fortschritts-Dashboard === */
.ll-progress-dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.ll-stat-card {
  background: var(--ll-white);
  border-radius: var(--ll-radius);
  padding: 24px;
  box-shadow: var(--ll-shadow);
  border: 1px solid var(--ll-gray-200);
  text-align: center;
}

.ll-stat-value {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.ll-stat-value.blue { color: var(--ll-primary); }
.ll-stat-value.green { color: var(--ll-accent); }
.ll-stat-value.gold { color: var(--ll-secondary); }
.ll-stat-value.purple { color: #8b5cf6; }

.ll-stat-label {
  font-size: 0.85rem;
  color: var(--ll-gray-500);
  font-weight: 500;
}

/* === Footer === */
.ll-footer {
  background: var(--ll-dark);
  color: var(--ll-gray-300);
  padding: 48px 24px;
  text-align: center;
}

.ll-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.ll-footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 20px;
  list-style: none;
  padding: 0;
}

.ll-footer-links a {
  color: var(--ll-gray-300);
  font-size: 0.9rem;
}

.ll-footer-links a:hover {
  color: var(--ll-white);
}

.ll-footer-copy {
  font-size: 0.8rem;
  color: var(--ll-gray-500);
}

/* === Responsive Anpassungen === */
@media (max-width: 768px) {
  .ll-hero { padding: 48px 20px; }
  .ll-hero h1 { font-size: 1.8rem; }
  .ll-hero-stats { gap: 20px; }
  .ll-hero-stat .num { font-size: 1.5rem; }
  .ll-section { padding: 40px 16px; }
  .ll-section-header h2 { font-size: 1.5rem; }
  .ll-categories { grid-template-columns: 1fr; }
  .ll-games-grid { grid-template-columns: 1fr; }
  .ll-podium { gap: 8px; }
  .ll-podium-bar { width: 90px; }
  .ll-podium-place.gold .ll-podium-bar { height: 100px; }
  .ll-podium-place.silver .ll-podium-bar { height: 75px; }
  .ll-podium-place.bronze .ll-podium-bar { height: 55px; }
  .ll-lb-row {
    grid-template-columns: 40px 1fr 80px;
    font-size: 0.85rem;
  }
  .ll-lb-progress, .ll-lb-level { display: none; }
  .ll-progress-dashboard { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .ll-progress-dashboard { grid-template-columns: 1fr; }
  .ll-leaderboard-tabs { flex-wrap: wrap; }
}

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

.ll-animate-in {
  animation: fadeInUp 0.5s ease forwards;
}

.ll-animate-in:nth-child(2) { animation-delay: 0.1s; }
.ll-animate-in:nth-child(3) { animation-delay: 0.2s; }
.ll-animate-in:nth-child(4) { animation-delay: 0.3s; }

/* === Spiel-Embed (iFrame fuer die HTML-Spiele) === */
.ll-game-embed {
  width: 100%;
  border: none;
  border-radius: var(--ll-radius);
  min-height: 600px;
  background: var(--ll-white);
  box-shadow: var(--ll-shadow-md);
}

.ll-game-wrapper {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px;
}

.ll-game-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--ll-gray-500);
  margin-bottom: 20px;
}

.ll-game-breadcrumb a {
  color: var(--ll-gray-500);
}

.ll-game-breadcrumb a:hover {
  color: var(--ll-primary);
}
