:root {
  /* Premium Educational Colors */
  --primary: #4DA8DA;
  /* Azul pedagógico */
  --primary-hover: #3b94c4;
  --secondary: #7EC15A;
  /* Verde educativo */
  --secondary-hover: #6ab047;
  --accent-yellow: #FFD166;
  /* Amarelo divertido */
  --accent-orange: #FF9F1C;
  /* Laranja pastel */
  --accent-purple: #9D8DF1;
  /* Roxo leve */
  --accent-turquoise: #4ECDC4;
  /* Turquesa claro */
  --accent-coral: #EF476F;
  /* Para favoritos e avisos */

  /* Text Colors */
  --text-dark: #2F3E46;
  /* Softer black for better readability */
  --text-muted: #5C6F7B;
  --text-light: #94A3B8;

  /* Backgrounds */
  --bg-main: #F7F9FC;
  /* Light slightly bluish grey */
  --bg-card: #FFFFFF;
  --bg-sidebar: #FFFFFF;

  --border-color: #E2E8F0;

  /* Typography */
  --font-heading: 'Outfit', 'Nunito', sans-serif;
  --font-body: 'Inter', 'Nunito', sans-serif;

  /* Playful Radii */
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;

  /* Soft Shadows */
  --shadow-sm: 0 4px 6px -1px rgba(77, 168, 218, 0.05);
  --shadow-md: 0 10px 15px -3px rgba(77, 168, 218, 0.1);
  --shadow-lg: 0 20px 25px -5px rgba(77, 168, 218, 0.15);
  --shadow-hover: 0 25px 50px -12px rgba(77, 168, 218, 0.25);

  /* Transitions */
  --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  color: var(--text-dark);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-dark);
}

a {
  text-decoration: none;
  color: inherit;
}

/* Subtle organic background pattern for the whole app */
body::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0.02;
  pointer-events: none;
  z-index: -1;
  background-image:
    radial-gradient(var(--text-dark) 1px, transparent 1px),
    radial-gradient(var(--text-dark) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: 0 0, 20px 20px;
  background-attachment: fixed;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Utilities */
.text-primary {
  color: var(--primary);
}

.text-secondary {
  color: var(--secondary);
}

.text-muted {
  color: var(--text-muted);
}

.text-center {
  text-align: center;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.05rem;
  border-radius: 100px;
  /* Fully rounded buttons */
  border: none;
  cursor: pointer;
  transition: var(--transition-fast);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.1);
  /* 3D effect */
  position: relative;
  overflow: hidden;
}

.btn:active {
  transform: translateY(4px);
  box-shadow: 0 0px 0 rgba(0, 0, 0, 0.1);
}

.btn-primary {
  background-color: var(--primary);
  color: white;
  box-shadow: 0 4px 0 #3b94c4;
}

.btn-primary:active {
  box-shadow: 0 0px 0 #3b94c4;
}

.btn-secondary {
  background-color: var(--secondary);
  color: white;
  box-shadow: 0 4px 0 #6ab047;
}

.btn-secondary:active {
  box-shadow: 0 0px 0 #6ab047;
}

.btn-outline {
  background-color: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
  box-shadow: 0 4px 0 rgba(77, 168, 218, 0.2);
}

.btn-outline:active {
  box-shadow: 0 0px 0 rgba(77, 168, 218, 0.2);
}

.btn-icon {
  padding: 12px;
  border-radius: 50%;
  background: white;
  color: var(--text-muted);
  border: 2px solid var(--border-color);
  box-shadow: 0 3px 0 var(--border-color);
}

.btn-icon:hover {
  color: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 3px 0 var(--primary);
}

.btn-icon:active {
  box-shadow: 0 0px 0 var(--primary);
}

/* Forms */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-dark);
}

.form-control {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(90, 155, 213, 0.2);
}

/* Layout - App Shell */
.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  width: 280px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100%;
  z-index: 10;
  position: relative;
}

.sidebar-header {
  padding: 32px 24px;
  border-bottom: 2px dashed var(--border-color);
  display: flex;
  align-items: center;
  gap: 16px;
}

.sidebar-header h3 {
  font-size: 1.5rem;
  color: var(--primary);
  letter-spacing: -0.5px;
}

.sidebar-logo-icon {
  width: 48px;
  height: 48px;
  background-color: var(--accent-yellow);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dark);
  font-size: 24px;
  box-shadow: 0 4px 0 #e6bc5c;
  /* Cute 3D effect */
  transform: rotate(-5deg);
  /* Playful angle */
}

.sidebar-nav {
  flex: 1;
  padding: 24px 16px;
  overflow-y: auto;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 8px;
  transition: var(--transition-fast);
  border: 2px solid transparent;
}

.nav-link i {
  color: var(--text-light);
  transition: var(--transition-fast);
}

