/* ============================================================================
   AI IMAGE GENERATOR - 3D MORPHISM + CYBERPUNK GLASSMORPHISM (2025)
   ============================================================================ */

:root {
  /* Cyberpunk Neon Colors */
  --clr-cyan: #00f5ff;
  --clr-magenta: #ff00ff;
  --clr-purple: #9d00ff;
  --clr-pink: #ff006e;
  --clr-blue: #0066ff;
  --clr-green: #00ff88;
  
  /* Dark Theme */
  --clr-bg-primary: #0a0a0f;
  --clr-bg-secondary: #13131a;
  --clr-bg-tertiary: #1a1a24;
  
  /* Text Colors */
  --clr-text-primary: #ffffff;
  --clr-text-secondary: #b4b4c8;
  --clr-text-muted: #808095;
  
  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-shadow: rgba(0, 245, 255, 0.1);
  
  /* 3D Effects */
  --shadow-3d: 
    0 4px 12px rgba(0, 0, 0, 0.5),
    0 8px 24px rgba(0, 245, 255, 0.15),
    0 16px 48px rgba(255, 0, 255, 0.1);
  
  /* Neon Glow */
  --glow-cyan: 0 0 20px rgba(0, 245, 255, 0.5),
               0 0 40px rgba(0, 245, 255, 0.3),
               0 0 60px rgba(0, 245, 255, 0.2);
  
  --glow-magenta: 0 0 20px rgba(255, 0, 255, 0.5),
                  0 0 40px rgba(255, 0, 255, 0.3),
                  0 0 60px rgba(255, 0, 255, 0.2);
  
  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4rem;
  
  /* Animation */
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================================
   GLOBAL STYLES
   ============================================================================ */

.page-ai-image {
  background: var(--clr-bg-primary);
  color: var(--clr-text-primary);
  overflow-x: hidden;
  position: relative;
}

.page-ai-image::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 30%, rgba(0, 245, 255, 0.05), transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(255, 0, 255, 0.05), transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.container {
  max-width: 1400px;
  margin-inline: auto;
  padding-inline: clamp(1rem, 5vw, 3rem);
  position: relative;
  z-index: 1;
}

/* ============================================================================
   HERO SECTION - 3D MORPHING BACKGROUND
   ============================================================================ */


/* 3D Morphing Background Shapes */
.ai-hero__bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.morph-shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.3;
  will-change: transform;
}

.morph-shape--1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--clr-cyan), transparent);
  top: -10%;
  right: -10%;
  animation: morph1 20s infinite ease-in-out;
}

.morph-shape--2 {
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, var(--clr-magenta), transparent);
  bottom: -10%;
  left: -5%;
  animation: morph2 25s infinite ease-in-out;
}

.morph-shape--3 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--clr-purple), transparent);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: morph3 30s infinite ease-in-out;
}

@keyframes morph1 {
  0%, 100% { 
    transform: translate(0, 0) scale(1) rotate(0deg);
    border-radius: 50%;
  }
  33% { 
    transform: translate(50px, -80px) scale(1.2) rotate(120deg);
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  }
  66% { 
    transform: translate(-30px, 40px) scale(0.8) rotate(240deg);
    border-radius: 70% 30% 30% 70% / 70% 70% 30% 30%;
  }
}

@keyframes morph2 {
  0%, 100% { 
    transform: translate(0, 0) scale(1) rotate(0deg);
    border-radius: 50%;
  }
  33% { 
    transform: translate(-60px, 70px) scale(1.1) rotate(-120deg);
    border-radius: 40% 60% 60% 40% / 60% 40% 60% 40%;
  }
  66% { 
    transform: translate(40px, -50px) scale(0.9) rotate(-240deg);
    border-radius: 60% 40% 40% 60% / 40% 60% 40% 60%;
  }
}

@keyframes morph3 {
  0%, 100% { 
    transform: translate(-50%, -50%) scale(1);
    border-radius: 50%;
  }
  50% { 
    transform: translate(-50%, -50%) scale(1.3);
    border-radius: 30% 70% 50% 50% / 50% 50% 70% 30%;
  }
}

