/* -----------------------------------------------------------
   NEW Enhanced Light Theme — Romantic, Soft, Premium (Restored Colors)
----------------------------------------------------------- */

:root {
  /* Restored Original Romantic Palette */
  --bg-gradient: linear-gradient(145deg, #fffaf5 0%, #fdf2ea 40%, #f7e9e1 100%);
  --bg-card: rgba(255, 255, 255, 0.75);
  --bg-card-hover: rgba(255, 255, 255, 0.95);
  
  --border-light: rgba(255, 255, 255, 0.6);
  --border-hover: rgba(231, 166, 133, 0.3);

  --text-main: #2c2520;
  --text-muted: #7b726c;
  --text-accent: #d98c66;

  --accent: #e7a685;
  --accent-strong: #d98c66;
  --accent-light: #f8e8df;

  /* Modernized Shadows & Radius from Cursor Style */
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.02), 0 1px 2px rgba(0,0,0,0.03);
  --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.05);
  --shadow-hover: 0 20px 40px rgba(217, 140, 102, 0.15); /* Warm shadow */

  --radius-xl: 16px;
  --radius-lg: 12px;
  --radius-md: 8px;

  --transition: 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Background */
body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg-gradient);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

/* Header (Glass Style) */
header {
  position: sticky;
  top: 0;
  backdrop-filter: blur(20px);
  background: rgba(255, 255, 255, 0.65);
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
  padding: 16px 24px;
  z-index: 99;
  transition: 0.3s;
}

.nav {
  max-width: 1200px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: "Playfair Display", serif; /* Restored serif for logo */
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

/* Navigation Link */
.nav-links a {
  margin-left: 24px;
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  transition: 0.2s;
}

.nav-links .btn-secondary {
  margin-left: 32px;
  padding: 10px 20px;
  font-size: 0.9rem;
}

.nav-links a:not(.btn-secondary):not(.btn-primary):hover {
  color: var(--accent-strong);
}

/* Buttons - Modern Structure, Original Colors */
.btn-primary {
  background: linear-gradient(135deg, #c8a2c8 0%, #b19cd9 100%);
  color: white;
  padding: 14px 32px;
  border-radius: 12px;
  border: none;
  box-shadow: 0 4px 14px rgba(200, 162, 200, 0.4);
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  font-size: 1rem;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(177, 156, 217, 0.5);
}

.btn-secondary {
  background: transparent;
  color: var(--accent-strong);
  padding: 13px 28px;
  border-radius: 12px;
  border: 1px solid var(--accent-strong);
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-secondary:hover {
  background: var(--accent-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(230, 150, 120, 0.2);
}

/* Sections */
.section {
  max-width: 1200px;
  margin: auto;
  padding: 40px 24px;
}

.kicker {
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent-strong);
  margin-bottom: 12px;
  background: rgba(231, 166, 133, 0.15);
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
}

.subtle-text {
  color: var(--text-muted);
  font-size: 1.125rem;
  line-height: 1.7;
  max-width: 42rem;
}

/* HERO */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  padding: 60px 40px;
  margin-top: 40px;
  background: linear-gradient(rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.75)), url('../images/hero.jpg');
  background-size: cover;
  background-position: center;
  border-radius: 24px;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border-light);
}

.hero-center {
  display: flex;
  flex-direction: column;
  text-align: center;
  justify-content: center;
  grid-template-columns: none;
}

.hero-center > div {
  max-width: 800px;
  margin: 0 auto;
}

.hero-title {
  font-size: 3.5rem;
  line-height: 1.1;
  font-weight: 800;
  background: linear-gradient(120deg, #c27955, #e7a685);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 24px;
  letter-spacing: -0.03em;
}

.hero-img {
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  background: transparent;
}

.hero-img img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  display: block;
}

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    padding: 40px 24px;
  }
  .hero-title {
    font-size: 2.5rem;
  }
}

/* FEATURE CARDS */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: var(--shadow-soft);
  transition: var(--transition);
  backdrop-filter: blur(12px);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  background: var(--bg-card-hover);
}

.feature-icon {
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.5);
  color: var(--accent-strong);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  margin-bottom: 20px;
  font-size: 0.9rem;
  border: 1px solid rgba(231, 166, 133, 0.3);
}

.feature-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-main);
}

.feature-card p {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.6;
  margin: 0;
}


/* HOW IT WORKS */
.how-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: 40px;
}

