/* ==========================================================================
   StudyMate AI - Home Dashboard Styles (css/home.css)
   ========================================================================== */

/* Hero Section */
.hero-section {
  text-align: center;
  padding: var(--space-8) 0 var(--space-10);
  background: radial-gradient(circle at 50% 20%, rgba(79, 70, 229, 0.09) 0%, rgba(248, 250, 252, 0) 70%);
  border-radius: var(--radius-xl);
  margin-bottom: var(--space-6);
  border: 1px solid rgba(79, 70, 229, 0.12);
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 14px;
  background-color: var(--primary-light);
  border: 1px solid var(--primary-border);
  color: var(--primary);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  margin-bottom: var(--space-4);
  letter-spacing: 0.02em;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.15;
  margin-bottom: var(--space-3);
  letter-spacing: -0.03em;
}

.hero-title-highlight {
  color: var(--primary);
  position: relative;
  display: inline-block;
}

.hero-description {
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  color: var(--text-secondary);
  max-width: 580px;
  margin: 0 auto var(--space-6);
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}

.hero-cta {
  font-size: var(--text-base);
  padding: 16px 36px;
  border-radius: var(--radius-lg);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.35);
  font-weight: 700;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.hero-cta-hint {
  font-size: 0.75rem;
  opacity: 0.9;
  font-weight: 500;
}

/* 3-Step Process Flow Visual Guide */
.how-it-works-section {
  margin-bottom: var(--space-8);
}

.flow-steps-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: var(--space-2) var(--space-4);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

@media (min-width: 768px) {
  .flow-steps-card {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-6);
  }
}

.flow-step-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 12px 6px;
  position: relative;
  flex: 1;
}

.flow-step-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background-color: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.flow-step-body {
  flex: 1;
  min-width: 0;
}

.flow-step-body h4 {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 2px;
  line-height: 1.3;
}

.flow-step-body p {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  line-height: 1.35;
  margin: 0;
}

.flow-step-badge {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--primary);
  background-color: var(--primary-light);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.flow-step-divider {
  height: 1px;
  background-color: var(--border-color);
  width: 100%;
}

@media (min-width: 768px) {
  .flow-step-divider {
    width: 1px;
    height: 48px;
    margin: 0 var(--space-4);
  }
}

/* Consolidated Stats Banner Card */
.stats-section {
  margin-bottom: var(--space-8);
}

/* Quick Action Hub on Home Page */
.quick-hub-section {
  margin-bottom: var(--space-8);
}

.quick-hub-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}

@media (min-width: 640px) {
  .quick-hub-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
  }
}

.quick-hub-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 14px 16px;
  background-color: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-xl);
  text-decoration: none;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-xs);
}

.quick-hub-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.quick-hub-card.hub-create {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.04) 0%, rgba(99, 102, 241, 0.08) 100%);
  border-color: rgba(79, 70, 229, 0.2);
}

.quick-hub-card.hub-library {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.04) 0%, rgba(6, 182, 212, 0.08) 100%);
  border-color: rgba(14, 165, 233, 0.2);
}

.quick-hub-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-lg);
  background-color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  box-shadow: var(--shadow-xs);
  flex-shrink: 0;
}

.quick-hub-info {
  flex: 1;
  min-width: 0;
}

.quick-hub-info h3 {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 2px;
}

.quick-hub-info p {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.3;
}

.quick-hub-arrow {
  font-size: 1.1rem;
  color: var(--primary);
  font-weight: 700;
  transition: transform var(--transition-fast);
}

.quick-hub-card:hover .quick-hub-arrow {
  transform: translateX(4px);
}

.stats-banner-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: var(--space-4) var(--space-5);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-around;
}

.stat-banner-col {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex: 1;
  justify-content: center;
}

.stat-banner-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.stat-icon-indigo {
  background-color: var(--primary-light);
  color: var(--primary);
}

.stat-icon-sky {
  background-color: var(--accent-light);
  color: var(--accent);
}

.stat-icon-emerald {
  background-color: #ecfdf5;
  color: #059669;
}

.stat-banner-info {
  display: flex;
  flex-direction: column;
}

.stat-banner-num {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
}

.stat-banner-txt {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  font-weight: 500;
  margin-top: 2px;
  white-space: nowrap;
}

.stat-banner-sep {
  width: 1px;
  height: 36px;
  background-color: var(--border-color);
  flex-shrink: 0;
}