/* Cyberpunk Grid Overlay */
.grid-overlay {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(0, 245, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 245, 255, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  animation: grid-scroll 20s linear infinite;
}

@keyframes grid-scroll {
  0% { transform: translateY(0); }
  100% { transform: translateY(50px); }
}

/* Hero Content */
.ai-hero__content {
  text-align: center;
  max-width: 900px;
  position: relative;
  z-index: 2;
  animation: fade-in-up 1s ease-out;
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ai-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.5rem;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 50px;
  margin-bottom: 2rem;
  animation: pulse-glow 3s infinite;
}

@keyframes pulse-glow {
  0%, 100% { 
    box-shadow: 0 0 20px rgba(0, 245, 255, 0.2);
    border-color: rgba(0, 245, 255, 0.3);
  }
  50% { 
    box-shadow: var(--glow-cyan);
    border-color: var(--clr-cyan);
  }
}

.badge-icon {
  font-size: 1.2rem;
  animation: spin-slow 10s linear infinite;
}

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.badge-text {
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: linear-gradient(90deg, var(--clr-cyan), var(--clr-magenta));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.ai-hero__title {
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 900;
  line-height: 1.1;
  margin: 0 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.title-line {
  display: block;
  background: linear-gradient(135deg, 
    var(--clr-cyan) 0%, 
    var(--clr-magenta) 50%, 
    var(--clr-purple) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradient-shift 8s ease infinite;
  background-size: 200% 200%;
}

@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.title-line--1 {
  animation-delay: -2s;
}

.title-line--2 {
  animation-delay: -4s;
}

.ai-hero__subtitle {
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  color: var(--clr-text-secondary);
  line-height: 1.6;
  margin-bottom: 2.5rem;
  max-width: 700px;
  margin-inline: auto;
}

.ai-hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 4rem;
}

/* Stats Counter */
.ai-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 2rem;
  margin-top: 4rem;
  padding: 2rem;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  box-shadow: var(--shadow-3d);
}

.ai-stat {
  text-align: center;
  position: relative;
}

.ai-stat::after {
  content: '';
  position: absolute;
  bottom: -1rem;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--clr-cyan), transparent);
}

.ai-stat:last-child::after {
  display: none;
}

.ai-stat__value {
  font-size: 2.5rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--clr-cyan), var(--clr-magenta));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.ai-stat__label {
  font-size: 0.9rem;
  color: var(--clr-text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Floating 3D Preview Cards */
.ai-preview-cards {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.preview-card {
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-3d);
  transform-style: preserve-3d;
  animation: float-3d 15s infinite ease-in-out;
}

.preview-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-card--1 {
  top: 10%;
  right: 5%;
  animation-delay: 0s;
}

.preview-card--2 {
  bottom: 15%;
  right: 10%;
  animation-delay: -5s;
}

.preview-card--3 {
  top: 50%;
  left: 5%;
  animation-delay: -10s;
}

@keyframes float-3d {
  0%, 100% {
    transform: translateY(0) rotateY(0deg) rotateX(0deg);
  }
  33% {
    transform: translateY(-20px) rotateY(10deg) rotateX(-5deg);
  }
  66% {
    transform: translateY(10px) rotateY(-10deg) rotateX(5deg);
  }
}

/* ============================================================================
   BUTTONS - CYBERPUNK STYLE
   ============================================================================ */

.btn {
  overflow: visible;   /* بذار افکت‌ها بیرون دیده شن */
  position: relative;
  z-index: 10;         /* مطمئن شو از grid/background بالاتره */
}


.btn--cyber {
  background: linear-gradient(135deg, var(--clr-cyan), var(--clr-magenta));
  color: #fff;
  box-shadow: 
    0 4px 20px rgba(0, 245, 255, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn--cyber::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--clr-magenta), var(--clr-purple));
  opacity: 0;
  transition: opacity 0.4s;
}

.btn--cyber:hover::before {
  opacity: 1;
}

.btn--cyber:hover {
  transform: translateY(-2px);
  box-shadow: var(--glow-cyan);
}

.btn--glass {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  color: #fff;
  border: 1px solid var(--glass-border);
}

.btn--glass:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--clr-cyan);
  box-shadow: 0 0 20px rgba(0, 245, 255, 0.2);
}

.btn--glow {
  animation: btn-glow 3s infinite;
}

@keyframes btn-glow {
  0%, 100% {
    box-shadow: 0 4px 20px rgba(0, 245, 255, 0.3);
  }
  50% {
    box-shadow: var(--glow-cyan);
  }
}

.btn--large {
  padding: 1.25rem 2.5rem;
  font-size: 1.1rem;
}

.btn--small {
  padding: 0.75rem 1.5rem;
  font-size: 0.9rem;
}

.btn__text {
  position: relative;
  z-index: 1;
}

