/* STEM Stars Academy - Modern CSS Styles */

/* Import Google Fonts */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Fredoka:wght@300;400;500;600;700&display=swap");

/* CSS Variables for consistent theming */
:root {
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --accent-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --text-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --glass-bg: rgba(255, 255, 255, 0.25);
  --glass-border: rgba(255, 255, 255, 0.2);
  --shadow-glow: 0 0 30px rgba(102, 126, 234, 0.5);
  --border-radius: 1.5rem;
  --transition: all 0.3s ease;
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", sans-serif;
  overflow-x: hidden;
  line-height: 1.6;
  color: #333;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Fredoka", cursive;
  font-weight: 700;
  line-height: 1.2;
}

/* Animations */
@keyframes float {

  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
  }

  33% {
    transform: translateY(-15px) rotate(5deg);
  }

  66% {
    transform: translateY(-25px) rotate(-5deg);
  }
}

@keyframes wiggle {
  0%, 100% {
    transform: translate3d(0, 0, 0) rotate(-2deg);
  }
  50% {
    transform: translate3d(0, 0, 0) rotate(2deg);
  }
}

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

  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideInRight {
  0% {
    transform: translateX(100%);
    opacity: 0;
  }

  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeInUp {
  0% {
    transform: translateY(30px);
    opacity: 0;
  }

  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes rotateSlow {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

@keyframes scalePulse {
  0%, 100% {
    transform: scale3d(1, 1, 1);
  }
  50% {
    transform: scale3d(1.03, 1.03, 1);
  }
}

@keyframes bounceSlow {
  0%, 100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(0, -8px, 0);
  }
}

@keyframes pulseSlow {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.7;
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }

  100% {
    background-position: 200% 0;
  }
}

/* Animation Classes */
.animate-float {
  animation: float 6s ease-in-out infinite;
}

.animate-wiggle {
  animation: wiggle 2s ease-in-out infinite;
  will-change: transform;
}

.animate-slide-left {
  animation: slideInLeft 0.8s ease-out;
}

.animate-slide-right {
  animation: slideInRight 0.8s ease-out;
}

.animate-fade-up {
  animation: fadeInUp 0.8s ease-out;
}

.animate-rotate {
  animation: rotateSlow 8s linear infinite;
}

.animate-scale {
  animation: scalePulse 3s ease-in-out infinite;
  will-change: transform;
}

.animate-bounce-custom {
  animation: bounceSlow 3s ease-in-out infinite;
  will-change: transform;
}

.animate-pulse-custom {
  animation: pulseSlow 4s ease-in-out infinite;
  will-change: opacity;
}

.animate-shimmer {
  background: linear-gradient(90deg,
      transparent,
      rgba(255, 255, 255, 0.4),
      transparent);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

/* Utility Classes */
.text-gradient {
  background: var(--text-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.glass-effect {
  backdrop-filter: blur(10px);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
}

.hover-glow:hover {
  box-shadow: var(--shadow-glow);
}

.scroll-animate {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease;
}

.scroll-animate.visible {
  opacity: 1;
  transform: translateY(0);
}

.delay-1 {
  animation-delay: 0.2s;
}

.delay-2 {
  animation-delay: 0.4s;
}

.delay-3 {
  animation-delay: 0.6s;
}

.delay-4 {
  animation-delay: 0.8s;
}

.delay-5 {
  animation-delay: 1s;
}

/* Background Gradients */
.bg-hero {
  background: var(--primary-gradient);
}

.bg-about {
  background: var(--secondary-gradient);
}

.bg-features {
  background: var(--accent-gradient);
}

/* Header Styles */
.header {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  transition: var(--transition);
}

.header.scrolled {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: white;
  font-weight: 700;
  font-size: 1.25rem;
  text-decoration: none;
}

.logo.scrolled {
  color: #333;
}

.nav-menu {
  display: none;
  gap: 2rem;
  list-style: none;
}

.nav-menu.active {
  display: flex;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  flex-direction: column;
  padding: 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.nav-link {
  color: white;
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
}

.nav-link:hover {
  color: #fbbf24;
  transform: scale(1.1);
}

.nav-link.scrolled {
  color: #333;
}

.nav-link.scrolled:hover {
  color: #667eea;
}

.mobile-menu-btn {
  display: block;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
}

.mobile-menu-btn.scrolled {
  color: #333;
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: var(--primary-gradient);
  color: white;
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: radial-gradient(circle,
      rgba(255, 255, 255, 0.3) 1px,
      transparent 1px);
  background-size: 30px 30px;
  opacity: 0.1;
}

.hero-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  text-align: center;
  position: relative;
  z-index: 10;
}

.hero-title {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  line-height: 1.1;
}

.hero-subtitle {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  opacity: 0.95;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(45deg, #ec4899, #f97316);
  color: white;
  font-weight: 700;
  padding: 1rem 2rem;
  border-radius: 50px;
  text-decoration: none;
  font-size: 1.25rem;
  transition: var(--transition);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.cta-button:hover {
  transform: scale(1.1) rotate(1deg);
  box-shadow: var(--shadow-glow);
}

/* Floating Elements */
.floating-element {
  position: absolute;
  font-size: 3rem;
  opacity: 0.6;
  pointer-events: none;
  z-index: 5;
  animation: float 6s ease-in-out infinite;
  color: rgba(255, 255, 255, 0.8);
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

/* Enhanced floating animation with different speeds */
.floating-element:nth-child(odd) {
  animation-duration: 8s;
  animation-direction: reverse;
}

.floating-element:nth-child(even) {
  animation-duration: 5s;
}

/* Add glow effect on hover */
.floating-element:hover {
  opacity: 0.9;
  transform: scale(1.2);
  text-shadow: 0 0 30px rgba(255, 255, 255, 0.8);
  transition: all 0.3s ease;
}

/* Section Styles */
.section {
  padding: 5rem 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 3rem;
}

/* About Section */
.about {
  background: var(--secondary-gradient);
  color: white;
}

.about-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: center;
}

@media (min-width: 768px) {
  .about-content {
    grid-template-columns: 1fr 1fr;
  }
}

.about-text {
  font-size: 1.125rem;
  line-height: 1.7;
}

.about-text p {
  margin-bottom: 1rem;
}

.about-image {
  text-align: center;
}

.about-image .emoji {
  font-size: 6rem;
  display: block;
  margin-bottom: 1rem;
}

/* Subjects Section */
.subjects {
  background: #f9fafb;
  padding: 5rem 0;
}

.subjects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.subject-card {
  background: white;
  border-radius: var(--border-radius);
  padding: 2rem;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  transition: var(--transition);
  border: 4px solid transparent;
}

.subject-card:hover {
  transform: translateY(-10px) rotate(1deg);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  border-color: #3b82f6;
}

.subject-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
}

.subject-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: #1f2937;
}

.subject-description {
  color: #6b7280;
  line-height: 1.6;
}

/* Features Section */
.features {
  background: var(--accent-gradient);
  color: white;
  padding: 5rem 0;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.feature-item {
  text-align: center;
  transition: var(--transition);
}

.feature-item:hover {
  transform: scale(1.1);
}

.feature-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
}

.feature-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.feature-description {
  opacity: 0.9;
  line-height: 1.6;
}

/* Contact Section */
.contact {
  background: #111827;
  color: white;
  padding: 5rem 0;
  text-align: center;
}

.contact-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.contact-subtitle {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  opacity: 0.9;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  justify-content: center;
  align-items: center;
  margin-bottom: 2rem;
}

@media (min-width: 768px) {
  .contact-info {
    flex-direction: row;
  }
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #374151;
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  transition: var(--transition);
}

.contact-item:hover {
  background: #4b5563;
  transform: scale(1.05);
}

.contact-icon {
  font-size: 1.5rem;
}

/* Footer */
.footer {
  background: #000;
  color: white;
  text-align: center;
  padding: 2rem 0;
}

.footer-text {
  opacity: 0.8;
}

/* Enhanced Mobile Responsiveness */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2rem;
    line-height: 1.2;
  }

  .hero-subtitle {
    font-size: 1rem;
    padding: 0 1rem;
  }

  .section-title {
    font-size: 2rem;
    padding: 0 1rem;
  }

  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    z-index: 1000;
  }

  .nav-menu.active {
    display: flex;
  }

  .mobile-menu-btn {
    display: block;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1001;
  }

  .mobile-menu-btn.scrolled {
    color: #333;
  }

  .nav-link {
    color: #333;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  }

  .nav-link:hover {
    color: #667eea;
  }

  .container {
    padding: 0 1rem;
  }

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

  .features-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .about-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .contact-info {
    flex-direction: column;
    gap: 1rem;
  }

  .contact-item {
    width: 100%;
    justify-content: center;
  }

  .hero-bg {
    background-attachment: scroll !important;
  }

  .floating-element {
    font-size: 2rem !important;
    opacity: 0.5 !important;
  }

  .subject-card {
    padding: 1.5rem;
  }

  .subject-image {
    height: 120px !important;
  }

  .cta-button {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

@media (min-width: 769px) {
  .nav-menu {
    display: flex;
  }

  .mobile-menu-btn {
    display: none;
  }
}

@media (min-width: 1024px) {
  .hero-title {
    font-size: 4rem;
  }

  .hero-subtitle {
    font-size: 1.5rem;
  }

  .subjects-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1280px) {
  .subjects-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .features-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Loading Animation */
.loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--primary-gradient);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease;
}

.loading.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(255, 255, 255, 0.3);
  border-top: 5px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Particle Effects */
.particle {
  position: absolute;
  width: 8px;
  height: 8px;
  background: white;
  border-radius: 50%;
  opacity: 0.5;
  animation: float 4s ease-in-out infinite;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: var(--primary-gradient);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--secondary-gradient);
}

/* Additional Modern UI Enhancements */
.hero-bg {
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-position: center;
}

.subject-image {
  transition: transform 0.3s ease;
  border-radius: 1rem;
  overflow: hidden;
}

.subject-card:hover .subject-image {
  transform: scale(1.05);
}

/* Smooth transitions for all interactive elements */
* {
  transition: all 0.3s ease;
}

/* Enhanced focus states for accessibility */
button:focus,
a:focus {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

/* Improved text selection */
::selection {
  background: rgba(102, 126, 234, 0.3);
  color: #333;
}

/* Better button hover effects */
.cta-button {
  position: relative;
  overflow: hidden;
}

.cta-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg,
      transparent,
      rgba(255, 255, 255, 0.2),
      transparent);
  transition: left 0.5s;
}

.cta-button:hover::before {
  left: 100%;
}

/* Enhanced card shadows */
.subject-card,
.feature-item {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.subject-card:hover,
.feature-item:hover {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Loading state improvements */
.loading-spinner {
  border: 5px solid rgba(255, 255, 255, 0.3);
  border-top: 5px solid white;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
}

/* Better mobile touch targets */
@media (max-width: 768px) {

  .nav-link,
  .cta-button,
  .contact-item {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* Print styles */
@media print {

  .header,
  .floating-element,
  .loading {
    display: none;
  }

  .hero {
    background: none !important;
    color: #000 !important;
  }

  .section {
    page-break-inside: avoid;
  }
}