:root {
  /* Premium Apple-Style Light Core Tokens */
  --bg: #f5f5f7;
  /* Apple light gray background */
  --card: rgba(255, 255, 255, 0.85);
  /* Frosted white */
  --border: rgba(0, 0, 0, 0.08);
  /* Subtle border */
  --primary: #8f73ff;
  /* Apple Blue */
  --primary-glow: transparent;
  /* Soft blue shadow */
  --selection: rgba(143, 115, 255, 0.2);
  --text-main: #1d1d1f;
  /* Almost black */
  --text-dim: #86868b;
  /* Apple gray text */
  --danger: #ff3b30;
  --success: #34c759;
  --radius-lg: 1.5rem;
  --radius-md: 1rem;
  --radius-sm: 0.5rem;
  --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --font-main: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

::selection {
  background-color: var(--selection);
  color: var(--text-main);
}

html {
  scroll-behavior: smooth;
  background-color: var(--bg);
}

.hidden {
  display: none !important;
}

body {
  font-family: var(--font-main);
  background-color: transparent;
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Navigation */
.desktop-nav {
  display: none;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 50;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  background-color: rgba(255, 255, 255, 0.72);
  border-bottom: 1px solid var(--border);
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  cursor: pointer;
}

.logo-text {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.logo-img {
  height: 42px;
  width: auto;
  border-radius: 12px;
  box-shadow: 0 0 15px rgba(143, 115, 255, 0.3);
  border: 1px solid rgba(143, 115, 255, 0.2);
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  background-color: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: var(--text-main);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.lang-btn:hover {
  background-color: rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.12);
}

@media (min-width: 768px) {
  .desktop-nav {
    display: flex;
  }
}

.mobile-nav {
  display: flex;
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  right: 2rem;
  z-index: 50;
  backdrop-filter: blur(25px) saturate(200%);
  -webkit-backdrop-filter: blur(25px) saturate(200%);
  background-color: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 32px;
  padding: 0.5rem 1rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
}

.mobile-nav-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.75rem;
  background-color: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.nav-btn:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: var(--text-main);
}

.nav-btn-plus {
  background: #8f73ff;
  border: none;
  color: #fff;
  border-radius: 16px;
  padding: 10px 16px;
  transform: translateY(-8px);
  box-shadow: 0 8px 25px rgba(143, 115, 255, 0.3);
}

.nav-btn-plus .nav-icon {
  font-size: 1.35rem;
}

.nav-btn-plus:hover {
  background: #006ce4;
  transform: scale(1.05);
}

.nav-icon {
  font-size: 1.25rem;
}

.lang-btn-mobile {
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid var(--border);
  color: var(--text-main);
}

.lang-btn-mobile:hover {
  background: rgba(0, 0, 0, 0.08);
}

@media (min-width: 768px) {
  .mobile-nav {
    display: none;
  }
}

.hero {
  position: relative;
  padding-top: 10rem;
  padding-bottom: 8rem;
  text-align: center;
  min-height: 90vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  background: transparent;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-size: 80px 80px;
  background-image: linear-gradient(to right, rgba(0, 0, 0, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.03) 1px, transparent 1px);
  mask-image: linear-gradient(to bottom, black 20%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 20%, transparent 100%);
  z-index: 1;
}



.badge-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 16px;
  background: rgba(143, 115, 255, 0.1);
  border: 1px solid rgba(143, 115, 255, 0.2);
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--primary);
  margin-bottom: 2rem;
  font-weight: 600;
  backdrop-filter: blur(10px);
}

@keyframes pulse {

  0%,
  100% {
    opacity: 0.2;
  }

  50% {
    opacity: 0.6;
  }
}

.hero-content {
  position: relative;
  z-index: 10;
  max-width: 64rem;
  margin: 0 auto;
  padding: 1rem;
}

.hero-title {
  font-size: clamp(3rem, 10vw, 5rem);
  font-weight: 900;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #1d1d1f 0%, #4a1d96 50%, #1d1d1f 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
  letter-spacing: -3px;
}

/* Removed fixed hero-title media queries in favor of clamp() */

.hero-description {
  font-size: 1.125rem;
  color: var(--text-dim);
  margin-bottom: 3rem;
  font-weight: 400;
  max-width: 48rem;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

@media (min-width: 768px) {
  .hero-description {
    font-size: 1.25rem;
  }
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  justify-content: center;
  align-items: center;
}

.cta-button {
  padding: 1rem 2.5rem;
  border: none;
  border-radius: 9999px;
  /* Pill shape is very modern */
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.primary-cta {
  background: #111;
  color: #fff;
  padding: 1rem 3rem;
}

.primary-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
  background: #000;
}

.secondary-cta {
  background: rgba(0, 0, 0, 0.05);
  color: #111;
  border: none;
  padding: 1rem 3rem;
}

.secondary-cta:hover {
  background: rgba(0, 0, 0, 0.08);
}

/* Features Section */
.features {
  padding: clamp(3rem, 8vh, 6rem) 1rem;
  background-color: transparent;
}

.features-container {
  max-width: 1280px;
  margin: 0 auto;
}

.section-title {
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 800;
  text-align: center;
  margin-bottom: 3rem;
  color: var(--text-main);
  letter-spacing: -1px;
}

.elite-title {
  font-size: clamp(2rem, 8vw, 3.5rem);
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 1rem;
  letter-spacing: -1px;
}

/* Removed fixed section-title media queries in favor of clamp() */

.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .features-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
  }
}

.feature-card {
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  background-color: var(--card);
  border: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: var(--transition);
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  /* Apple-like soft drop shadow */
}

.feature-card:hover {
  border-color: rgba(0, 0, 0, 0.15);
  background-color: rgba(255, 255, 255, 1);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
  transform: translateY(-4px);
}

.feature-icon {
  display: inline-block;
  font-size: 1.75rem;
  margin-bottom: 1rem;
  padding: 0.5rem;
  background: rgba(143, 115, 255, 0.1);
  border-radius: var(--radius-md);
  color: var(--primary);
}

.feature-card h3 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.minimal-card {
  padding: 3.5rem 1.5rem;
  border-radius: 24px;
  background: #ffffff;
  border: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.minimal-card:hover {
  background: rgba(255, 255, 255, 1);
  border-color: rgba(0, 0, 0, 0.15);
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.minimal-card .feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: #fff;
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
  transition: all 0.3s;
}

.minimal-card:hover .feature-icon {
  background: #fff;
  color: #000;
  transform: scale(1.05);
}

.minimal-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #111;
  margin-bottom: 0.5rem;
  letter-spacing: -0.5px;
}

.minimal-card p {
  font-size: 0.95rem;
  color: #888;
  line-height: 1.5;
}

/* ============================================================
   STATS COUNTER SECTION
   ============================================================ */
.stats-section {
  padding: 4rem 1rem;
  background: transparent;
}

.stats-container {
  max-width: 1200px;
  margin: 0 auto;
}

.stats-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-subtitle {
  color: var(--text-dim);
  font-size: 1.1rem;
  margin-top: -1.5rem;
  margin-bottom: 2rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat-card {
  background: rgba(255, 255, 255, 0.7) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  border: 1px solid rgba(255, 255, 255, 0.4) !important;
  border-radius: 20px;
  padding: 2rem;
  text-align: center;
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  transform: translateY(-8px);
  background: rgba(255, 255, 255, 0.9) !important;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  border-color: rgba(143, 115, 255, 0.2) !important;
}

.stat-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  display: inline-block;
  background: rgba(143, 115, 255, 0.1);
  width: 70px;
  height: 70px;
  line-height: 70px;
  border-radius: 50%;
  border: 1px solid rgba(143, 115, 255, 0.2);
}

.stat-number {
  font-size: 3rem;
  font-weight: 900;
  color: var(--text-main);
  display: inline-block;
  background: linear-gradient(135deg, #1d1d1f, #4a1d96);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat-suffix {
  font-size: 2rem;
  font-weight: 800;
  color: #8f73ff;
  display: inline-block;
}

.stat-label {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.stat-desc {
  font-size: 0.9rem;
  color: var(--text-dim);
}

/* ============================================================
   ABOUT / MISSION SECTION
   ============================================================ */
.about-section {
  padding: 6rem 1rem;
  background: transparent;
  position: relative;
}

.about-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 4rem;
  align-items: center;
}

@media (min-width: 1024px) {
  .about-container {
    grid-template-columns: 1.2fr 0.8fr;
  }
}

.about-text {
  font-size: 1.2rem;
  line-height: 1.8;
  color: var(--text-main);
  margin-bottom: 2rem;
}

.about-highlights {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.highlight-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.6);
  padding: 1rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.highlight-item:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: translateX(-5px);
  /* RTL */
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
  border-color: rgba(143, 115, 255, 0.2);
}

