/* ============================================================
   CVFlow — Homepage Styles
   ============================================================ */

/* =====================
   HERO
   ===================== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: var(--gradient-hero);
  position: relative;
  overflow: hidden;
  padding-top: var(--navbar-height);
}

/* Animated background shapes */
.hero-bg-shapes {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.3;
}

.shape-1 {
  width: 600px;
  height: 600px;
  background: var(--brand-primary);
  top: -200px;
  right: -100px;
  animation: floatShape1 8s ease-in-out infinite;
}

.shape-2 {
  width: 400px;
  height: 400px;
  background: var(--brand-accent);
  bottom: -100px;
  left: -100px;
  animation: floatShape2 10s ease-in-out infinite;
}

.shape-3 {
  width: 300px;
  height: 300px;
  background: var(--brand-purple);
  top: 40%;
  left: 50%;
  animation: floatShape3 7s ease-in-out infinite;
}

@keyframes floatShape1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-30px, 30px) scale(1.05); }
}

@keyframes floatShape2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(20px, -20px) scale(1.08); }
}

@keyframes floatShape3 {
  0%, 100% { transform: translate(-50%, 0) scale(1); }
  50% { transform: translate(-50%, -20px) scale(0.95); }
}

/* Hero grid overlay */
.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
}

.hero-container {
  position: relative;
  z-index: 1;
  max-width: 700px;
  padding-top: var(--space-16);
  padding-bottom: var(--space-20);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-full);
  color: rgba(255,255,255,0.9);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  letter-spacing: 0.05em;
  margin-bottom: var(--space-6);
  backdrop-filter: blur(10px);
}

.hero-badge i { color: #fbbf24; }

.hero-title {
  font-size: clamp(var(--text-4xl), 7vw, var(--text-7xl));
  font-weight: var(--font-black);
  color: white;
  line-height: 1.05;
  margin-bottom: var(--space-6);
  letter-spacing: -0.04em;
}

.hero-title-gradient {
  display: block;
  background: linear-gradient(135deg, #818cf8, #f43f5e, #fbbf24);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% 100%;
  animation: gradientShift 5s ease infinite;
}

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

.hero-subtitle {
  font-size: clamp(var(--text-base), 2vw, var(--text-xl));
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.7;
  margin-bottom: var(--space-8);
  max-width: 550px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-12);
}

.hero-stats {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

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

.stat-number {
  font-size: var(--text-3xl);
  font-weight: var(--font-black);
  color: white;
  line-height: 1;
  letter-spacing: -0.04em;
}

.stat > span:nth-child(2) {
  font-size: var(--text-2xl);
  font-weight: var(--font-black);
  color: var(--brand-primary-light);
  line-height: 1;
}

.stat-label {
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: var(--space-1);
}

.stat-divider {
  width: 1px;
  height: 40px;
  background: rgba(255,255,255,0.15);
}

/* Hero Preview Cards */
.hero-preview-cards {
  position: relative;
  display: flex;
  gap: var(--space-4);
  z-index: 1;
  margin-right: -40px;
}

.preview-card {
  border-radius: var(--radius-xl);
  background: rgba(255,255,255,0.95);
  box-shadow: var(--shadow-xl), 0 0 0 1px rgba(255,255,255,0.1);
  overflow: hidden;
  transition: transform var(--transition-slow);
}

.preview-card--1 {
  width: 180px;
  transform: rotate(-3deg) translateY(20px);
  animation: cardFloat1 4s ease-in-out infinite;
}
.preview-card--2 {
  width: 180px;
  transform: rotate(1deg);
  animation: cardFloat2 5s ease-in-out infinite;
  position: relative;
  top: -10px;
}
.preview-card--3 {
  width: 160px;
  transform: rotate(-1.5deg) translateY(15px);
  animation: cardFloat3 4.5s ease-in-out infinite;
}

@keyframes cardFloat1 {
  0%, 100% { transform: rotate(-3deg) translateY(20px); }
  50% { transform: rotate(-2deg) translateY(10px); }
}
@keyframes cardFloat2 {
  0%, 100% { transform: rotate(1deg) translateY(0); }
  50% { transform: rotate(2deg) translateY(-10px); }
}
@keyframes cardFloat3 {
  0%, 100% { transform: rotate(-1.5deg) translateY(15px); }
  50% { transform: rotate(-0.5deg) translateY(5px); }
}

.preview-card-inner {
  padding: var(--space-3);
  height: 220px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Simulated CV lines for decorative cards */
.pc-header {
  height: 40px;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  margin: -12px -12px 6px;
}

.pc-sidebar {
  width: 45px;
  margin: -12px 0 -12px -12px;
  border-radius: 0;
  position: absolute;
}

.pc-content {
  margin-left: 50px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-top: var(--space-2);
}

.pc-line {
  height: 5px;
  background: #e2e8f0;
  border-radius: 3px;
  width: 90%;
}
.pc-line--wide { width: 100%; height: 7px; background: #cbd5e1; }
.pc-line--med { width: 65%; }

.pc-section-title {
  height: 4px;
  width: 45%;
  background: #6366f1;
  border-radius: 2px;
  margin: 4px 0 2px;
}

.pc-divider {
  height: 1px;
  background: #e2e8f0;
  margin: 4px 0;
}

/* =====================
   FEATURES
   ===================== */
.features { background: var(--bg-base); }

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

.feature-card {
  padding: var(--space-8);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-2xl);
  transition: all var(--transition-base);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--brand-primary);
  background: linear-gradient(135deg, var(--bg-surface) 0%, rgba(99,102,241,0.03) 100%);
}

.feature-card h3 {
  font-size: var(--text-lg);
  margin: var(--space-4) 0 var(--space-2);
  color: var(--text-primary);
}

.feature-card p {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.6;
}

.feature-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xl);
}