.btn__icon {
  position: relative;
  z-index: 1;
  transition: transform 0.3s;
}

.btn:hover .btn__icon {
  transform: translateX(4px);
}

/* ============================================================================
   GENERATOR SECTION - GLASSMORPHIC PANELS
   ============================================================================ */

.ai-generator {
  padding-block: var(--space-2xl);
  position: relative;
}

.generator-wrapper {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(500px, 100%), 1fr));
  gap: 2rem;
  align-items: start;
}

.generator-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(30px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  box-shadow: var(--shadow-3d);
  overflow: hidden;
  position: relative;
}

.generator-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--clr-cyan), var(--clr-magenta), var(--clr-purple));
}


.panel-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
}

.title-icon {
  font-size: 1.8rem;
}

.panel-body {
  padding: 2rem;
}

/* Form Styles */
.generator-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--clr-text-primary);
}

.label-badge {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.75rem;
  background: rgba(0, 245, 255, 0.1);
  border: 1px solid rgba(0, 245, 255, 0.2);
  border-radius: 20px;
  color: var(--clr-cyan);
}

.form-control {
  width: 100%;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: var(--clr-text-primary);
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.3s;
}

.form-control:focus {
  outline: none;
  border-color: var(--clr-cyan);
  box-shadow: 0 0 0 3px rgba(0, 245, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
}

.form-control--cyber {
  font-family: 'Monaco', 'Courier New', monospace;
}

textarea.form-control {
  resize: vertical;
  min-height: 120px;
}

.form-hint {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--clr-text-muted);
  padding: 0.75rem;
  background: rgba(0, 245, 255, 0.03);
  border-left: 2px solid var(--clr-cyan);
  border-radius: 6px;
}

.hint-icon {
  font-size: 1.2rem;
}

/* Advanced Options Toggle */
.form-advanced {
  margin-top: 1rem;
}

.btn-toggle-advanced {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: var(--clr-text-primary);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-toggle-advanced:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--clr-cyan);
}

.toggle-icon {
  font-size: 1.5rem;
  transition: transform 0.3s;
}

.btn-toggle-advanced.active .toggle-icon {
  transform: rotate(45deg);
}

.advanced-options {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s var(--ease-smooth);
}

.advanced-options.show {
  max-height: 500px;
  margin-top: 1.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

select.form-control {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%2300f5ff' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 3rem;
}

.form-range {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  outline: none;
  -webkit-appearance: none;
}

.form-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, var(--clr-cyan), var(--clr-magenta));
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(0, 245, 255, 0.5);
}

.form-range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, var(--clr-cyan), var(--clr-magenta));
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 0 10px rgba(0, 245, 255, 0.5);
}

/* Output Container States */
.output-container {
  min-height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.output-placeholder,
.output-loading,
.output-result {
  width: 100%;
}

/* Placeholder */
.output-placeholder {
  text-align: center;
  padding: 3rem;
}

.placeholder-icon {
  margin-bottom: 2rem;
  animation: float 4s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

.placeholder-text {
  font-size: 1.1rem;
  color: var(--clr-text-secondary);
}

/* Loading State */
.output-loading {
  text-align: center;
  padding: 3rem;
}

.loading-spinner {
  width: 100px;
  height: 100px;
  margin: 0 auto 2rem;
  position: relative;
}

.spinner-ring {
  position: absolute;
  inset: 0;
  border: 3px solid transparent;
  border-top-color: var(--clr-cyan);
  border-radius: 50%;
  animation: spin 1.5s linear infinite;
}

.spinner-ring:nth-child(2) {
  border-top-color: var(--clr-magenta);
  animation-delay: -0.5s;
}

.spinner-ring:nth-child(3) {
  border-top-color: var(--clr-purple);
  animation-delay: -1s;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-size: 1.2rem;
  color: var(--clr-text-primary);
  margin-bottom: 1.5rem;
}

.loading-progress {
  max-width: 300px;
  margin: 0 auto;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--clr-cyan), var(--clr-magenta));
  width: 0%;
  animation: progress 3s ease-out forwards;
}

@keyframes progress {
  to { width: 100%; }
}

/* Result State */
.result-image-wrapper {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.result-image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 16px;
}

.image-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
  opacity: 0;
  transition: opacity 0.3s;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 1rem;
  padding: 2rem;
}

.result-image-wrapper:hover .image-overlay {
  opacity: 1;
}