.highlight-icon {
  font-size: 1.5rem;
}

/* Code Visual Card */
.visual-card {
  background: #111111;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  direction: ltr;
  /* Code is LTR */
}

.visual-header {
  background: #1d1d1f;
  padding: 12px 20px;
  display: flex;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.visual-header .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dot.red {
  background: #ff3b30;
}

.dot.yellow {
  background: #ffcc00;
}

.dot.green {
  background: #34c759;
}

.visual-content {
  padding: 2rem;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  line-height: 2;
}

.code-line {
  margin-bottom: 0.5rem;
}

.code-key {
  color: #8f73ff;
}

.code-val {
  color: #34c759;
}

.code-num {
  color: #ff9f0a;
}

/* ============================================================
   HOW IT WORKS SECTION
   ============================================================ */
.how-section {
  padding: 5rem 1rem;
  background: transparent;
}

.how-container {
  max-width: 1200px;
  margin: 0 auto;
}

.how-header {
  text-align: center;
  margin-bottom: 4rem;
}

.steps-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  position: relative;
}

@media (min-width: 768px) {
  .steps-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.step-card {
  background: rgba(255, 255, 255, 0.6);
  padding: 3rem 2rem;
  border-radius: 24px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(20px);
  position: relative;
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
}

.step-card:hover {
  background: rgba(255, 255, 255, 0.95);
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
  border-color: rgba(143, 115, 255, 0.2);
}

.step-number {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #1d1d1f, #8f73ff);
  color: white;
  width: 50px;
  height: 50px;
  line-height: 50px;
  border-radius: 50%;
  font-weight: 800;
  font-size: 1.2rem;
  box-shadow: 0 10px 20px rgba(143, 115, 255, 0.3);
}

.step-icon {
  font-size: 3rem;
  margin-bottom: 1.5rem;
  margin-top: 1rem;
}

.step-card h3 {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 1rem;
  color: var(--text-main);
}

.step-card p {
  color: var(--text-dim);
  line-height: 1.6;
}

/* Articles Section */
.articles-list {
  padding: 4rem 1rem;
  background-color: var(--bg);
}

.articles-container {
  max-width: 1280px;
  margin: 0 auto;
}

.articles-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .articles-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .articles-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.article-card {
  cursor: pointer;
  text-align: start;
  transition: all 0.3s ease;
}

.article-card-image {
  position: relative;
  overflow: hidden;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  background: rgba(143, 115, 255, 0.05);
  height: 12rem;
}

.article-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.article-card:hover .article-card-image img {
  transform: scale(1.05);
}

.like-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.7);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  backdrop-filter: blur(4px);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 10;
}

.like-btn:hover {
  transform: scale(1.1);
  background: rgba(0, 0, 0, 0.8);
}

.like-btn.liked {
  background: #fff;
  box-shadow: 0 0 15px rgba(255, 59, 48, 0.2);
  color: var(--danger);
}

.article-card h3 {
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  overflow: hidden;
}

.article-card p {
  color: var(--text-dim);
  font-size: 0.875rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  line-clamp: 3;
  overflow: hidden;
  overflow: hidden;
}

/* Article Detail View */
.article-detail {
  padding: 5rem 1rem 2rem;
  background-color: var(--bg);
  min-height: 100vh;
}

.article-detail.hidden {
  display: none;
}

.article-detail-container {
  max-width: 56rem;
  margin: 0 auto;
}

.back-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  color: var(--primary);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: opacity 0.3s ease;
}

.back-button:hover {
  opacity: 0.8;
}

.article-image-container {
  border-radius: 0.75rem;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.article-image {
  width: 100%;
  height: 20rem;
  object-fit: cover;
}

.article-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .article-title {
    font-size: 2.25rem;
  }
}

.article-content {
  color: var(--text-main);
  line-height: 1.8;
  margin-bottom: 4rem;
}

.article-content p {
  margin-bottom: 1rem;
}

.more-articles {
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.more-articles h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 1.5rem;
}

.more-articles-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 768px) {
  .more-articles-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.more-article-btn {
  text-align: start;
  padding: 1rem;
  border-radius: 0.5rem;
  background-color: rgba(143, 115, 255, 0.04);
  border: 1px solid rgba(143, 115, 255, 0.1);
  cursor: pointer;
  transition: all 0.3s ease;
}

.more-article-btn:hover {
  border-color: rgba(143, 115, 255, 0.2);
  background-color: rgba(143, 115, 255, 0.08);
}

.more-article-btn h3 {
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  overflow: hidden;
}

.more-article-btn p {
  color: var(--text-dim);
  font-size: 0.875rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  overflow: hidden;
}

/* Footer */
.footer {
  padding: 2rem 1rem 6rem;
  border-top: 1px solid var(--border);
  background-color: #ffffff;
}

@media (min-width: 768px) {
  .footer {
    padding: 3rem 1rem 2rem;
  }
}

.footer-container {
  max-width: 1280px;
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
  }
}

.footer-column h4 {
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
}

@media (min-width: 768px) {
  .footer-column h4 {
    font-size: 1rem;
  }
}

.footer-column ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-column li {
  margin-bottom: 0.5rem;
}

.footer-column a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.75rem;
  transition: color 0.3s ease;
}

@media (min-width: 768px) {
  .footer-column a {
    font-size: 0.875rem;
  }
}

.footer-column a:hover {
  color: var(--primary);
}

.social-links {
  display: flex;
  gap: 1rem;
}

.social-link {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 1.125rem;
  transition: color 0.3s ease;
}

.social-link:hover {
  color: var(--primary);
}

.footer-bottom {
  text-align: center;
  border-top: 1px solid var(--border);
  padding-top: 2rem;
  font-size: 0.75rem;
  color: var(--text-dim);
}

@media (min-width: 768px) {
  .footer-bottom {
    font-size: 0.875rem;
    padding-top: 2.5rem;
  }
}

/* Models Modal - Glassmorphism Design */
.models-modal {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.models-modal.hidden {
  display: none;
}

.models-modal-content {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  padding: 2rem;
  max-width: 500px;
  width: 100%;
  position: relative;
  box-shadow:
    0 15px 50px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(255, 255, 255, 0.5) inset;
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.close-modal-btn {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: rgba(0, 0, 0, 0.04);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: var(--text-dim);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 1.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-modal-btn:hover {
  background: rgba(0, 0, 0, 0.1);
  border-color: rgba(0, 0, 0, 0.2);
  color: var(--text-main);
  transform: rotate(90deg);
}

.models-modal-content h2 {
  font-size: 1.5rem;
  color: var(--text-main);
  margin-bottom: 1.5rem;
  text-align: center;
  font-weight: 700;
}

.tools-primary-actions {
  display: grid;
  gap: 0.75rem;
}

.tool-cta {
  display: flex;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(0, 0, 0, 0.02);
  backdrop-filter: blur(20px);
  text-decoration: none;
  color: var(--text-main);
  align-items: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.tool-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(143, 115, 255, 0.05) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.tool-cta:hover::before {
  opacity: 1;
}

.tool-cta:hover {
  transform: translateY(-2px);
  border-color: rgba(143, 115, 255, 0.3);
  background: rgba(143, 115, 255, 0.04);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.05),
    0 0 0 1px rgba(143, 115, 255, 0.1) inset;
}

.tool-cta:active {
  transform: translateY(0);
}

.tool-cta-icon {
  width: 2.5rem;
  height: 2.5rem;
  min-width: 2.5rem;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, rgba(143, 115, 255, 0.1), rgba(143, 115, 255, 0.05));
  backdrop-filter: blur(10px);
  border: 1px solid rgba(143, 115, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--primary);
  transition: all 0.3s ease;
}

.tool-cta:hover .tool-cta-icon {
  background: linear-gradient(135deg, rgba(143, 115, 255, 0.4), rgba(143, 115, 255, 0.2));
  border-color: rgba(143, 115, 255, 0.5);
  transform: scale(1.05);
}

.tool-cta-text {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.tool-cta-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #f5d0fe;
  display: block;
}

.tool-cta-desc {
  font-size: 0.8rem;
  color: #9ca3af;
  display: block;
  line-height: 1.4;
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
  .models-modal-content {
    max-width: 100%;
    padding: 1.5rem;
    border-radius: 1.25rem;
  }

  .models-modal-content h2 {
    font-size: 1.25rem;
    margin-bottom: 1.25rem;
  }

  .tool-cta {
    padding: 0.75rem 0.85rem;
    gap: 0.75rem;
  }

  .tool-cta-icon {
    width: 2.25rem;
    height: 2.25rem;
    min-width: 2.25rem;
    font-size: 1.1rem;
  }

  .tool-cta-title {
    font-size: 0.875rem;
  }

  .tool-cta-desc {
    font-size: 0.75rem;
  }
}

.image-preview-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 70;
}

.image-preview-modal.hidden {
  display: none;
}

.image-preview-content {
  width: min(900px, 100%);
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 1.25rem;
  padding: 1.5rem;
  box-shadow: 0 35px 60px rgba(0, 0, 0, 0.45);
  position: relative;
}

.image-preview-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(15, 15, 15, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.4);
  color: #f5d0fe;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-preview-close:hover {
  border-color: rgba(250, 204, 255, 0.8);
}