/* Recent Chapters Section */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.section-title {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text-main);
}

.section-link {
  font-size: var(--text-sm);
  color: var(--primary);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.section-link:hover {
  text-decoration: underline;
}

.chapters-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

@media (min-width: 768px) {
  .chapters-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.chapter-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-4);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

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

.chapter-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
}

.chapter-meta {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 500;
}

.chapter-card-body h3 {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-main);
  margin-top: var(--space-2);
  margin-bottom: var(--space-1);
}

.chapter-mcq-count {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.chapter-card-footer {
  margin-top: auto;
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-subtle);
}

.btn-practice {
  width: 100%;
  font-size: var(--text-xs);
  padding: 8px 14px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: var(--space-12) var(--space-4);
  background-color: var(--bg-card);
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
}

.empty-state-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto var(--space-3);
  background-color: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.empty-state-title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: var(--space-1);
}

.empty-state-desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  max-width: 360px;
  margin: 0 auto var(--space-4);
}

/* ==========================================================================
   Mobile-Optimized Compact Layouts (< 640px)
   ========================================================================== */

@media (max-width: 640px) {
  .hero-section {
    padding: 16px 14px 20px;
    margin-bottom: 12px;
    border-radius: var(--radius-lg);
  }

  .hero-pill {
    padding: 4px 12px;
    font-size: 0.7rem;
    margin-bottom: 8px;
  }

  .hero-title {
    font-size: 1.45rem;
    line-height: 1.25;
    margin-bottom: 6px;
  }

  .hero-description {
    font-size: 0.85rem;
    line-height: 1.45;
    margin-bottom: 14px;
    padding: 0 4px;
  }

  .hero-cta {
    padding: 12px 24px;
    font-size: 0.95rem;
    width: 100%;
    max-width: 320px;
    border-radius: var(--radius-full);
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
  }

  /* 3-Step Flow Card on Mobile */
  .how-it-works-section {
    margin-bottom: 14px;
  }

  .how-it-works-section .section-header {
    margin-bottom: 6px !important;
  }

  .how-it-works-section .section-title {
    font-size: 0.95rem;
  }

  .how-it-works-section .chapter-meta {
    font-size: 0.7rem;
  }

  .flow-steps-card {
    padding: 2px 10px;
    border-radius: var(--radius-lg);
  }

  .flow-step-item {
    padding: 8px 0;
    gap: 10px;
  }

  .flow-step-icon {
    width: 32px;
    height: 32px;
    font-size: 1rem;
    border-radius: var(--radius-sm);
  }

  .flow-step-body h4 {
    font-size: 0.82rem;
    margin-bottom: 1px;
  }

  .flow-step-body p {
    font-size: 0.7rem;
    line-height: 1.3;
  }

  .flow-step-badge {
    font-size: 0.6rem;
    padding: 2px 6px;
  }

  /* Quick Statistics Banner on Mobile */
  .stats-section {
    margin-bottom: 14px;
  }

  .stats-section .section-header {
    margin-bottom: 6px;
  }

  .stats-section .section-title {
    font-size: 0.95rem;
  }

  .stats-banner-card {
    padding: 10px 6px;
    border-radius: var(--radius-lg);
  }

  .stat-banner-col {
    gap: 6px;
  }

  .stat-banner-icon-wrap {
    width: 28px;
    height: 28px;
    font-size: 0.9rem;
    border-radius: var(--radius-sm);
  }

  .stat-banner-num {
    font-size: 1.15rem;
  }

  .stat-banner-txt {
    font-size: 0.62rem;
  }

  .stat-banner-sep {
    height: 26px;
  }

  /* Recent Chapters Section on Mobile */
  .recent-chapters-section {
    margin-bottom: 16px;
  }

  .recent-chapters-section .section-header {
    margin-bottom: 8px;
  }

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

  .chapters-grid {
    gap: 8px;
  }

  .chapter-card {
    padding: 10px 12px;
    gap: 6px;
    border-radius: var(--radius-md);
  }

  .chapter-card-body h3 {
    font-size: 0.88rem;
    margin-top: 2px;
    margin-bottom: 2px;
  }

  .chapter-card-footer {
    padding-top: 6px;
  }

  .btn-practice {
    padding: 6px 12px;
    font-size: 0.78rem;
    border-radius: var(--radius-full);
  }
}

