/* ===== CSS Variables ===== */
:root {
  --primary-color: #1e3a8a;
  --secondary-color: #38bdf8;
  --accent-color: #60a5fa;
  --gradient-primary: linear-gradient(135deg, #1e3a8a, #2563eb);
  --gradient-secondary: linear-gradient(135deg, #38bdf8, #0ea5e9);
  --gradient-accent: linear-gradient(135deg, #60a5fa, #3b82f6);
  
  --dark-color: #0f172a;
  --light-color: #f8fafc;
  --gray-color: #64748b;
  --white-color: #ffffff;
  
  --font-primary: 'Inter', sans-serif;
  --font-display: 'Playfair Display', serif;
  
  --border-radius: 12px;
  --border-radius-lg: 20px;
  --border-radius-xl: 30px;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.2);
  --shadow-xl: 0 16px 64px rgba(0, 0, 0, 0.25);
  
  --transition-fast: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-medium: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  
  --z-index-dropdown: 1000;
  --z-index-sticky: 1020;
  --z-index-fixed: 1030;
  --z-index-modal-backdrop: 1040;
  --z-index-modal: 1050;
  --z-index-popover: 1060;
  --z-index-tooltip: 1070;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-primary);
  line-height: 1.6;
  color: var(--dark-color);
  background-color: var(--white-color);
  overflow-x: hidden;
}

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

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

.loading-container {
  text-align: center;
  color: white;
}

.logo-3d-container {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 2rem;
}

.logo-3d {
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: white;
  position: relative;
  z-index: 2;
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.2);
  animation: logo-rotate 3s ease-in-out infinite;
}

@keyframes logo-rotate {
  0%, 100% { transform: rotateY(0deg) scale(1); }
  50% { transform: rotateY(180deg) scale(1.1); }
}

.particles-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  height: 200px;
  z-index: 1;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: white;
  border-radius: 50%;
  animation: particle-float 2s ease-in-out infinite;
}

@keyframes particle-float {
  0%, 100% { transform: translateY(0) scale(1); opacity: 1; }
  50% { transform: translateY(-20px) scale(1.5); opacity: 0.7; }
}

.loading-bar {
  width: 200px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  overflow: hidden;
  margin: 1rem auto;
}

.loading-progress {
  height: 100%;
  background: linear-gradient(90deg, var(--secondary-color), var(--accent-color));
  border-radius: 2px;
  width: 0%;
  transition: width 0.3s ease;
}

.loading-text {
  font-size: 0.9rem;
  opacity: 0.8;
}

/* ===== Navigation ===== */
#main-navbar {
  background: rgba(15, 23, 42, 0.95) !important;
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1rem 0;
  transition: var(--transition-fast);
}

#main-navbar.scrolled {
  background: rgba(15, 23, 42, 0.98) !important;
  box-shadow: var(--shadow-lg);
}

.navbar-brand {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: white !important;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-icon {
  font-size: 2rem;
  background: var(--gradient-secondary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-link {
  color: rgba(255, 255, 255, 0.8) !important;
  font-weight: 500;
  padding: 0.5rem 1rem !important;
  position: relative;
  transition: var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
  color: var(--secondary-color) !important;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--secondary-color);
  transition: var(--transition-fast);
  transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 80%;
}

/* ===== Hero Section ===== */
.hero-section {
  position: relative;
  min-height: 100vh;
  background: var(--gradient-primary);
  overflow: hidden;
}

.three-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.8), rgba(37, 99, 235, 0.6));
  z-index: 2;
}

.hero-content {
  position: relative;
  z-index: 3;
  color: white;
  padding-top: 100px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1.5rem;
}

.title-line {
  display: block;
  opacity: 0;
  transform: translateY(30px);
  animation: title-reveal 0.8s ease-out forwards;
}

.title-line:nth-child(2) {
  animation-delay: 0.2s;
}