.image-preview-content img {
  width: 100%;
  border-radius: 1rem;
  margin-bottom: 1rem;
  object-fit: cover;
  max-height: 65vh;
}

.image-preview-footer {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.image-preview-caption {
  color: #e5e7eb;
  font-size: 0.95rem;
  line-height: 1.5;
}

.image-download-btn {
  align-self: flex-start;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #8f73ff, #6c4cf5);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.image-download-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 25px rgba(91, 61, 245, 0.35);
}

.image-download-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.prevent-scroll {
  overflow: hidden;
}

/* Hidden class */
.hidden {
  display: none !important;
}

/* HTML direction support */
[dir="rtl"] {
  direction: rtl;
  text-align: right;
}

[dir="rtl"] .back-button,
[dir="rtl"] .article-card,
[dir="rtl"] .more-article-btn {
  text-align: right;
}

[dir="rtl"] .hero {
  text-align: center;
}

[dir="rtl"] .nav-btn {
  margin: 0 auto;
}

/* AI search section */
.ai-search-section {
  padding: 4rem 1rem;
  background: radial-gradient(circle at top, rgba(143, 115, 255, 0.05), transparent 60%);
}

.ai-search-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem;
  border-radius: 1.5rem;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

.ai-search-heading {
  text-align: center;
  margin-bottom: 2rem;
}

.ai-search-heading h1,
.ai-search-heading h2 {
  font-size: 2.25rem;
  margin-bottom: 0.75rem;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.ai-search-heading p {
  color: var(--text-dim);
  max-width: 640px;
  margin: 0 auto;
  font-size: 1rem;
}

.ai-search-label {
  display: inline-flex;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: rgba(143, 115, 255, 0.08);
  border: 1px solid rgba(143, 115, 255, 0.2);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.ai-search-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 768px) {
  .ai-search-form {
    flex-direction: row;
    align-items: center;
    gap: 1rem;
  }

  .ai-search-count {
    width: 180px;
  }
}

.ai-search-field {
  flex: 1;
}

.ai-search-field input {
  width: 100%;
  padding: 1rem 1.25rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid var(--border);
  color: var(--text-main);
  font-size: 1rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.ai-search-field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: none;
}

.ai-search-count {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  width: 100%;
}

.ai-search-count-label {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-weight: 500;
}

.ai-search-count-select {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.03);
  color: var(--text-main);
  font-size: 0.9rem;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--primary) 50%), linear-gradient(135deg, var(--primary) 50%, transparent 50%);
  background-position: calc(100% - 20px) calc(50% - 3px), calc(100% - 15px) calc(50% - 3px);
  background-size: 6px 6px;
  background-repeat: no-repeat;
}

.ai-search-count-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: none;
}

.ai-search-count-select option {
  background: var(--bg);
}

.ai-search-submit {
  padding: 1rem 1.75rem;
  border-radius: 999px;
  border: none;
  background: var(--text-main);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  min-width: 180px;
}

.ai-search-submit:hover:not(.is-loading) {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  background: #000;
}

.ai-search-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.loading-dot {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 999px;
  display: inline-block;
  border: 3px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.ai-search-status {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.95rem;
  min-height: 1.25rem;
  color: var(--primary);
}

.ai-search-status.error {
  color: var(--danger);
}

.ai-search-status.loading {
  color: var(--primary);
}

.ai-search-results {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.25rem;
}

.ai-search-result {
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  color: inherit;
  width: 100%;
  text-align: start;
  cursor: pointer;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  outline: none;
  display: block;
}

.ai-search-result:hover,
.ai-search-result:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(143, 115, 255, 0.3);
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.08);
}

.ai-search-result img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.ai-search-result p {
  padding: 0.85rem;
  font-size: 0.85rem;
  color: var(--text-main);
}

.floating-search-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.25rem;
  z-index: 60;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  background: var(--text-main);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.floating-search-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 35px rgba(0, 0, 0, 0.2);
}

.search-page {
  min-height: 100vh;
  padding: 2rem 1rem 4rem;
  max-width: 960px;
  margin: 0 auto;
}