.nav-link:hover {
  background-color: white;
  color: var(--primary);
  border-color: var(--border-color);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.nav-link:hover i {
  color: var(--accent-orange);
  transform: scale(1.1);
}

.nav-link.active {
  background-color: var(--primary);
  color: white;
  box-shadow: 0 4px 0 #3b94c4;
}

.nav-link.active i {
  color: white;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.header {
  height: 90px;
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  z-index: 5;
}

.header-search {
  position: relative;
  width: 480px;
}

.header-search i {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 24px;
  height: 24px;
}

.header-search input {
  width: 100%;
  padding: 16px 20px 16px 56px;
  border-radius: 100px;
  border: 3px solid var(--border-color);
  background-color: var(--bg-main);
  transition: var(--transition-fast);
  font-size: 1rem;
  font-weight: 500;
}

.header-search input:focus {
  background-color: white;
  outline: none;
  border-color: var(--accent-orange);
  box-shadow: 0 4px 15px rgba(255, 159, 28, 0.15);
}

.header-user {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-avatar {
  width: 48px;
  height: 48px;
  background-color: var(--accent-purple);
  border: 3px solid white;
  box-shadow: 0 4px 0 rgba(157, 141, 241, 0.3);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.25rem;
}

.page-content {
  flex: 1;
  overflow-y: auto;
  padding: 32px;
}

/* Cards System */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 32px;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 32px;
  margin-bottom: 40px;
}

.stat-card {
  background: white;
  padding: 24px;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 20px;
  border: 3px solid transparent;
  transition: var(--transition-fast);
}

.stat-card:hover {
  transform: translateY(-5px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  /* Playful circle */
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon.blue {
  background: rgba(77, 168, 218, 0.15);
  color: var(--primary);
}

.stat-icon.green {
  background: rgba(126, 193, 90, 0.15);
  color: var(--secondary);
}

.stat-icon.yellow {
  background: rgba(255, 209, 102, 0.2);
  color: #E6A210;
}

.stat-icon.orange {
  background: rgba(255, 159, 28, 0.15);
  color: var(--accent-orange);
}

.stat-icon.purple {
  background: rgba(157, 141, 241, 0.15);
  color: var(--accent-purple);
}

.stat-icon.turquoise {
  background: rgba(78, 205, 196, 0.15);
  color: var(--accent-turquoise);
}

.stat-icon i {
  width: 32px;
  height: 32px;
}

.stat-info h3 {
  font-size: 2.25rem;
  margin: 0;
  line-height: 1;
  color: var(--text-dark);
}

.stat-info p {
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 6px;
}

/* Activity Card */
.activity-card {
  background: white;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: var(--transition-fast);
  display: flex;
  flex-direction: column;
  border: 3px solid white;
  /* For hover effect */
  position: relative;
}

/* Add a playful decorative shape to the card */
.activity-card::before {
  content: '';
  position: absolute;
  top: -20px;
  right: -20px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--accent-yellow);
  opacity: 0;
  transition: var(--transition);
  z-index: 2;
}

.activity-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary);
}

.activity-card:hover::before {
  opacity: 0.8;
  transform: scale(1.5);
}

.card-img-wrap {
  height: 220px;
  background-color: var(--bg-main);
  position: relative;
  overflow: hidden;
  padding: 16px;
}

/* To give thumbnails an organic floating feel */
.card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  background: white;
  transition: var(--transition);
}

.activity-card:hover .card-img-wrap img {
  transform: scale(1.05) rotate(1deg);
}

.card-badge {
  position: absolute;
  top: 24px;
  left: 24px;
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 800;
  color: white;
  z-index: 3;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.15);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Colors for specific badges applied dynamically via JS / inline or mapped classes */
.badge-alfabetizacao {
  background-color: var(--accent-yellow);
  color: #8F6A00;
}

.badge-numerais {
  background-color: var(--primary);
}

.badge-coordenacao {
  background-color: var(--secondary);
}

.badge-cores_formas {
  background-color: var(--accent-purple);
}

.badge-desenhos {
  background-color: var(--accent-orange);
}

.badge-jogos {
  background-color: var(--accent-turquoise);
  color: #0C6B64;
}

.badge-tematica {
  background-color: var(--accent-coral);
}

.card-fav {
  position: absolute;
  top: 24px;
  right: 24px;
  background: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  transition: var(--transition-fast);
  z-index: 3;
}

.card-fav:hover {
  transform: scale(1.1);
}

.card-fav:active {
  transform: scale(0.95);
}

.card-fav.active {
  color: var(--accent-coral);
  background: #FFE8E8;
}

.card-body {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  background: white;
  z-index: 1;
  /* Keeps it above the decorative shape if it expands */
}