.how-card {
  background: var(--bg-card);
  padding: 28px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-light);
  transition: var(--transition);
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(14px);
}

.how-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  background: var(--bg-card-hover);
}

.how-number {
  width: 36px;
  height: 36px;
  background: var(--accent-light);
  color: var(--accent-strong);
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 16px;
  border: 1px solid rgba(231, 166, 133, 0.2);
}

.how-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.how-card p {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0;
}


/* EXAMPLE POEMS */
.example-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 0;
  margin-top: 40px;
  align-items: stretch;
  background: white;
  border-radius: 24px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  transition: var(--transition);
}

.example-grid:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.poem-box {
  background: white;
  padding: 48px;
  border: none;
  box-shadow: none;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.poem-box:hover {
  transform: none;
  box-shadow: none;
}

.example-img {
  border: none;
  padding: 0;
  border-radius: 0;
  background: #fdf2ea; /* Match soft bg tone */
  box-shadow: none;
  position: relative;
  overflow: hidden;
}

.example-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  transition: transform 0.5s ease;
}

.example-grid:hover .example-img img {
  transform: scale(1.03);
}

/* Responsive adjustment for Example Grid */
@media (max-width: 860px) {
  .example-grid {
    grid-template-columns: 1fr;
  }
  .example-img {
    height: 300px;
  }
}

/* TESTIMONIALS */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 40px;
}

.testimonial-card {
  background: var(--bg-card);
  padding: 32px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-soft);
  transition: var(--transition);
}

.testimonial-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  background: var(--bg-card-hover);
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-card-hover);
  overflow: hidden;
  margin-bottom: 16px;
  border: 2px solid white;
  box-shadow: var(--shadow-soft);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}


/* FAQ */
.faq-item {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  padding: 24px 32px;
  box-shadow: var(--shadow-soft);
  transition: var(--transition);
  margin-bottom: 16px;
}

.faq-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  background: var(--bg-card-hover);
}

.faq-q {
  font-size: 1.1rem;
  color: var(--text-main);
  margin-bottom: 8px;
}

.faq-a {
  color: var(--text-muted);
}


/* CTA */
.cta-box {
  background: linear-gradient(rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.6)), url('../images/cta.jpg');
  background-size: cover;
  background-position: center;
  color: var(--text-main);
  padding: 80px 32px;
  border-radius: 24px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

.cta-title {
  color: var(--text-main);
  font-size: 2.5rem;
  margin-bottom: 16px;
  font-family: "Playfair Display", serif;
}

.cta-box p {
  color: var(--text-muted);
  font-size: 1.2rem;
  max-width: 600px;
  margin: 0 auto 32px auto;
}

.cta-box .btn-primary {
  /* Inherit original btn-primary style */
}


/* FOOTER */
footer {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
  font-size: 0.95rem;
  background: transparent;
  border-top: 1px solid var(--border-light);
  margin-top: 60px;
}

/* SEO Content Section */
.seo-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 80px 24px;
  color: var(--text-main);
}

.seo-content h2 {
  font-family: "Playfair Display", serif;
  font-weight: 700;
  font-size: 1.8rem;
  color: var(--text-main);
  margin-top: 48px;
  margin-bottom: 20px;
}

.seo-content p {
  line-height: 1.8;
  color: var(--text-muted);
  margin-bottom: 24px;
  font-size: 1.05rem;
}

.seo-content li {
  margin-bottom: 12px;
  line-height: 1.7;
  color: var(--text-muted);
}

/* INTERNAL LINKS SECTION */
.internal-links {
  margin: 80px auto;
  padding: 50px 30px;
  background: #faf6f8;
  border-radius: 24px;
  max-width: 1200px;
}

.internal-links h2 {
  font-size: 2rem;
  margin-bottom: 16px;
  font-family: "Playfair Display", serif;
  font-weight: 700;
  text-align: center;
}

.internal-links-text {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 700px;
  margin: 0 auto 40px auto;
  text-align: center;
}

.internal-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.internal-card {
  display: block;
  text-decoration: none;
  padding: 24px;
  border-radius: 16px;
  background: white;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
  border: 1px solid #eee;
}

.internal-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.internal-card h3 {
  margin: 0 0 10px 0;
  color: #d46a84;
  font-weight: 600;
  font-size: 1.1rem;
}

.internal-card p {
  margin: 0;
  color: #444;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Responsive */
@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
  }
  .features-grid, .testimonials-grid, .how-grid {
    grid-template-columns: 1fr;
  }
  /* .example-grid is already handled in its own section above */
}