.feature-icon--purple { background: rgba(99, 102, 241, 0.12); color: #6366f1; }
.feature-icon--blue { background: rgba(14, 165, 233, 0.12); color: #0ea5e9; }
.feature-icon--green { background: rgba(16, 185, 129, 0.12); color: #10b981; }
.feature-icon--pink { background: rgba(244, 63, 94, 0.12); color: #f43f5e; }
.feature-icon--orange { background: rgba(245, 158, 11, 0.12); color: #f59e0b; }
.feature-icon--teal { background: rgba(20, 184, 166, 0.12); color: #14b8a6; }

/* =====================
   HOW IT WORKS
   ===================== */
.how-it-works {
  background: var(--bg-elevated);
}

.steps-container {
  display: flex;
  align-items: flex-start;
  gap: 0;
  margin-top: var(--space-12);
  justify-content: center;
}

.step {
  flex: 1;
  max-width: 280px;
  text-align: center;
  padding: var(--space-8);
}

.step-number {
  font-size: var(--text-5xl);
  font-weight: var(--font-black);
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: var(--space-4);
  letter-spacing: -0.04em;
}

.step h3 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-3);
}

.step p {
  font-size: var(--text-sm);
  line-height: 1.7;
}

.step-connector {
  flex: 0 0 80px;
  height: 2px;
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-purple));
  margin-top: 56px;
  position: relative;
}

.step-connector::after {
  content: '';
  position: absolute;
  right: -6px;
  top: -5px;
  border: 6px solid transparent;
  border-left-color: var(--brand-purple);
}

/* =====================
   POPULAR TEMPLATES SECTION
   ===================== */
.popular-templates { background: var(--bg-base); }

.templates-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  margin-bottom: var(--space-10);
}

.templates-loading {
  display: contents;
}

.section-cta {
  text-align: center;
}

/* =====================
   CATEGORIES SECTION
   ===================== */
.categories { background: var(--bg-elevated); }

.categories-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--space-4);
}

/* =====================
   CTA BANNER
   ===================== */
.cta-banner { background: var(--bg-base); }

.cta-card {
  background: var(--gradient-cta);
  border-radius: var(--radius-2xl);
  padding: var(--space-16);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-glow {
  position: absolute;
  inset: -50%;
  background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
  animation: ctaGlow 3s ease-in-out infinite alternate;
}

@keyframes ctaGlow {
  from { transform: scale(0.8); opacity: 0.5; }
  to { transform: scale(1.2); opacity: 1; }
}

.cta-content {
  position: relative;
  z-index: 1;
}

.cta-content h2 {
  font-size: clamp(var(--text-2xl), 4vw, var(--text-4xl));
  color: white;
  margin-bottom: var(--space-4);
  font-weight: var(--font-black);
  letter-spacing: -0.03em;
}

.cta-content p {
  color: rgba(255,255,255,0.85);
  font-size: var(--text-lg);
  margin-bottom: var(--space-8);
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.cta-actions {
  display: flex;
  justify-content: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

/* =====================
   FAQ SECTION
   ===================== */
.faq-section { background: var(--bg-elevated); }

.faq-container {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
  overflow: hidden;
  transition: all var(--transition-fast);
}

.faq-item:hover {
  border-color: var(--brand-primary-light);
}

.faq-item details {
  width: 100%;
}

.faq-item summary {
  padding: var(--space-5) var(--space-6);
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  cursor: pointer;
  list-style: none;
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: '\f078';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  color: var(--brand-primary);
  transition: transform var(--transition-fast);
}

.faq-item details[open] summary::after {
  transform: rotate(180deg);
}

.faq-content {
  padding: 0 var(--space-6) var(--space-5);
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: var(--text-base);
}

/* =====================
   RESPONSIVE
   ===================== */
@media (max-width: 1100px) {
  .hero-preview-cards { display: none; }
  .hero-container { max-width: 100%; text-align: center; }
  .hero-subtitle { margin-left: auto; margin-right: auto; }
  .hero-actions { justify-content: center; }
  .hero-stats { justify-content: center; }
  .categories-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .templates-grid { grid-template-columns: repeat(2, 1fr); }
  .steps-container {
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
  }
  .step-connector {
    width: 2px;
    height: 40px;
    flex: 0;
  }
  .step-connector::after {
    right: -5px;
    top: auto;
    bottom: -6px;
    border-left-color: transparent;
    border-top-color: var(--brand-purple);
  }
}

@media (max-width: 600px) {
  .features-grid { grid-template-columns: 1fr; }
  .templates-grid { grid-template-columns: 1fr; }
  .categories-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-actions { flex-direction: column; width: 100%; }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .hero-stats { gap: var(--space-4); }
  .cta-card { padding: var(--space-10) var(--space-6); }
}

/* RTL Support */
[dir="rtl"] .hero-preview-cards {
  margin-right: 0;
  margin-left: -40px;
}

[dir="rtl"] .step-connector::after {
  right: auto;
  left: -6px;
  border-left-color: transparent;
  border-right-color: var(--brand-purple);
}

@media (max-width: 900px) {
  [dir="rtl"] .step-connector::after {
    left: auto;
    right: -5px;
    border-right-color: transparent;
    border-top-color: var(--brand-purple);
  }
}