.title-line:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes title-reveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.text-gradient {
  background: var(--gradient-secondary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-description {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  opacity: 0.9;
  max-width: 600px;
}

.hero-stats {
  margin-bottom: 2rem;
}

.stat-item {
  text-align: center;
  padding: 1rem;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--secondary-color);
  display: block;
  line-height: 1;
}

.stat-label {
  font-size: 0.9rem;
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ===== Buttons ===== */
.btn {
  border: none;
  border-radius: var(--border-radius);
  font-weight: 600;
  padding: 0.75rem 2rem;
  transition: var(--transition-fast);
  position: relative;
  overflow: hidden;
}

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

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-outline-light {
  border: 2px solid white;
  background: transparent;
  color: white;
}

.btn-outline-light:hover {
  background: white;
  color: var(--primary-color);
  transform: translateY(-2px);
}

.btn-3d {
  transform-style: preserve-3d;
  transform: perspective(1000px) rotateX(0deg);
  transition: var(--transition-medium);
}

.btn-3d:hover {
  transform: perspective(1000px) rotateX(-5deg) translateY(-3px);
}

.btn-3d-outline {
  transform-style: preserve-3d;
  transform: perspective(1000px) rotateX(0deg);
  transition: var(--transition-medium);
}

.btn-3d-outline:hover {
  transform: perspective(1000px) rotateX(-5deg) translateY(-3px);
}

/* ===== Floating Elements ===== */
.floating-elements {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.floating-element {
  position: absolute;
  width: 100px;
  height: 100px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  animation: float 6s ease-in-out infinite;
}

.floating-element:nth-child(1) {
  top: 20%;
  left: 10%;
  animation-delay: 0s;
}

.floating-element:nth-child(2) {
  top: 60%;
  right: 15%;
  animation-delay: 2s;
}

.floating-element:nth-child(3) {
  bottom: 20%;
  left: 70%;
  animation-delay: 4s;
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(180deg); }
}

/* ===== Section Styles ===== */
.section-header {
  margin-bottom: 3rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  margin-bottom: 1rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-subtitle {
  font-size: 1.2rem;
  color: var(--gray-color);
  max-width: 600px;
  margin: 0 auto;
}

/* ===== Curso Cards ===== */
.curso-card {
  background: white;
  border-radius: var(--border-radius-lg);
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-md);
  transition: var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.curso-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--gradient-secondary);
}

.curso-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
}

.curso-icon {
  width: 60px;
  height: 60px;
  background: var(--gradient-primary);
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
  margin-bottom: 1.5rem;
}

.curso-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--dark-color);
}

.curso-description {
  color: var(--gray-color);
  margin-bottom: 1.5rem;
}

.curso-features {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem 0;
}

.curso-features li {
  padding: 0.5rem 0;
  color: var(--gray-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.curso-features li::before {
  content: '✓';
  color: var(--secondary-color);
  font-weight: bold;
}

/* ===== Videoaula Cards ===== */
.videoaula-card {
  background: white;
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: var(--transition-fast);
  margin-bottom: 2rem;
}

.videoaula-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
}

.videoaula-thumbnail {
  position: relative;
  width: 100%;
  height: 200px;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.videoaula-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.videoaula-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--primary-color);
  transition: var(--transition-fast);
}

.videoaula-card:hover .videoaula-play {
  background: white;
  transform: translate(-50%, -50%) scale(1.1);
}

.videoaula-content {
  padding: 1.5rem;
}

.videoaula-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--dark-color);
}

.videoaula-description {
  color: var(--gray-color);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.videoaula-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--gray-color);
}

/* ===== Material Cards ===== */
.material-card {
  background: white;
  border-radius: var(--border-radius-lg);
  padding: 2rem;
  text-align: center;
  box-shadow: var(--shadow-md);
  transition: var(--transition-fast);
  height: 100%;
}

.material-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
}

.material-icon {
  width: 80px;
  height: 80px;
  background: var(--gradient-secondary);
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: white;
  margin: 0 auto 1.5rem;
}

.material-card h4 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--dark-color);
}

.material-card p {
  color: var(--gray-color);
  margin-bottom: 1.5rem;
}

/* ===== Contact Form ===== */
.contact-form {
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--border-radius-lg);
  padding: 2rem;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.form-group {
  position: relative;
  margin-bottom: 1.5rem;
}

.form-control {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--border-radius);
  color: white;
  padding: 0.75rem 1rem;
  transition: var(--transition-fast);
}

.form-control:focus {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--secondary-color);
  color: white;
  box-shadow: none;
  outline: none;
}

.form-control::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.form-label {
  color: white;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.focus-line {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-secondary);
  transition: var(--transition-fast);
}

.form-control:focus + .focus-line {
  width: 100%;
}

/* ===== Footer ===== */
.footer {
  background: var(--dark-color) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.social-links {
  display: flex;
  gap: 1rem;
}

.social-link {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  text-decoration: none;
  transition: var(--transition-fast);
}

.social-link:hover {
  background: var(--gradient-secondary);
  transform: translateY(-2px);
  color: white;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2.5rem;
  }
  
  .hero-description {
    font-size: 1rem;
  }
  
  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }
  
  .btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
  }
  
  .section-title {
    font-size: 2rem;
  }
  
  .floating-element {
    width: 60px;
    height: 60px;
  }
  
  .logo-3d-container {
    width: 80px;
    height: 80px;
  }
  
  .logo-3d {
    font-size: 2rem;
  }
}

@media (max-width: 576px) {
  .hero-title {
    font-size: 2rem;
  }
  
  .section-title {
    font-size: 1.8rem;
  }
  
  .curso-card,
  .videoaula-card,
  .material-card {
    padding: 1.5rem;
  }
  
  .contact-form {
    padding: 1.5rem;
  }
}

/* ===== Accessibility ===== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .floating-element {
    animation: none;
  }
  
  .logo-3d {
    animation: none;
  }
}

/* ===== Utilities ===== */
.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

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

.shadow-custom {
  box-shadow: var(--shadow-lg);
}

.backdrop-blur {
  backdrop-filter: blur(20px);
}

.glass-effect {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}