/* Studio Layout */
.studio-options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  background: white;
  padding: 16px 20px;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  margin-bottom: 24px;
}

.option-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto; /* Don't grow */
}

.option-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0;
  white-space: nowrap;
}

.option-group select,
.option-group input {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  font-size: 0.9rem;
  min-width: 120px;
  max-width: 160px;
  width: auto;
  background: #f9f9f9;
  height: 38px;
  color: var(--text-main);
  outline: none;
  transition: all 0.2s ease;
}

.option-group input:hover,
.option-group select:hover {
  background: #fff;
  border-color: #d0d0d0;
}

.option-group input:focus,
.option-group select:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(231, 166, 133, 0.15);
}

.btn-generate {
  padding: 0 20px;
  height: 38px;
}

.btn-generate.ready {
  background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
  box-shadow: 0 4px 14px rgba(76, 175, 80, 0.4);
  animation: pulse 2s infinite;
}

.btn-generate.ready:hover {
  background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%);
  box-shadow: 0 8px 24px rgba(76, 175, 80, 0.5);
}

@keyframes pulse {
  0% { box-shadow: 0 4px 14px rgba(76, 175, 80, 0.4); }
  50% { box-shadow: 0 4px 20px rgba(76, 175, 80, 0.6); }
  100% { box-shadow: 0 4px 14px rgba(76, 175, 80, 0.4); }
}

.btn-generate.loading {
  background: linear-gradient(135deg, #ffa726 0%, #ff9800 100%);
  box-shadow: 0 4px 14px rgba(255, 167, 38, 0.4);
  animation: loading-pulse 1.5s infinite;
}

@keyframes loading-pulse {
  0% { opacity: 1; }
  50% { opacity: 0.7; }
  100% { opacity: 1; }
}

.loading-placeholder {
  color: var(--accent-strong);
  font-style: italic;
  text-align: center;
  padding: 40px 20px;
  animation: fade-in-out 2s infinite;
}

@keyframes fade-in-out {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* Enhanced editing styles */
.result-title:focus {
  outline: none;
  border-bottom: 2px solid var(--accent);
  background: rgba(231, 166, 133, 0.05);
  border-radius: 4px 4px 0 0;
  padding: 4px 8px;
}

.result-content:focus {
  outline: none;
  background: rgba(231, 166, 133, 0.03);
  border: 2px solid var(--accent-light);
  border-radius: 8px;
}

.result-title:empty:before {
  content: "Click to edit title...";
  color: var(--text-muted);
  font-style: italic;
}

.result-content:empty:before {
  content: "Your generated poem will appear here...";
  color: var(--text-muted);
  font-style: italic;
}

/* Touch-friendly interactions */
@media (hover: none) and (pointer: coarse) {
  /* Touch devices */
  .btn-primary,
  .btn-secondary,
  .btn-sm {
    min-height: 44px; /* iOS recommended touch target size */
    padding: 12px 20px;
  }
  
  .btn-generate {
    min-height: 48px;
    font-size: 1.1rem;
  }
  
  select {
    min-height: 44px;
    padding: 12px 16px;
    font-size: 16px; /* Prevents zoom on iOS */
  }
  
  .result-title,
  .result-content {
    min-height: 44px;
    padding: 12px;
  }
  
  /* Larger tap targets for mobile */
  .result-actions .btn-sm {
    min-height: 48px;
    padding: 14px 20px;
  }
  
  /* Remove hover effects on touch devices */
  .btn-primary:hover,
  .btn-secondary:hover,
  .btn-sm:hover,
  .feature-card:hover {
    transform: none;
  }
  
  /* Add active states for touch feedback */
  .btn-primary:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
  }
  
  .btn-secondary:active,
  .btn-sm:active {
    transform: scale(0.96);
    transition: transform 0.1s ease;
  }
}
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(231, 166, 133, 0.3);
  letter-spacing: 0.02em;
  margin-left: auto; /* Push to right if needed, or keep inline */
}

.result-area {
  background: white;
  border-radius: 16px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-soft);
  padding: 32px;
  margin-top: 24px;
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid #eee;
  padding-bottom: 16px;
}

.result-header h3 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--text-main);
  outline: none;
  border-bottom: 1px dashed transparent;
}

.result-header h3:focus {
  border-bottom-color: var(--accent-light);
}