.btn-overlay {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-overlay:hover {
  background: var(--clr-cyan);
  border-color: var(--clr-cyan);
  box-shadow: var(--glow-cyan);
  transform: scale(1.1);
}

.result-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ============================================================================
   FEATURES GRID - 3D CARDS
   ============================================================================ */

.ai-features {
  padding-block: var(--space-2xl);
  position: relative;
}
.section-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 900;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--clr-cyan), var(--clr-magenta));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.section-subtitle {
  font-size: 1.2rem;
  color: var(--clr-text-secondary);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 2rem;
}

.feature-card {
  padding: 2.5rem;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  box-shadow: var(--shadow-3d);
  text-align: center;
  transition: all 0.4s var(--ease-smooth);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent, rgba(0, 245, 255, 0.05), transparent);
  opacity: 0;
  transition: opacity 0.4s;
}

.feature-card:hover {
  transform: translateY(-10px);
  border-color: var(--clr-cyan);
  box-shadow: 
    var(--shadow-3d),
    var(--glow-cyan);
}

.feature-card:hover::before {
  opacity: 1;
}

.feature-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  display: grid;
  place-items: center;
  font-size: 2.5rem;
  background: linear-gradient(135deg, var(--clr-cyan), var(--clr-magenta));
  border-radius: 50%;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 245, 255, 0.3);
}

.feature-icon::before {
  content: '';
  position: absolute;
  inset: -3px;
  background: linear-gradient(135deg, var(--clr-cyan), var(--clr-magenta));
  border-radius: 50%;
  z-index: -1;
  opacity: 0.3;
  filter: blur(10px);
}

.feature-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--clr-text-primary);
}

.feature-text {
  font-size: 1rem;
  color: var(--clr-text-secondary);
  line-height: 1.6;
}

/* ============================================================================
   EXAMPLES GALLERY - MASONRY GRID
   ============================================================================ */

.ai-examples {
  padding-block: var(--space-2xl);
  position: relative;
}

.examples-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.example-item {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 1;
  cursor: pointer;
  transition: transform 0.4s var(--ease-smooth);
}

.example-item:hover {
  transform: scale(1.05);
  z-index: 10;
}

.example-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.example-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent 60%);
  display: flex;
  align-items: flex-end;
  padding: 1.5rem;
  opacity: 0;
  transition: opacity 0.3s;
}

.example-item:hover .example-overlay {
  opacity: 1;
}

.example-prompt {
  color: #fff;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.5;
}

.examples-cta {
  text-align: center;
  margin-top: 3rem;
}

/* ============================================================================
   CTA SECTION - GLASSMORPHIC CARD
   ============================================================================ */

.ai-cta {
  padding-block: var(--space-2xl);
  position: relative;
}

.cta-card {
  position: relative;
  padding: clamp(3rem, 6vw, 5rem);
  background: var(--glass-bg);
  backdrop-filter: blur(30px);
  border: 1px solid var(--glass-border);
  border-radius: 32px;
  box-shadow: var(--shadow-3d);
  overflow: hidden;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(350px, 100%), 1fr));
  gap: 3rem;
  align-items: center;
}

.cta-content {
  text-align: center;
}

.cta-title {
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 900;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--clr-cyan), var(--clr-magenta));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.cta-text {
  font-size: 1.2rem;
  color: var(--clr-text-secondary);
  margin-bottom: 2rem;
}

.cta-visual {
  position: relative;
  height: 300px;
}

.cta-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  animation: orb-float 10s infinite ease-in-out;
}

.cta-orb--1 {
  width: 200px;
  height: 200px;
  background: var(--clr-cyan);
  top: 0;
  left: 0;
  opacity: 0.3;
}

.cta-orb--2 {
  width: 180px;
  height: 180px;
  background: var(--clr-magenta);
  bottom: 0;
  right: 0;
  opacity: 0.3;
  animation-delay: -3.3s;
}

.cta-orb--3 {
  width: 150px;
  height: 150px;
  background: var(--clr-purple);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.3;
  animation-delay: -6.6s;
}