.search-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.search-page-back {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.search-page-badge {
  padding: 0.35rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(143, 115, 255, 0.3);
  color: var(--primary);
  font-size: 0.85rem;
}

.search-page-content {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  padding: 2rem;
  box-shadow: 0 25px 45px rgba(0, 0, 0, 0.05);
}

@media (max-width: 640px) {

  .ai-search-heading h1,
  .ai-search-heading h2 {
    font-size: 1.75rem;
  }

  .floating-search-btn {
    bottom: 6rem;
  }
}

/* Translation Page Styles */
.translate-container {
  max-width: 1200px;
  margin: 0 auto;
}

.translate-panels {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.translate-panel {
  background: rgba(15, 15, 25, 0.6);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(143, 115, 255, 0.2);
  border-radius: 1rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.translate-panel-header {
  padding: 1rem;
  background: rgba(143, 115, 255, 0.08);
  border-bottom: 1px solid rgba(143, 115, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.translate-lang-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #8f73ff;
  min-width: 35px;
}

.translate-lang-select {
  flex: 1;
  padding: 0.6rem 0.85rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(143, 115, 255, 0.3);
  border-radius: 0.5rem;
  color: #e3dcff;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.translate-lang-select:hover {
  border-color: rgba(143, 115, 255, 0.5);
  background: rgba(143, 115, 255, 0.1);
}

.translate-lang-select:focus {
  outline: none;
  border-color: #8f73ff;
  box-shadow: 0 0 0 3px rgba(143, 115, 255, 0.2);
}

.translate-clear-btn,
.translate-copy-btn {
  width: 32px;
  height: 32px;
  background: rgba(143, 115, 255, 0.1);
  border: 1px solid rgba(143, 115, 255, 0.25);
  border-radius: 0.5rem;
  color: #cfc3ff;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.translate-clear-btn:hover,
.translate-copy-btn:hover {
  background: rgba(143, 115, 255, 0.2);
  border-color: rgba(143, 115, 255, 0.4);
  transform: scale(1.05);
}

.translate-textarea {
  flex: 1;
  padding: 1.25rem;
  background: transparent;
  border: none;
  color: #e5e7eb;
  font-size: 1rem;
  line-height: 1.6;
  resize: none;
  outline: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 250px;
}

.translate-textarea::placeholder {
  color: #6b7280;
}

.translate-result {
  overflow-y: auto;
  cursor: default;
}

.translate-placeholder {
  color: #6b7280;
  font-style: italic;
}

.translate-result-text {
  color: #e5e7eb;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.translate-loading {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  color: #9ca3af;
}

.loading-dot {
  width: 8px;
  height: 8px;
  background: #8f73ff;
  border-radius: 50%;
  animation: loading-bounce 1.4s infinite ease-in-out both;
}

.loading-dot:nth-child(1) {
  animation-delay: -0.32s;
}

.loading-dot:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes loading-bounce {

  0%,
  80%,
  100% {
    transform: scale(0.8);
    opacity: 0.5;
  }

  40% {
    transform: scale(1.2);
    opacity: 1;
  }
}

.translate-panel-footer {
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid rgba(143, 115, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.translate-char-count {
  font-size: 0.8rem;
  color: #9ca3af;
}

.translate-detected-lang {
  font-size: 0.75rem;
  color: #8f73ff;
  font-weight: 500;
  font-style: italic;
}

.translate-status {
  font-size: 0.8rem;
  color: #8f73ff;
  font-weight: 500;
}

.translate-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
}

.translate-swap-btn {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, rgba(143, 115, 255, 0.2), rgba(143, 115, 255, 0.1));
  backdrop-filter: blur(10px);
  border: 1px solid rgba(143, 115, 255, 0.3);
  border-radius: 50%;
  color: #e3dcff;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.translate-swap-btn:hover {
  background: linear-gradient(135deg, rgba(143, 115, 255, 0.3), rgba(143, 115, 255, 0.15));
  border-color: rgba(143, 115, 255, 0.5);
  transform: rotate(180deg) scale(1.1);
}

.translate-actions {
  display: flex;
  justify-content: center;
  margin-bottom: 2.5rem;
}

.translate-submit-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2.5rem;
  background: linear-gradient(135deg, #6c4cf5, #7a5cf0);
  border: none;
  border-radius: 0.75rem;
  color: white;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(91, 61, 245, 0.4);
}

.translate-submit-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(91, 61, 245, 0.5);
}

.translate-submit-btn:active:not(:disabled) {
  transform: translateY(0);
}

.translate-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.translate-btn-icon {
  font-size: 1.25rem;
}

.translate-quick-phrases {
  background: rgba(15, 15, 25, 0.4);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(143, 115, 255, 0.15);
  border-radius: 1rem;
  padding: 1.5rem;
}

.translate-quick-phrases h3 {
  color: #e3dcff;
  font-size: 1.1rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.quick-phrases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  direction: rtl;
  /* Force RTL to maintain layout */
  width: 100%;
}

.quick-phrase-btn {
  padding: 0.75rem 1rem;
  background: rgba(143, 115, 255, 0.08);
  border: 1px solid rgba(143, 115, 255, 0.2);
  border-radius: 0.5rem;
  color: #cfc3ff;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.quick-phrase-btn:hover {
  background: rgba(143, 115, 255, 0.15);
  border-color: rgba(143, 115, 255, 0.4);
  transform: translateY(-2px);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .translate-panels {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .translate-arrow {
    transform: rotate(90deg);
    margin: -0.5rem 0;
  }

  .translate-textarea {
    min-height: 180px;
  }

  .quick-phrases-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.5rem;
  }

  .quick-phrase-btn {
    padding: 0.6rem 0.75rem;
    font-size: 0.85rem;
  }
}

/* Code Generator Chat Styles */

/* Sidebar Toggle Button */
.sidebar-toggle {
  position: fixed;
  top: 100px;
  right: 2rem;
  z-index: 1001;
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #6c4cf5, #7a5cf0);
  border: none;
  border-radius: 12px;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(91, 61, 245, 0.4);
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-toggle:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(91, 61, 245, 0.6);
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  right: -320px;
  width: 320px;
  height: 100vh;
  background: rgba(15, 15, 25, 0.95);
  backdrop-filter: blur(20px);
  border-left: 1px solid rgba(143, 115, 255, 0.2);
  z-index: 1000;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar.open {
  right: 0;
}

.sidebar-header {
  padding: 2rem 1.5rem 1.5rem;
  border-bottom: 1px solid rgba(143, 115, 255, 0.2);
}

.sidebar-header h3 {
  color: #e3dcff;
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.new-chat-btn {
  width: 100%;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, #6c4cf5, #7a5cf0);
  border: none;
  border-radius: 0.5rem;
  color: white;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.3s;
}

.new-chat-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(91, 61, 245, 0.4);
}

.chat-history {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

.history-empty {
  text-align: center;
  color: #6b7280;
  padding: 2rem 1rem;
  font-style: italic;
}

.history-item {
  padding: 1rem;
  background: rgba(143, 115, 255, 0.08);
  border: 1px solid rgba(143, 115, 255, 0.2);
  border-radius: 0.5rem;
  margin-bottom: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

.history-item:hover {
  background: rgba(143, 115, 255, 0.15);
  border-color: rgba(143, 115, 255, 0.4);
  transform: translateX(-4px);
}

.history-title {
  color: #e3dcff;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-date {
  color: #9ca3af;
  font-size: 0.75rem;
}

.codegen-chat-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 200px);
  min-height: 600px;
  background: rgba(15, 15, 25, 0.6);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(143, 115, 255, 0.2);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.chat-welcome {
  text-align: center;
  padding: 3rem 2rem;
  max-width: 600px;
  margin: auto;
}

.welcome-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.05);
    opacity: 0.8;
  }
}

.chat-welcome h2 {
  color: #e3dcff;
  font-size: 1.75rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

.chat-welcome p {
  color: #9ca3af;
  font-size: 1rem;
  margin-bottom: 2rem;
  line-height: 1.6;
}

.welcome-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.welcome-btn {
  padding: 0.75rem 1.25rem;
  background: rgba(143, 115, 255, 0.1);
  border: 1px solid rgba(143, 115, 255, 0.3);
  border-radius: 2rem;
  color: #cfc3ff;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.welcome-btn:hover {
  background: rgba(143, 115, 255, 0.2);
  border-color: rgba(143, 115, 255, 0.5);
  transform: translateY(-2px);
}

/* Chat Messages */
.chat-message {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-message.user {
  flex-direction: row-reverse;
}

.chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.chat-message.user .chat-avatar {
  background: linear-gradient(135deg, #6c4cf5, #7a5cf0);
}

.chat-message.ai .chat-avatar {
  background: linear-gradient(135deg, #8f73ff, #b9a8ff);
}

.chat-bubble {
  max-width: 70%;
  padding: 1rem 1.25rem;
  border-radius: 1rem;
  line-height: 1.6;
}

.chat-message.user .chat-bubble {
  background: linear-gradient(135deg, #6c4cf5, #7a5cf0);
  color: white;
  border-bottom-right-radius: 0.25rem;
}

.chat-message.ai .chat-bubble {
  background: rgba(143, 115, 255, 0.1);
  border: 1px solid rgba(143, 115, 255, 0.2);
  color: #e5e7eb;
  border-bottom-left-radius: 0.25rem;
}

/* Code Artifact */
.code-artifact {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(143, 115, 255, 0.3);
  border-radius: 0.75rem;
  overflow: hidden;
  margin-top: 0.75rem;
}

.code-artifact-header {
  background: rgba(143, 115, 255, 0.08);
  border-bottom: 1px solid rgba(143, 115, 255, 0.2);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.code-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.code-tab {
  padding: 0.4rem 0.75rem;
  background: rgba(143, 115, 255, 0.1);
  border: 1px solid rgba(143, 115, 255, 0.2);
  border-radius: 0.375rem;
  color: #cfc3ff;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Courier New', monospace;
}

.code-tab.active {
  background: rgba(143, 115, 255, 0.25);
  border-color: rgba(143, 115, 255, 0.5);
  color: #e3dcff;
}

.code-tab:hover:not(.active) {
  background: rgba(143, 115, 255, 0.15);
}

.code-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.code-action-btn {
  padding: 0.4rem 0.75rem;
  background: rgba(143, 115, 255, 0.1);
  border: 1px solid rgba(143, 115, 255, 0.25);
  border-radius: 0.375rem;
  color: #cfc3ff;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.code-action-btn:hover {
  background: rgba(143, 115, 255, 0.2);
  border-color: rgba(143, 115, 255, 0.4);
}

.code-action-btn.success {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}

.code-body {
  background: #0a0a0a;
  padding: 1rem;
  overflow-x: auto;
  max-height: 500px;
  overflow-y: auto;
}

.code-body pre {
  margin: 0;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  color: #e5e7eb;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Chat Input Area */
.chat-input-area {
  border-top: 1px solid rgba(143, 115, 255, 0.2);
  background: rgba(0, 0, 0, 0.3);
  padding: 1rem;
}

.chat-input-wrapper {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
}

#chatInput {
  flex: 1;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(143, 115, 255, 0.3);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  color: #e5e7eb;
  font-size: 1rem;
  resize: none;
  max-height: 150px;
  min-height: 44px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  transition: all 0.2s;
}

#chatInput:focus {
  outline: none;
  border-color: #8f73ff;
  box-shadow: 0 0 0 3px rgba(143, 115, 255, 0.2);
  background: rgba(0, 0, 0, 0.6);
}

#chatInput::placeholder {
  color: #6b7280;
}

.chat-send-btn {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #6c4cf5, #7a5cf0);
  border: none;
  border-radius: 0.75rem;
  color: white;
  font-size: 1.25rem;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-send-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(91, 61, 245, 0.4);
}

.chat-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Preview Modal */
.preview-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 2rem;
}

.preview-modal.hidden {
  display: none;
}

.preview-content {
  background: rgba(15, 15, 25, 0.95);
  border: 1px solid rgba(143, 115, 255, 0.3);
  border-radius: 1rem;
  width: 100%;
  max-width: 1200px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.preview-header {
  background: rgba(143, 115, 255, 0.08);
  border-bottom: 1px solid rgba(143, 115, 255, 0.2);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.preview-header h3 {
  color: #e3dcff;
  font-size: 1.1rem;
  margin: 0;
}

.close-preview-btn {
  width: 32px;
  height: 32px;
  background: rgba(143, 115, 255, 0.2);
  border: none;
  border-radius: 0.5rem;
  color: #e3dcff;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.close-preview-btn:hover {
  background: rgba(143, 115, 255, 0.3);
}

.preview-body {
  flex: 1;
  background: white;
  overflow: hidden;
}

#previewFrame {
  width: 100%;
  height: 100%;
  border: none;
}

/* Loading State */
.chat-loading {
  display: flex;
  gap: 0.5rem;
  padding: 1rem;
}

.chat-loading-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8f73ff;
  animation: bounce 0.6s alternate infinite;
}

.chat-loading-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.chat-loading-dot:nth-child(3) {
  animation-delay: 0.4s;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .codegen-chat-container {
    height: calc(100vh - 150px);
  }

  .chat-messages {
    padding: 1rem;
  }

  .chat-welcome {
    padding: 2rem 1rem;
  }

  .chat-welcome h2 {
    font-size: 1.5rem;
  }

  .welcome-examples {
    flex-direction: column;
  }

  .welcome-btn {
    width: 100%;
  }

  .chat-bubble {
    max-width: 85%;
  }

  .code-artifact-header {
    padding: 0.5rem 0.75rem;
  }

  .code-tabs {
    width: 100%;
  }

  .code-tab {
    font-size: 0.75rem;
    padding: 0.35rem 0.6rem;
  }

  .code-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .code-action-btn {
    font-size: 0.7rem;
    padding: 0.35rem 0.6rem;
  }

  .code-action-btn span:not(.btn-icon) {
    display: none;
  }

  .preview-modal {
    padding: 1rem;
  }

  .preview-content {
    max-height: 95vh;
  }
}

@media (max-width: 640px) {
  .chat-avatar {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }

  .chat-bubble {
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
  }

  .code-body {
    padding: 0.75rem;
    font-size: 0.8rem;
  }

  #chatInput {
    font-size: 0.95rem;
  }

  .chat-send-btn {
    width: 40px;
    height: 40px;
  }
}

/* Text to Speech Styles */
.tts-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.tts-input-section,
.tts-player-section {
  background: rgba(15, 15, 25, 0.6);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(143, 115, 255, 0.2);
  border-radius: 1rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.tts-header {
  padding: 1.25rem 1.5rem;
  background: rgba(143, 115, 255, 0.08);
  border-bottom: 1px solid rgba(143, 115, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tts-header h3 {
  color: #e3dcff;
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
}

.tts-controls {
  display: flex;
  gap: 0.75rem;
}

.tts-select {
  padding: 0.6rem 1rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(143, 115, 255, 0.3);
  border-radius: 0.5rem;
  color: #e3dcff;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.tts-select:hover {
  border-color: rgba(143, 115, 255, 0.5);
  background: rgba(143, 115, 255, 0.1);
}

.tts-select:focus {
  outline: none;
  border-color: #8f73ff;
  box-shadow: 0 0 0 3px rgba(143, 115, 255, 0.2);
}

.tts-textarea {
  flex: 1;
  padding: 1.5rem;
  background: transparent;
  border: none;
  color: #e5e7eb;
  font-size: 1rem;
  line-height: 1.6;
  resize: none;
  outline: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 250px;
}

.tts-textarea::placeholder {
  color: #6b7280;
}

.tts-input-footer {
  padding: 1rem 1.5rem;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid rgba(143, 115, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tts-char-count {
  font-size: 0.8rem;
  color: #9ca3af;
}

.tts-actions {
  display: flex;
  gap: 0.75rem;
}

.tts-action-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.tts-action-btn.primary {
  background: linear-gradient(135deg, #6c4cf5, #7a5cf0);
  color: white;
  box-shadow: 0 4px 12px rgba(91, 61, 245, 0.4);
}

.tts-action-btn.primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(91, 61, 245, 0.5);
}

.tts-action-btn.primary.speaking {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.tts-action-btn.secondary {
  background: rgba(143, 115, 255, 0.1);
  border: 1px solid rgba(143, 115, 255, 0.25);
  color: #cfc3ff;
}

.tts-action-btn.secondary:hover {
  background: rgba(143, 115, 255, 0.2);
  border-color: rgba(143, 115, 255, 0.4);
}

.tts-action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.tts-player-container {
  flex: 1;
  padding: 2rem;
  background: #0a0a0a;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.audio-visualizer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 100px;
  opacity: 0;
  transition: opacity 0.3s;
}

.audio-visualizer.active {
  opacity: 1;
}

.visualizer-bar {
  width: 8px;
  height: 20px;
  background: linear-gradient(180deg, #6c4cf5, #7a5cf0);
  border-radius: 4px;
  animation: none;
}

.audio-visualizer.active .visualizer-bar {
  animation: visualize 0.8s ease-in-out infinite;
}

.visualizer-bar:nth-child(1) {
  animation-delay: 0s;
}

.visualizer-bar:nth-child(2) {
  animation-delay: 0.1s;
}

.visualizer-bar:nth-child(3) {
  animation-delay: 0.2s;
}

.visualizer-bar:nth-child(4) {
  animation-delay: 0.3s;
}

.visualizer-bar:nth-child(5) {
  animation-delay: 0.4s;
}

.visualizer-bar:nth-child(6) {
  animation-delay: 0.3s;
}

.visualizer-bar:nth-child(7) {
  animation-delay: 0.2s;
}

.visualizer-bar:nth-child(8) {
  animation-delay: 0.1s;
}

@keyframes visualize {

  0%,
  100% {
    height: 20px;
  }

  50% {
    height: 80px;
  }
}

.player-placeholder {
  text-align: center;
  color: #6b7280;
  padding: 2rem;
}

.placeholder-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.player-placeholder p {
  margin: 0;
  font-size: 0.95rem;
}

.tts-download-btn {
  padding: 0.5rem 1rem;
  background: rgba(143, 115, 255, 0.1);
  border: 1px solid rgba(143, 115, 255, 0.25);
  border-radius: 0.5rem;
  color: #cfc3ff;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.tts-download-btn:hover:not(:disabled) {
  background: rgba(143, 115, 255, 0.2);
  border-color: rgba(143, 115, 255, 0.4);
}

.tts-download-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.tts-status {
  padding: 0.75rem 1.5rem;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid rgba(143, 115, 255, 0.15);
  font-size: 0.85rem;
  color: #8f73ff;
  font-weight: 500;
  min-height: 2.5rem;
}

.tts-quick-texts {
  grid-column: 1 / -1;
  background: rgba(15, 15, 25, 0.4);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(143, 115, 255, 0.15);
  border-radius: 1rem;
  padding: 1.5rem;
}

.tts-quick-texts h3 {
  color: #e3dcff;
  font-size: 1.1rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.quick-texts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}

.quick-text-btn {
  padding: 1rem;
  background: rgba(143, 115, 255, 0.08);
  border: 1px solid rgba(143, 115, 255, 0.2);
  border-radius: 0.75rem;
  color: #cfc3ff;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  text-align: right;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.quick-text-btn:hover {
  background: rgba(143, 115, 255, 0.15);
  border-color: rgba(143, 115, 255, 0.4);
  transform: translateY(-2px);
}

.quick-icon {
  font-size: 1.5rem;
}

/* Mobile Responsiveness */
@media (max-width: 1024px) {
  .tts-container {
    grid-template-columns: 1fr;
  }

  .tts-player-container {
    min-height: 250px;
  }
}

@media (max-width: 640px) {
  .tts-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .tts-controls {
    width: 100%;
    flex-direction: column;
  }

  .tts-select {
    width: 100%;
  }

  .tts-input-footer {
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
  }

  .tts-actions {
    width: 100%;
    flex-direction: column;
  }

  .tts-action-btn {
    width: 100%;
    justify-content: center;
  }

  .quick-texts-grid {
    grid-template-columns: 1fr;
  }
}

/* Speech Translator Styles */
.speech-translator-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.speech-input-section,
.speech-output-section {
  background: rgba(15, 15, 25, 0.6);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(143, 115, 255, 0.2);
  border-radius: 1rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.speech-header {
  padding: 1.25rem 1.5rem;
  background: rgba(143, 115, 255, 0.08);
  border-bottom: 1px solid rgba(143, 115, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.speech-header h3 {
  color: #e3dcff;
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
}

.speech-lang-select {
  padding: 0.6rem 1rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(143, 115, 255, 0.3);
  border-radius: 0.5rem;
  color: #e3dcff;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.speech-lang-select:hover {
  border-color: rgba(143, 115, 255, 0.5);
  background: rgba(143, 115, 255, 0.1);
}

.speech-lang-select:focus {
  outline: none;
  border-color: #8f73ff;
  box-shadow: 0 0 0 3px rgba(143, 115, 255, 0.2);
}

.microphone-container {
  padding: 3rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  background: #0a0a0a;
}

.microphone-btn {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6c4cf5, #7a5cf0);
  border: none;
  cursor: pointer;
  position: relative;
  transition: all 0.3s ease;
  box-shadow: 0 8px 24px rgba(91, 61, 245, 0.4);
}

.microphone-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 32px rgba(91, 61, 245, 0.5);
}

.microphone-btn.listening {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.4);
  }

  50% {
    box-shadow: 0 8px 32px rgba(239, 68, 68, 0.6), 0 0 0 20px rgba(239, 68, 68, 0.1);
  }
}

.mic-icon {
  font-size: 3rem;
  position: relative;
  z-index: 2;
}

.mic-pulse {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.3);
  opacity: 0;
}

.microphone-btn.listening .mic-pulse {
  animation: pulsering 2s ease-out infinite;
}

@keyframes pulsering {
  0% {
    transform: scale(0.8);
    opacity: 1;
  }

  100% {
    transform: scale(1.4);
    opacity: 0;
  }
}

.mic-status {
  color: #8f73ff;
  font-size: 0.95rem;
  font-weight: 500;
  text-align: center;
  margin: 0;
}

.recognized-text-container {
  padding: 1.5rem;
  flex: 1;
}

.recognized-text-container h4 {
  color: #cfc3ff;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.recognized-text {
  padding: 1rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(143, 115, 255, 0.2);
  border-radius: 0.5rem;
  color: #6b7280;
  font-size: 1rem;
  line-height: 1.6;
  min-height: 100px;
}

.translation-output-container {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.translation-output {
  flex: 1;
  padding: 1.5rem;
  background: #0a0a0a;
  border: 1px solid rgba(143, 115, 255, 0.2);
  border-radius: 0.5rem;
  color: #6b7280;
  font-size: 1rem;
  line-height: 1.6;
  min-height: 150px;
  margin-bottom: 1rem;
}

.translation-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.translation-action-btn {
  flex: 1;
  min-width: 100px;
  padding: 0.75rem 1rem;
  background: rgba(143, 115, 255, 0.1);
  border: 1px solid rgba(143, 115, 255, 0.25);
  border-radius: 0.5rem;
  color: #cfc3ff;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.translation-action-btn:hover:not(:disabled) {
  background: rgba(143, 115, 255, 0.2);
  border-color: rgba(143, 115, 255, 0.4);
  transform: translateY(-1px);
}

.translation-action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.translation-status {
  padding: 0.75rem 1.5rem;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid rgba(143, 115, 255, 0.15);
  font-size: 0.85rem;
  color: #8f73ff;
  font-weight: 500;
  min-height: 2.5rem;
}

.translation-history {
  grid-column: 1 / -1;
  background: rgba(15, 15, 25, 0.4);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(143, 115, 255, 0.15);
  border-radius: 1rem;
  padding: 1.5rem;
  max-height: 400px;
  overflow-y: auto;
}

.translation-history h3 {
  color: #e3dcff;
  font-size: 1.1rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.history-empty {
  color: #6b7280;
  text-align: center;
  padding: 2rem;
  font-style: italic;
}

.history-item {
  padding: 1rem;
  background: rgba(143, 115, 255, 0.08);
  border: 1px solid rgba(143, 115, 255, 0.2);
  border-radius: 0.75rem;
  display: grid;
  grid-template-columns: auto 1fr auto 1fr;
  gap: 0.75rem;
  align-items: center;
  transition: all 0.2s;
}

.history-item:hover {
  background: rgba(143, 115, 255, 0.12);
  border-color: rgba(143, 115, 255, 0.3);
}

.history-time {
  grid-column: 1 / -1;
  font-size: 0.75rem;
  color: #9ca3af;
  margin-bottom: 0.25rem;
}

.history-lang-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  background: rgba(143, 115, 255, 0.2);
  border-radius: 0.25rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: #b9a8ff;
  margin-left: 0.5rem;
}

.history-original,
.history-translated {
  color: #e5e7eb;
  font-size: 0.9rem;
}

.history-arrow {
  color: #8f73ff;
  font-size: 1.25rem;
  font-weight: bold;
}

/* Mobile Responsiveness */
@media (max-width: 1024px) {
  .speech-translator-container {
    grid-template-columns: 1fr;
  }

  .history-item {
    grid-template-columns: 1fr;
  }

  .history-arrow {
    transform: rotate(90deg);
    text-align: center;
  }
}

@media (max-width: 640px) {
  .speech-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .speech-lang-select {
    width: 100%;
  }

  .microphone-btn {
    width: 100px;
    height: 100px;
  }

  .mic-icon {
    font-size: 2.5rem;
  }

  .translation-actions {
    flex-direction: column;
  }

  .translation-action-btn {
    width: 100%;
  }
}

/* Image Generator Chat Styles */
.image-generator-container {
  overflow: hidden;
  height: 100%;
}

.chat-interface {
  height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0;
  border: none;
  overflow: hidden;
}

@media (min-width: 768px) {
  .chat-interface {
    max-width: 900px;
    height: calc(100vh - 140px);
  }
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  padding-bottom: 100px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(143, 115, 255, 0.3) transparent;
}

.message {
  display: flex;
  gap: 1rem;
  max-width: 85%;
  animation: fadeIn 0.3s ease;
}

.message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message.ai {
  align-self: flex-start;
}

.message-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(143, 115, 255, 0.2);
  border: 1px solid rgba(143, 115, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.message.user .message-avatar {
  background: rgba(143, 115, 255, 0.2);
  border-color: rgba(143, 115, 255, 0.3);
}

.message-content {
  background: rgba(30, 30, 40, 0.6);
  padding: 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: #e5e7eb;
  line-height: 1.6;
}

.message.user .message-content {
  background: rgba(143, 115, 255, 0.1);
  border-color: rgba(143, 115, 255, 0.2);
  border-bottom-left-radius: 0;
}

.message.ai .message-content {
  background: rgba(143, 115, 255, 0.1);
  border-color: rgba(143, 115, 255, 0.2);
  border-bottom-right-radius: 0;
}

.chat-input-wrapper {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 1rem;
  background: linear-gradient(to top, #0f0f19 90%, transparent);
  z-index: 10;
}

.chat-input-container {
  display: flex;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  padding: 0.5rem;
  border-radius: 1.5rem;
  border: 1px solid rgba(143, 115, 255, 0.2);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  align-items: flex-end;
  transition: all 0.3s ease;
}

.chat-input-container:focus-within {
  border-color: rgba(143, 115, 255, 0.5);
  box-shadow: 0 0 20px rgba(143, 115, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
}

#imagePrompt {
  flex: 1;
  background: transparent;
  border: none;
  color: white;
  padding: 0.8rem 1rem;
  font-size: 1rem;
  resize: none;
  max-height: 150px;
  outline: none;
}

.send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #8f73ff;
  border: none;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.send-btn:hover:not(:disabled) {
  background: #7a5cf0;
  transform: scale(1.05);
}

.send-btn:disabled {
  background: #4b5563;
  cursor: not-allowed;
  opacity: 0.5;
}

.quick-prompts-chat {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.quick-prompt-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #d1d5db;
  padding: 0.4rem 0.8rem;
  border-radius: 1rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.quick-prompt-btn:hover {
  background: rgba(143, 115, 255, 0.2);
  border-color: rgba(143, 115, 255, 0.3);
  color: white;
}

/* Generated Image in Chat */
.chat-image-wrapper {
  position: relative;
  margin-top: 0.5rem;
  border-radius: 0.5rem;
  overflow: hidden;
  max-width: 100%;
}

.chat-image {
  width: 100%;
  height: auto;
  border-radius: 0.5rem;
  display: block;
  cursor: zoom-in;
  transition: transform 0.3s;
}

.chat-image:hover {
  transform: scale(1.01);
}

.chat-image-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.chat-action-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  padding: 0.4rem 0.8rem;
  border-radius: 0.5rem;
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: background 0.2s;
}

.chat-action-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}


.quick-prompt-btn:hover {
  background: rgba(143, 115, 255, 0.2);
  border-color: rgba(143, 115, 255, 0.4);
  transform: translateY(-1px);
}

.generator-output-section {
  background: rgba(15, 15, 25, 0.6);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(143, 115, 255, 0.2);
  border-radius: 1rem;
  padding: 2rem;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.image-placeholder {
  text-align: center;
  color: #6b7280;
}

.placeholder-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

@media (max-width: 768px) {
  .chat-interface {
    height: calc(100vh - 70px);
  }

  .chat-messages {
    padding: 0.5rem;
    padding-bottom: 80px;
    gap: 0.8rem;
  }

  .message {
    max-width: 95%;
    gap: 0.5rem;
  }

  .message-avatar {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }

  .message-content {
    padding: 0.75rem;
    font-size: 0.9rem;
    border-radius: 0.8rem;
  }

  .chat-input-wrapper {
    padding: 0.6rem;
    background: linear-gradient(to top, #0f0f19 95%, transparent);
  }

  .chat-input-container {
    padding: 0.35rem;
    border-radius: 1rem;
    gap: 0.4rem;
  }

  .send-btn {
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
  }

  #imagePrompt {
    padding: 0.65rem 0.75rem;
    font-size: 0.9rem;
  }

  .quick-prompts-chat {
    gap: 0.4rem;
    margin-top: 0.75rem;
  }

  .quick-prompt-btn {
    padding: 0.35rem 0.7rem;
    font-size: 0.85rem;
    border-radius: 0.8rem;
  }

  .loading-square {
    width: 90px;
    height: 90px;
  }

  .loading-percent {
    font-size: 1.8rem;
  }

  .loading-label {
    font-size: 0.75rem;
  }

  .chat-image-wrapper {
    margin-top: 0.4rem;
  }

  .chat-action-btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }
}

/* Image Upscaler Styles */
.upload-area {
  margin-top: 1.5rem;
  padding: 3rem 2rem;
  border: 2px dashed rgba(143, 115, 255, 0.4);
  border-radius: 1rem;
  background: rgba(143, 115, 255, 0.05);
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.upload-area:hover {
  border-color: rgba(143, 115, 255, 0.6);
  background: rgba(143, 115, 255, 0.1);
  transform: translateY(-2px);
}

.upload-area.drag-over {
  border-color: #8f73ff;
  background: rgba(143, 115, 255, 0.15);
  transform: scale(1.02);
}

.upload-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.upload-text {
  font-size: 1.1rem;
  color: #e5e7eb;
  margin-bottom: 0.5rem;
}

.upload-hint {
  font-size: 0.9rem;
  color: #9ca3af;
}

.upload-trigger-btn {
  width: 100%;
  padding: 0.8rem 1.5rem;
  background: rgba(143, 115, 255, 0.2);
  border: 1px solid rgba(143, 115, 255, 0.3);
  border-radius: 1rem;
  color: white;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.upload-trigger-btn:hover {
  background: rgba(143, 115, 255, 0.3);
  border-color: rgba(143, 115, 255, 0.5);
  transform: translateY(-1px);
}

.image-comparison {
  margin: 1rem 0 0.5rem 0;
  padding: 0.5rem 1rem;
  background: rgba(143, 115, 255, 0.1);
  border-radius: 0.5rem;
  border-right: 3px solid #8f73ff;
}

.comparison-label {
  font-size: 0.9rem;
  color: #d1d5db;
  font-weight: 500;
}

@media (max-width: 768px) {
  .upload-area {
    padding: 2rem 1rem;
  }

  .upload-icon {
    font-size: 2.5rem;
  }

  .upload-text {
    font-size: 1rem;
  }

  .upload-hint {
    font-size: 0.85rem;
  }

  .upload-trigger-btn {
    padding: 0.7rem 1.2rem;
    font-size: 0.95rem;
  }
}

/* Comparison Slider Styles */
.comparison-slider {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  border-radius: 0.5rem;
  margin-top: 1rem;
  cursor: ew-resize;
  user-select: none;
}

.comparison-image {
  width: 100%;
  height: auto;
  display: block;
  pointer-events: none;
}

.comparison-image.before {
  position: relative;
}

.comparison-image.after {
  position: absolute;
  top: 0;
  left: 0;
  clip-path: inset(0 50% 0 0);
  transition: clip-path 0.1s ease;
}

.comparison-slider-line {
  position: absolute;
  top: 0;
  left: 50%;
  width: 4px;
  height: 100%;
  background: linear-gradient(to bottom,
      rgba(143, 115, 255, 0.8),
      rgba(143, 115, 255, 1),
      rgba(143, 115, 255, 0.8));
  transform: translateX(-50%);
  cursor: ew-resize;
  z-index: 10;
  box-shadow: 0 0 10px rgba(143, 115, 255, 0.5);
}

.slider-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  background: rgba(143, 115, 255, 0.95);
  border: 3px solid white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: white;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  cursor: ew-resize;
}

@media (max-width: 768px) {
  .slider-handle {
    width: 35px;
    height: 35px;
    font-size: 1rem;
  }

  .comparison-slider-line {
    width: 3px;
  }
}

/* New Loading Square Animation */
.loading-square-container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  width: 100%;
}

.loading-square {
  width: 120px;
  height: 120px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 1rem;
  border: 1px solid rgba(143, 115, 255, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
  
}

.loading-percent {
  font-size: 2.5rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 0 10px rgba(143, 115, 255, 0.8);
  font-family: 'Outfit', sans-serif;
}

.loading-label {
  font-size: 0.8rem;
  color: #cfc3ff;
  margin-top: 0.5rem;
  font-weight: 500;
}

@keyframes pulse-glow {
  0% {
    box-shadow: 0 0 0 0 rgba(143, 115, 255, 0.4);
    transform: scale(1);
    border-color: rgba(143, 115, 255, 0.3);
  }

  50% {
    box-shadow: 0 0 20px 0 rgba(143, 115, 255, 0.6);
    transform: scale(1.02);
    border-color: rgba(143, 115, 255, 0.8);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(143, 115, 255, 0.4);
    transform: scale(1);
    border-color: rgba(143, 115, 255, 0.3);
  }
}

/* Glassmorphism for messages */
.message-content {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.message.user .message-content {
  background: rgba(143, 115, 255, 0.15);
  border-color: rgba(143, 115, 255, 0.3);
  box-shadow: 0 0 15px rgba(143, 115, 255, 0.1);
}

.message.ai .message-content {
  background: rgba(143, 115, 255, 0.1);
  border-color: rgba(143, 115, 255, 0.2);
}

.image-loading-container {
  color: #8f73ff;
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-height: 300px;
}

.loading-animation {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  z-index: 2;
}

.loading-circle {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #8f73ff;
  animation: bounce 0.5s alternate infinite;
}

.loading-circle:nth-child(2) {
  animation-delay: 0.1s;
  background: #b9a8ff;
}

.loading-circle:nth-child(3) {
  animation-delay: 0.2s;
  background: #cfc3ff;
}

@keyframes bounce {
  from {
    transform: translateY(0);
    opacity: 0.6;
  }

  to {
    transform: translateY(-15px);
    opacity: 1;
  }
}

.loading-progress {
  font-size: 3rem;
  font-weight: 800;
  color: white;
  text-shadow: 0 0 20px rgba(143, 115, 255, 0.8);
  margin-bottom: 0.5rem;
  z-index: 2;
  font-family: monospace;
}

.loading-text {
  font-size: 1.1rem;
  color: #cfc3ff;
  z-index: 2;
}

/* Image Zoom Modal */
.image-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.image-modal.show {
  opacity: 1;
}

.image-modal.closing {
  opacity: 0;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
}

.modal-content-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  z-index: 10;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

.modal-image-container {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-image {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 1rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.modal-watermark {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 2rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.7);
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.8);
  pointer-events: none;
  user-select: none;
  font-family: 'Outfit', sans-serif;
  letter-spacing: 2px;
}

.image-wrapper img {
  cursor: zoom-in;
  transition: transform 0.3s;
}

.image-wrapper img:hover {
  transform: scale(1.02);
}

@media (max-width: 768px) {
  .modal-close {
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
  }

  .modal-watermark {
    font-size: 1.5rem;
    bottom: 1.5rem;
  }

  .modal-content-wrapper {
    padding: 1rem;
  }
}

.matrix-effect {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  opacity: 0.3;
  pointer-events: none;
  z-index: 1;
}

.matrix-effect span {
  position: absolute;
  top: -20px;
  opacity: 0;
}

@keyframes matrix-fall {
  to {
    transform: translateY(400px);
    opacity: 0;
  }
}

.pulse-effect {
  animation: pulse-expand 0.8s ease-out;
}

@keyframes pulse-expand {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(143, 115, 255, 0.7);
  }

  50% {
    transform: scale(1.02);
    box-shadow: 0 0 20px 10px rgba(143, 115, 255, 0);
  }

  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(143, 115, 255, 0);
  }
}

.result-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  animation: fadeIn 0.5s ease-out;
}

.image-wrapper {
  position: relative;
  width: 100%;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.watermark {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.5);
  font-size: 1.5rem;
  font-weight: bold;
  font-family: 'Outfit', sans-serif;
  pointer-events: none;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  letter-spacing: 2px;
  z-index: 10;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#generatedImage {
  max-width: 100%;
  max-height: 600px;
  border-radius: 0.5rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(143, 115, 255, 0.2);
}

.image-actions {
  display: flex;
  gap: 1rem;
}

.action-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 0.6rem 1.2rem;
  border-radius: 0.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s;
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.hidden {
  display: none !important;
}

/* AI Chat Modal - ChatGPT Style Dark Theme */
.ai-chat-modal {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.ai-chat-modal.hidden {
  display: none;
}

.ai-chat-container {
  width: 100%;
  max-width: 900px;
  height: 85vh;
  max-height: 750px;
  background: #0a0a0a;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.7);
  border: 1px solid #1a1a1a;
}

.ai-chat-header {
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 100%);
  border-bottom: 1px solid #2a2a2a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 12px 12px 0 0;
}

.ai-chat-header-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.ai-chat-avatar {
  position: relative;
  width: 42px;
  height: 42px;
}

.ai-avatar-icon {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #6c4cf5 0%, #8f73ff 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 4px 12px rgba(91, 61, 245, 0.3);
}

.ai-avatar-status {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 14px;
  height: 14px;
  background: #10b981;
  border: 2px solid #0a0a0a;
  border-radius: 50%;
  animation: pulse-status 2s ease-in-out infinite;
}

@keyframes pulse-status {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.6;
  }
}

.ai-chat-title-section {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.ai-chat-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #ffffff;
  margin: 0;
}

.ai-chat-subtitle {
  font-size: 0.8rem;
  color: #9ca3af;
  margin: 0;
}

.ai-chat-close {
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  color: #9ca3af;
  font-size: 1.5rem;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-chat-close:hover {
  background: #1f1f1f;
  color: #ffffff;
}

.ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  background: #0a0a0a;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.ai-chat-messages::-webkit-scrollbar {
  width: 8px;
}

.ai-chat-messages::-webkit-scrollbar-track {
  background: #0a0a0a;
}

.ai-chat-messages::-webkit-scrollbar-thumb {
  background: #2a2a2a;
  border-radius: 4px;
}

.ai-chat-messages::-webkit-scrollbar-thumb:hover {
  background: #3a3a3a;
}

.ai-message-wrapper {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  animation: slideIn 0.3s ease-out;
}

.user-message-wrapper {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  justify-content: flex-end;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ai-message-avatar,
.user-message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.ai-message-avatar {
  background: linear-gradient(135deg, #6c4cf5 0%, #8f73ff 100%);
  box-shadow: 0 2px 8px rgba(91, 61, 245, 0.3);
}

.user-message-avatar {
  background: linear-gradient(135deg, #8f73ff 0%, #60a5fa 100%);
  box-shadow: 0 2px 8px rgba(143, 115, 255, 0.3);
}

.ai-message-content,
.user-message-content {
  max-width: 75%;
  display: flex;
  flex-direction: column;
}

.ai-message-text {
  background: #1a1a1a;
  color: #e5e7eb;
  padding: 0.9rem 1.1rem;
  border-radius: 12px;
  border-top-left-radius: 4px;
  font-size: 0.95rem;
  line-height: 1.6;
  border: 1px solid #2a2a2a;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.user-message-text {
  background: linear-gradient(135deg, #6c4cf5 0%, #7a5cf0 100%);
  color: #ffffff;
  padding: 0.9rem 1.1rem;
  border-radius: 12px;
  border-top-right-radius: 4px;
  font-size: 0.95rem;
  line-height: 1.6;
  box-shadow: 0 2px 8px rgba(91, 61, 245, 0.2);
  white-space: pre-wrap;
  word-wrap: break-word;
}

.typing-dots {
  display: flex;
  gap: 4px;
  padding: 1rem 1.2rem;
  background: #1a1a1a;
  border-radius: 12px;
  border-top-left-radius: 4px;
  border: 1px solid #2a2a2a;
}

.typing-dots span {
  width: 8px;
  height: 8px;
  background: #6b7280;
  border-radius: 50%;
  animation: typing-bounce 1.4s infinite ease-in-out both;
}

.typing-dots span:nth-child(1) {
  animation-delay: -0.32s;
}

.typing-dots span:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes typing-bounce {

  0%,
  80%,
  100% {
    transform: scale(0.8);
    opacity: 0.5;
  }

  40% {
    transform: scale(1.2);
    opacity: 1;
  }
}

.ai-chat-input-container {
  padding: 1.25rem 1.5rem;
  background: #0f0f0f;
  border-top: 1px solid #2a2a2a;
  border-radius: 0 0 12px 12px;
}

.ai-chat-input-wrapper {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
  background: #1a1a1a;
  border: 1.5px solid #2a2a2a;
  border-radius: 12px;
  padding: 0.5rem 0.75rem;
  transition: border-color 0.2s;
}

.ai-chat-input-wrapper:focus-within {
  border-color: #6c4cf5;
  box-shadow: 0 0 0 3px rgba(91, 61, 245, 0.1);
}

.ai-chat-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 0.95rem;
  line-height: 1.5;
  resize: none;
  outline: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  max-height: 150px;
  min-height: 24px;
}

.ai-chat-input::placeholder {
  color: #6b7280;
}

.ai-send-btn {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #6c4cf5 0%, #7a5cf0 100%);
  border: none;
  border-radius: 8px;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.ai-send-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(91, 61, 245, 0.4);
}

.ai-send-btn:active {
  transform: scale(0.95);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .ai-chat-container {
    max-width: 100%;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }

  .ai-chat-header {
    border-radius: 0;
  }

  .ai-chat-input-container {
    border-radius: 0;
  }

  .ai-chat-messages {
    padding: 1rem;
  }

  .ai-message-content,
  .user-message-content {
    max-width: 85%;
  }
}

/* Tool button style update */
.tool-cta {
  cursor: pointer;
}

.tool-cta:not([href]) {
  text-decoration: none;
}

/* --- Desktop Tools Special Design --- */
.desktop-tools-section {
  display: none;
  padding: 60px 20px;
  background: #09090b;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.desktop-section-title {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 40px;
  background: linear-gradient(135deg, #fff, #a1a1aa);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.desktop-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
}

/* Initial clean state */
.desktop-tool-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  /* More subtle initially */
  border-radius: 20px;
  padding: 40px 30px;
  /* More breathing room */
  text-decoration: none;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  /* Bouncy spring */
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 20px;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

/* Stunning Glow on Hover */
.desktop-tool-card:hover {
  transform: translateY(-10px) scale(1.02);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(143, 115, 255, 0.6);
  box-shadow:
    0 20px 50px -12px rgba(143, 115, 255, 0.3),
    0 0 20px rgba(143, 115, 255, 0.2),
    /* Inner glow illusion */
    inset 0 0 2px rgba(255, 255, 255, 0.2);
}

/* Click Interaction */
.desktop-tool-card:active {
  transform: scale(0.96);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  transition: all 0.1s ease;
}

/* Dynamic Glow Border Element */
.desktop-tool-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 20px;
  padding: 2px;
  background: linear-gradient(45deg, transparent, rgba(143, 115, 255, 0.3), transparent);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.desktop-tool-card:hover::before {
  opacity: 1;
}

.desktop-tool-card .dt-icon {
  font-size: 4rem;
  /* Larger icon */
  margin-bottom: 15px;
  filter: drop-shadow(0 0 15px rgba(143, 115, 255, 0.2));
  transition: all 0.4s ease;
}

/* Icon Animation */
.desktop-tool-card:hover .dt-icon {
  transform: scale(1.15) rotate(5deg);
  filter: drop-shadow(0 0 25px rgba(143, 115, 255, 0.6));
}

.desktop-tool-card .dt-info h3 {
  color: #fff;
  font-size: 1.4rem;
  margin-bottom: 8px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.dt-tag {
  font-size: 0.75rem;
  padding: 6px 14px;
  border-radius: 99px;
  background: linear-gradient(90deg, rgba(143, 115, 255, 0.1), rgba(236, 72, 153, 0.1));
  color: #cfc3ff;
  border: 1px solid rgba(143, 115, 255, 0.2);
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Visibility Control */
@media (min-width: 1024px) {
  .desktop-tools-section {
    display: block !important;
  }
}

@media (max-width: 1023px) {
  .desktop-tools-section {
    display: none !important;
  }
}