/* 
 * diBoaS Learning Platform - Critical CSS
 * Above-the-fold styles for learning interface
 * Target: First meaningful paint optimization
 */

/* ===========================
   LEARNING PLATFORM LAYOUT
   =========================== */

.learn-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--neutral-50);
}

/* ===========================
   HEADER STYLES (CRITICAL)
   =========================== */

.learn-header {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--neutral-200);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-6);
  max-width: 100%;
}

.header-left {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  flex: 1;
}

.learn-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 600;
}

.learn-logo img {
  width: auto;
  height: 32px;
}

.logo-text {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--aqua-primary);
}

/* ===========================
   NAVIGATION (CRITICAL)
   =========================== */

.learn-nav {
  display: flex;
  align-items: center;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  border-radius: var(--radius-base);
  transition: all 0.2s ease;
}

.nav-link:hover {
  color: var(--aqua-primary);
  background: var(--aqua-background);
}

.nav-link.active {
  color: var(--aqua-primary);
  background: var(--aqua-background);
  font-weight: 600;
}

/* ===========================
   HERO SECTION (CRITICAL)
   =========================== */

.learn-hero {
  background: linear-gradient(135deg, var(--aqua-background) 0%, var(--verde-background) 100%);
  padding: var(--space-16) 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.learn-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' width='32' height='32' fill='none' stroke='%2378CDDC'%3e%3cpath d='m0 2 30 0 0 30-30 0z'/%3e%3c/svg%3e") repeat;
  opacity: 0.1;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.hero-title {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-primary);
  margin-bottom: var(--space-4);
}

.hero-subtitle {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-8);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-6);
  margin-top: var(--space-8);
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-family: var(--font-mono);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--aqua-primary);
  display: block;
  margin-bottom: var(--space-1);
}

.stat-label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  font-weight: 500;
}

/* ===========================
   COURSE CARD (CRITICAL)
   =========================== */

.courses-preview {
  padding: var(--space-12) 0;
}

.preview-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-6);
}

.course-card {
  background: white;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
}

.course-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: var(--aqua-primary);
}

.course-thumbnail {
  position: relative;
  width: 100%;
  height: 160px;
  overflow: hidden;
}

.course-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

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

.course-badge {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  background: var(--aqua-primary);
  color: white;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
}

.course-content {
  padding: var(--space-5);
}

.course-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
  line-height: 1.3;
}

.course-description {
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: var(--space-4);
  font-size: var(--text-sm);
}

.course-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-3);
  border-top: 1px solid var(--neutral-100);
}

.course-duration {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}

.course-difficulty {
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-base);
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
}

.course-difficulty.beginner {
  background: var(--success-light);
  color: var(--success-green);
}

.course-difficulty.intermediate {
  background: var(--warning-light);
  color: var(--warning-orange);
}

.course-difficulty.advanced {
  background: var(--error-light);
  color: var(--error-red);
}

/* ===========================
   SEARCH AND FILTERS (CRITICAL)
   =========================== */

.search-section {
  background: white;
  border-bottom: 1px solid var(--neutral-200);
  padding: var(--space-6) 0;
}

.search-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.search-bar {
  position: relative;
  margin-bottom: var(--space-6);
}

.search-input {
  width: 100%;
  padding: var(--space-4) var(--space-12) var(--space-4) var(--space-4);
  border: 2px solid var(--neutral-200);
  border-radius: var(--radius-lg);
  font-size: var(--text-base);
  transition: all 0.2s ease;
  background: white;
}

.search-input:focus {
  outline: none;
  border-color: var(--aqua-primary);
  box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.1);
}

.search-icon {
  position: absolute;
  right: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
}

.filters {
  display: flex;
  gap: var(--space-4);
  align-items: center;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.filter-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
}

.filter-select {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-base);
  font-size: var(--text-sm);
  background: white;
  cursor: pointer;
}

.filter-select:focus {
  outline: none;
  border-color: var(--aqua-primary);
}

/* ===========================
   LOADING STATES (CRITICAL)
   =========================== */

.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--neutral-200);
  border-radius: 50%;
  border-top-color: var(--aqua-primary);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.course-skeleton {
  background: var(--neutral-100);
  border-radius: var(--radius-xl);
  overflow: hidden;
  height: 350px;
  position: relative;
}

.skeleton-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 25%, var(--neutral-50) 37%, transparent 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}

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