.result-actions {
  display: flex;
  gap: 8px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.85rem;
  border-radius: 6px;
  border: 1px solid var(--border-light);
  background: white;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-sm:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-light);
}

.result-content {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  line-height: 1.8;
  color: var(--text-main);
  white-space: pre-wrap;
  min-height: 100px;
  outline: none;
  padding: 8px;
  border-radius: 4px;
}

.result-content:focus {
  background: #fafafc;
}

@media (max-width: 768px) {
  .result-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
}

/* =========================
   Poem Studio (Workspace)
   ========================= */

.studio-hero{
  padding-top: 32px;
  padding-bottom: 12px;
}

.studio-title{
  font-family: "Playfair Display", serif;
  font-size: clamp(28px, 3vw, 36px);
  line-height: 1.05;
  margin: 8px 0 8px;
}

.studio-subtitle{
  max-width: 760px;
  font-size: 1rem;
  line-height: 1.5;
  margin-bottom: 12px;
}

.studio-steps{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.step-pill{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.55);
  border: 1px solid rgba(214,186,166,0.35);
  color: rgba(60,45,40,0.78);
  font-size: 12px;
}

.step-num{
  width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 11px;
  background: rgba(210, 160, 125, 0.25);
  color: rgba(90,60,45,0.9);
}

.section.studio{
  padding-top: 12px;
  padding-bottom: 60px;
}

.studio-panel{
  background: white;
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
}

/* (Removed duplicate definitions) */

.studio-status{
  min-height: 20px;
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 13px;
  padding-left: 4px;
}

/* Result */
.result-area{
  margin-top: 24px;
  background: white;
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
}

.result-header{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  border-bottom: 1px solid #f0f0f0;
  padding-bottom: 20px;
}

.result-kicker{
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-strong);
  margin-bottom: 8px;
  font-weight: 700;
}

.result-title{
  margin: 0;
  font-family: "Playfair Display", serif;
  font-size: 28px;
  line-height: 1.2;
  color: var(--text-main);
  outline: none;
}

.result-title:focus {
  border-bottom: 1px dashed var(--accent);
}