@keyframes orb-float {
  0%, 100% {
    transform: translate(0, 0);
  }
  33% {
    transform: translate(30px, -30px);
  }
  66% {
    transform: translate(-20px, 20px);
  }
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

@media (max-width: 1024px) {
  .ai-preview-cards {
    display: none;
  }
  
  .generator-wrapper {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .ai-hero {
    min-height: auto;
    padding-block: 4rem;
  }
  
  .ai-hero__cta {
    flex-direction: column;
  }
  
  .ai-hero__cta .btn {
    width: 100%;
    justify-content: center;
  }
  
  .ai-stats {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .ai-stat::after {
    display: none;
  }
  
  .features-grid,
  .examples-grid {
    grid-template-columns: 1fr;
  }
  
  .cta-card {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .cta-visual {
    height: 200px;
  }
}

@media (max-width: 480px) {
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .result-actions {
    flex-direction: column;
  }
  
  .result-actions .btn {
    width: 100%;
  }
}

/* ============================================================================
   ACCESSIBILITY
   ============================================================================ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-contrast: high) {
  .generator-panel,
  .feature-card,
  .cta-card {
    border-width: 2px;
  }
}

.btn:focus-visible,
.form-control:focus-visible,
a:focus-visible {
  outline: 3px solid var(--clr-cyan);
  outline-offset: 4px;
}

/* ============================================================================
   PRINT STYLES
   ============================================================================ */

@media print {
  .ai-hero__bg,
  .morph-shape,
  .grid-overlay,
  .ai-preview-cards {
    display: none;
  }
  
  * {
    animation: none !important;
  }
}
/* ===== Header Offset for Hero (du first) ===== */
/* ===== فاصله هیرو از هدر ===== */
:root {
  --df-header-height: 88px;     /* ارتفاع هدر دسکتاپ */
}
@media (max-width: 992px) {
  :root { --df-header-height: 64px; } /* ارتفاع هدر موبایل */
}

.page-ai-image .ai-hero {
  /* فاصله از هدر */
  margin-top: var(--df-header-height);
  /* ارتفاع واقعی: فول‌اسکرین منهای هدر */
  min-height: calc(100vh - var(--df-header-height));
  padding-top: 2rem; /* کمی نفس اضافه، دلخواه */
}
/* ===== AI page: fix header gap & black bar ===== */
:root { --df-header-height: 88px; }
@media (max-width: 992px){ :root { --df-header-height: 64px; } }

/* 1) Spacer را در این صفحه خاموش کن تا فاصله دوبل نشود */
body.page-ai-image #headerSpacer{
  height: 0 !important;
  display: none !important;
  background: transparent !important;
}

/* 2) هیرو خودش فاصله از هدر را می‌گیرد */
.page-ai-image .ai-hero{
  margin-top: 0 !important;
  padding-top: calc(var(--df-header-height) + 46px) !important;
  min-height: calc(100svh - var(--df-header-height)) !important;
}

/* 3) قانون سراسری بک‌گراندِ مشکی را برای این صفحه خنثی کن */
body.page-ai-image main,
body.page-ai-image section,
body.page-ai-image .section,
body.page-ai-image [class^="section"]{
  background: transparent !important;
}

/* اختیاری: هر خط/سایهٔ زیر هدر در این صفحه حذف شود */
body.page-ai-image .header,
body.page-ai-image #siteHeader,
body.page-ai-image .navbar{
  border-bottom: 0 !important;
  box-shadow: none !important;
}
/* 1) سکشن ژنراتور را ایزوله کن تا دکورهای بیرون واردش نشن */
.page-ai-image .ai-generator{
  position: relative;
  isolation: isolate;   /* استکینگ‌کانتکست مستقل */
  z-index: 0;
}

/* 2) پنل‌ها هرچی داخلشان است را در شعاع خودش نگه دارند */
.page-ai-image .generator-panel{
  overflow: clip;       /* یا hidden اگر clip ساپورت نبود */
  border-radius: 24px;  /* مطمئن شو شعاع اعمال می‌شود */
  position: relative;
  z-index: 0;
}

/* 3) محتوای پنل بالاتر از دکورها بایستد */
.page-ai-image .panel-header,
.page-ai-image .panel-body{
  position: relative;
  z-index: 2;
}

/* 4) هر دکور/اسپارک/اورب داخل سکشن را پشت محتوا ببر */
.page-ai-image .ai-generator [class*="orb"],
.page-ai-image .ai-generator [class*="dot"],
.page-ai-image .ai-generator [class*="spark"],
.page-ai-image .ai-generator .grid-overlay{
  position: absolute;
  z-index: 1;  /* زیر محتوا، اما داخل پنل بماند */
}

/* 5) اگر هنوز چیزی از لبه بیرون می‌زند، همین را هم اضافه کن */
.page-ai-image .generator-panel::before,
.page-ai-image .generator-panel::after{
  pointer-events: none;
  z-index: 1;
}
/* حالت باز Advanced Options */
.page-ai-image .advanced-options.show {
  padding: 1.5rem;
  background: rgba(255,255,255,0.02); /* کمی تمایز پس‌زمینه */
  border: 1px solid var(--glass-border);
  border-radius: 12px;
}

/* داخلش فاصله کافی داشته باشن */
.page-ai-image .advanced-options.show .form-group {
  margin-bottom: 1rem;
}

/* لیبل‌ها خواناتر */
.page-ai-image .advanced-options.show .form-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--clr-text-secondary);
}

/* دراپ‌داون‌ها و سلکت درست دیده بشن */
.page-ai-image .advanced-options.show select.form-control {
  background-color: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
}
/* حالت بسته: ورودی تیره + فلش سفارشی شما */
.page-ai-image select.form-control{
  background-color: rgba(255,255,255,.05);
  color: var(--clr-text-primary);
  border: 1px solid var(--glass-border);
  appearance: none;
  color-scheme: dark;                  /* کلید اصلی برای Edge/Chrome/Firefox */
}

/* منوی باز (Chromium/Firefox) */
.page-ai-image select.form-control option,
.page-ai-image select.form-control optgroup{
  background-color: #0a0a0f;           /* هم‌رنگ تم تیره */
  color: #fff;
}

/* فوکوس تمیز و بدون هالهٔ سفید */
.page-ai-image select.form-control:focus{
  outline: none;
  border-color: var(--clr-cyan);
  box-shadow: 0 0 0 3px rgba(0,245,255,.12);
}

/* اسکرول تیره داخل منو (Chromium) - اختیاری */
.page-ai-image select.form-control::-webkit-scrollbar{
  width: 10px;
}
.page-ai-image select.form-control::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,.15);
  border-radius: 8px;
}
/* native select ها مخفی */
.df-native {
  display: none !important;
}