.card-title {
  font-size: 1.25rem;
  margin-bottom: 12px;
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1.3;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.card-tags span {
  background: var(--bg-main);
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 100px;
  font-weight: 600;
}

.card-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 24px;
  flex: 1;
  font-weight: 500;
}

.card-actions {
  display: flex;
  gap: 12px;
}

.card-actions .btn {
  flex: 1;
  padding: 12px 16px;
  font-size: 0.95rem;
}

/* Auth Layout */
.auth-layout {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #F4F7F9 0%, #E2E8F0 100%);
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 480px;
  background: white;
  border-radius: var(--radius-xl);
  padding: 48px;
  box-shadow: var(--shadow-lg);
}

.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-header h1 {
  font-size: 2rem;
  margin-bottom: 8px;
}

.auth-header p {
  color: var(--text-muted);
}

/* Fullscreen Viewer */
.viewer-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  display: flex;
  flex-direction: column;
}

.viewer-header {
  padding: 16px 24px;
  background: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.viewer-actions {
  display: flex;
  gap: 12px;
}

.viewer-content {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 24px;
}

.viewer-content iframe {
  width: 100%;
  max-width: 900px;
  height: 100%;
  background: white;
  border-radius: var(--radius-sm);
  border: none;
}

/* Landing Page Specifics */
.hero {
  text-align: center;
  padding: 80px 24px;
  background: white;
  border-radius: var(--radius-xl);
  margin-bottom: 48px;
  box-shadow: var(--shadow-md);
}

.hero h1 {
  font-size: 3.5rem;
  margin-bottom: 24px;
  color: var(--primary);
  line-height: 1.2;
}

.hero p {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 32px;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
}

/* Hide utility */
.d-none {
  display: none !important;
}

.mobile-only {
  display: none !important;
}

/* Landing Page Additions */
.landing-container {
  padding-top: 40px;
  padding-bottom: 80px;
}

.landing-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 64px;
  gap: 16px;
}

.landing-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--primary);
  line-height: 1.2;
}

.landing-actions {
  display: flex;
  gap: 16px;
}

.mobile-break {
  display: none;
}

.hero-actions .btn {
  padding: 16px 32px;
  font-size: 1.125rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .mobile-only {
    display: flex !important;
  }

  .app-layout {
    flex-direction: column;
    padding-bottom: 70px;
    /* Space for bottom nav */
  }

  .sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    border-right: none;
    border-top: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 100;
  }

  .sidebar-header {
    display: none;
    /* Hide top branding on mobile to save space */
  }

  .sidebar-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 12px;
    gap: 0;
    overflow: visible;
  }

  .nav-link {
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    margin: 0;
    font-size: 0.70rem;
    border: none;
    background: transparent !important;
    color: var(--text-muted);
    flex: 1;
    text-align: center;
    box-shadow: none !important;
  }

  .nav-link i {
    width: 20px;
    height: 20px;
    margin: 0 auto;
  }

  .nav-link.active {
    color: var(--primary);
  }

  .nav-link.active i {
    color: var(--primary);
  }

  .header {
    padding: 16px;
    height: auto;
    flex-wrap: wrap;
    gap: 16px;
  }

  .header h2 {
    font-size: 1.25rem;
  }

  .header-search {
    width: 100%;
    order: 3;
  }

  .header-search input {
    padding: 12px 16px 12px 48px;
  }

  .page-content {
    padding: 16px;
  }

  .hero h1 {
    font-size: 2.25rem;
  }

  .hero-actions {
    flex-direction: column;
  }

  /* Filter tabs on mobile */
  #filterTabs {
    overflow-x: auto;
    padding-bottom: 8px;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch;
  }

  #filterTabs .btn {
    flex-shrink: 0;
    padding: 8px 16px;
    font-size: 0.9rem;
  }

  /* Activity card text scaling for mobile */
  .card-title {
    font-size: 1.1rem;
  }

  .landing-container {
    padding-top: 24px;
    padding-bottom: 40px;
  }

  .landing-header {
    flex-direction: column;
    margin-bottom: 32px;
    gap: 20px;
  }

  .landing-logo {
    justify-content: center;
    font-size: 1.6rem;
    text-align: center;
  }

  .mobile-break {
    display: inline;
  }

  .landing-actions {
    width: 100%;
    justify-content: center;
  }

  .landing-actions .btn {
    flex: 1;
    padding: 12px 16px;
    font-size: 0.95rem;
    white-space: nowrap;
  }

  .hero {
    padding: 32px 16px;
  }

  .hero h1 {
    font-size: 1.8rem;
    margin-bottom: 16px;
  }

  .hero p {
    font-size: 1.1rem;
    margin-bottom: 24px;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
  }

  .hero-actions .btn {
    width: 100%;
    padding: 14px 20px;
    font-size: 1rem;
  }

  .auth-card {
    padding: 32px 20px;
  }
}