.result-actions{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.btn-sm{
  height: 36px;
  padding: 0 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid #eee;
  background: white;
  color: var(--text-muted);
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
  transition: all 0.2s ease;
  min-width: 80px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.btn-sm:hover {
  transform: translateY(-1px);
  border-color: var(--accent-light);
  color: var(--text-main);
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.btn-weak {
  background: transparent;
  border: 1px solid #ddd;
  color: #999;
}
.btn-weak:hover {
  border-color: #bbb;
  color: #555;
  background: #f5f5f5;
  box-shadow: none;
}

.btn-strong {
  background: var(--accent);
  color: white;
  border: none;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(231, 166, 133, 0.4);
}
.btn-strong:hover {
  background: var(--accent-strong);
  color: white;
  box-shadow: 0 4px 12px rgba(231, 166, 133, 0.5);
  border: none;
}

.result-actions .btn-primary{
  background: linear-gradient(135deg, #c8a2c8 0%, #b19cd9 100%);
  color: white;
  border: none;
  box-shadow: 0 4px 10px rgba(200, 162, 200, 0.3);
}

.result-actions .btn-primary:hover{
  background: linear-gradient(135deg, #b19cd9 0%, #9a7bc8 100%);
  box-shadow: 0 6px 14px rgba(177, 156, 217, 0.4);
}

.result-content{
  min-height: 200px;
  padding: 10px;
  line-height: 1.8;
  font-size: 18px;
  color: #4a4a4a;
  font-family: "Playfair Display", serif;
  outline: none;
  white-space: pre-wrap;
  border-radius: 8px;
}

.result-content:focus{
  background: #fffaf5;
}

/* Toast */
.toast{
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%) translateY(20px);
  background: #333;
  color: white;
  padding: 12px 20px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  z-index: 1000;
}
.toast.show{
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Responsive Design - Mobile First Approach */

/* Tablet and smaller desktop (768px and below) */
@media (max-width: 768px) {
  .section {
    padding: 24px 16px;
  }
  
  .hero {
    padding: 32px 20px;
    gap: 40px;
  }
  
  .hero-title {
    font-size: 2.2rem;
  }
  
  .features-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .how-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  
  .feature-card {
    padding: 24px;
  }
}

/* Mobile landscape and small tablets (640px and below) */
@media (max-width: 640px) {
  .nav {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
  
  .nav-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
  }
  
  .nav-links a {
    margin-left: 0;
  }
  
  .hero-title {
    font-size: 1.8rem;
  }
  
  .how-grid {
    grid-template-columns: 1fr;
  }
  
  .studio-steps {
    flex-direction: column;
    gap: 8px;
  }
  
  .step-pill {
    width: 100%;
    justify-content: flex-start;
  }
}

/* Studio-specific responsive design */
@media (max-width: 900px) {
  .studio-options {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }
  
  .option-group {
    width: 100%;
  }
  
  .option-group.horizontal {
    flex-direction: column;
    align-items: stretch;
  }
  
  .option-group label {
    margin-bottom: 8px;
    font-weight: 600;
  }
  
  .btn-generate {
    width: 100%;
    margin-top: 16px;
    padding: 16px 32px;
    font-size: 1.1rem;
  }
  
  .result-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  
  .result-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 12px;
  }
  
  .btn-sm {
    flex: 1;
    min-width: 120px;
  }
}

/* Mobile portrait (480px and below) */
@media (max-width: 480px) {
  .section {
    padding: 20px 12px;
  }
  
  .hero {
    padding: 24px 16px;
  }
  
  .hero-title {
    font-size: 1.6rem;
    line-height: 1.2;
  }
  
  .studio-panel {
    padding: 20px 16px;
  }
  
  .result-area {
    padding: 20px 16px;
  }
  
  .result-title {
    font-size: 1.2rem;
  }
  
  .result-content {
    font-size: 1rem;
    line-height: 1.6;
  }
  
  .btn-primary {
    padding: 12px 24px;
    font-size: 0.95rem;
  }
  
  .btn-sm {
    padding: 10px 16px;
    font-size: 0.85rem;
    min-width: 100px;
  }
  
  .toast {
    left: 12px;
    right: 12px;
    transform: none;
    max-width: none;
  }
}

/* Extra small devices (360px and below) */
@media (max-width: 360px) {
  .hero-title {
    font-size: 1.4rem;
  }
  
  .studio-panel {
    padding: 16px 12px;
  }
  
  .result-area {
    padding: 16px 12px;
  }
  
  .btn-generate {
    padding: 14px 20px;
  }
  
  .result-actions {
    flex-direction: column;
  }
  
  .btn-sm {
    width: 100%;
    margin-bottom: 8px;
  }
}

/* Accessibility Styles */

/* Screen reader only content */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus indicators for keyboard navigation */
*:focus {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
}

/* Enhanced focus styles for interactive elements */
button:focus,
select:focus,
[contenteditable]:focus,
[tabindex]:focus {
  outline: 3px solid var(--accent-strong);
  outline-offset: 2px;
  box-shadow: 0 0 0 1px rgba(217, 140, 102, 0.3);
}

/* Skip link for keyboard users */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--accent-strong);
  color: white;
  padding: 8px;
  text-decoration: none;
  border-radius: 4px;
  z-index: 1000;
  transition: top 0.3s;
}

.skip-link:focus {
  top: 6px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --text-main: #000000;
    --text-muted: #333333;
    --accent: #0066cc;
    --accent-strong: #004499;
    --bg-card: #ffffff;
    --border-light: #666666;
  }
  
  .btn-primary {
    background: #0066cc;
    border: 2px solid #004499;
  }
  
  .btn-secondary {
    background: #ffffff;
    border: 2px solid #0066cc;
    color: #0066cc;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .btn-primary:hover,
  .btn-secondary:hover,
  .feature-card:hover {
    transform: none;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-gradient: linear-gradient(145deg, #1a1a1a 0%, #2d2d2d 40%, #3a3a3a 100%);
    --bg-card: rgba(255, 255, 255, 0.1);
    --bg-card-hover: rgba(255, 255, 255, 0.15);
    --text-main: #f0f0f0;
    --text-muted: #b0b0b0;
    --border-light: rgba(255, 255, 255, 0.2);
  }
  
  .studio-panel,
  .result-area {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
  }
}

/* Keyboard navigation enhancements */
.option-group select:focus {
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 3px rgba(217, 140, 102, 0.3);
}

/* Ensure interactive elements are properly sized for accessibility */
button,
select,
[contenteditable],
[tabindex] {
  min-height: 44px;
}

/* Improve text readability */
.result-content,
.result-title {
  line-height: 1.6;
}

/* Status and live region styling */
[aria-live] {
  font-weight: 500;
}

[role="alert"] {
  font-weight: 600;
}