/* custom wrapper */
.df-custom-select {
  position: relative;
  width: 100%;
  font-size: .95rem;
}

.df-custom-select__btn {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--glass-border);
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}
.df-custom-select__btn::after {
  content: "▾";
  opacity: .6;
  margin-left: .5rem;
}

.df-custom-select__list {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: #0a0a0f;
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  box-shadow: 0 12px 24px rgba(0,0,0,.5);
  max-height: 200px;
  overflow-y: auto;
  z-index: 999;
}
.df-custom-select.open .df-custom-select__list { display: block; }

.df-custom-select__item {
  padding: .6rem .8rem;
  color: #fff;
  cursor: pointer;
}
.df-custom-select__item:hover {
  background: rgba(0,245,255,.15);
}
/* سلکت بومی را کلاً از جریان و تعامل خارج کن */
.df-native{
  display: none !important;         /* قطعی‌ترین روش */
  pointer-events: none !important;  /* اگر جایی هنوز کلیک می‌گرفت */
}
.section-header--overlay .section-title,
.section-header--overlay .section-subtitle {
  color: #fff !important;
  text-shadow: 0 2px 12px rgba(0,0,0,.6);
}
/* Override gradient-title to solid white on overlay */
.section-header--overlay .section-title {
  background: none !important;
  -webkit-background-clip: initial !important;
  background-clip: initial !important;
  -webkit-text-fill-color: initial !important;
  color: var(--clr-text-primary) !important; /* #fff */
  text-shadow: 0 2px 18px rgba(0,0,0,.5);
}
.section-header--overlay .section-subtitle {
  color: #e9ecff !important;
  text-shadow: 0 2px 14px rgba(0,0,0,.45);
}

/* Utility: هرجا لازم شد فقط متن رو بدون باکس تاریک روشن کن */
.u-text-on-media {
  color: #fff !important;
  text-shadow: 0 2px 18px rgba(0,0,0,.55);
}

/* ==== Examples (video) fit like images ==== */
.ai-examples .example-item video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

/* اختیاری: Overlay کارت‌های نمونه کمی پررنگ‌تر شود روی ویدیو */
.ai-examples .example-overlay {
  background: linear-gradient(to top, rgba(0,0,0,.85), transparent 60%);
}
.ai-examples .section-header .section-title,
.ai-examples .section-header .section-subtitle {
  background: none !important;
  -webkit-background-clip: initial !important;
  background-clip: initial !important;
  -webkit-text-fill-color: #fff !important;
  color: #fff !important;
  text-shadow: 0 2px 12px rgba(0,0,0,.65);
}

