/* =========================================
   1. VARIABLES & RESET
   ========================================= */
:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --success: #22c55e;
  --success-dark: #16a34a;
  --bg: #f3f4f6;
  --card: #ffffff;
  --border: #e5e7eb;
  --text: #1f2937;
  --radius: 12px;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.08);
  --danger: #ef4444;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden; /* Prevents horizontal scroll on mobile */
}

/* =========================================
   2. HEADER & NAVIGATION
   ========================================= */
.header {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.header-container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

/* Logo */
.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
  cursor: pointer;
}

.logo-img {
  height: 32px;
  width: auto;
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0;
}

/* Nav Links */
.nav-links {
  display: flex;
  gap: 24px;
  align-items: center;
}

.nav-links a {
  text-decoration: none;
  color: #4b5563;
  font-weight: 600;
  font-size: 0.95rem;
  transition: color 0.2s;
  padding: 8px 12px;
  border-radius: 6px;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; /* Force system font for menu */
}

.nav-links a:hover {
  color: var(--primary);
  background: #eff6ff;
}

.nav-links a.active {
  color: var(--primary);
  background: #eef2ff;
}

/* Notification Dot */
.nav-dot {
  position: absolute;
  top: 6px;
  right: -6px;
  width: 8px;
  height: 8px;
  background-color: #ef4444;
  border-radius: 50%;
  border: 1px solid white;
  animation: nav-pulse 2s infinite;
}

@keyframes nav-pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

/* Mobile Toggle */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  color: var(--text);
}

/* =========================================
   3. MAIN LAYOUT GRID
   ========================================= */
.page-wrapper {
  display: grid;
  /* Desktop: Sidebar (300px) | Content (Auto) | Sidebar (300px) */
  grid-template-columns: 300px minmax(0, 1fr) 300px;
  gap: 24px;
  padding: 24px;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
  flex: 1;
  align-items: start;
}

.main-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

/* Side Panels (Ads) */
.side-panel {
  display: flex;
  flex-direction: column;
}

.sticky-content {
  position: sticky;
  top: 90px;
  width: 100%;
  max-width: 300px;
  height: 600px;
  background: #fff;
  border: 2px dashed #ddd;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-size: 14px;
}

/* Mobile Banner Area (Hidden on Desktop) */
.mob-banner-area {
  display: none;
  justify-content: center;
  align-items: center;
  padding: 15px 10px;
  background: #f9fafb;
  border-bottom: 1px solid var(--border);
  min-height: 100px;
  width: 100%;
  margin-bottom: 20px;
  overflow: hidden;
}

/* =========================================
   4. CONVERTER TOOLS (Home Page)
   ========================================= */
.box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.box-header {
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

textarea {
  width: 100%;
  min-height: 200px;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 16px;
  resize: vertical;
  background: #f9fafb;
  font-family: inherit;
}

textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
}

/* Controls Area */
.controls {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
}

.radio-group {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.radio-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  cursor: pointer;
}

input[type="radio"] {
  accent-color: var(--primary);
}

.btn-group {
  display: flex;
  gap: 10px;
}

/* Buttons */
button,
.btn-primary,
.btn-secondary,
.cta-button,
.download-btn,
.back-btn {
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  font-size: 0.95rem;
}

.btn-primary,
.cta-button,
.back-btn {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover,
.cta-button:hover,
.back-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.btn-secondary {
  background: #e5e7eb;
  color: #374151;
}

.copy-btn {
  background: none;
  color: #6b7280;
  padding: 4px;
}
.copy-btn:hover {
  color: var(--primary);
}

/* =========================================
   5. CONTENT COMPONENTS (FAQ, News, Features)
   ========================================= */
/* SEO Content Wrapper */
.seo-content {
  background: #fff;
  padding: 25px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  line-height: 1.6;
  color: #374151;
}

.seo-content h2 {
  color: var(--primary);
  margin-top: 0;
}

/* Warning Note */
.warning-note {
  display: flex;
  flex-direction: column; /* Better for mobile */
  gap: 8px;
  background: #fff7ed;
  border-left: 4px solid #f97316;
  color: #9a3412;
  padding: 16px;
  border-radius: 8px;
  font-size: 0.95rem;
  line-height: 1.5;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  margin-top: 20px;
}
@media (min-width: 600px) {
  .warning-note {
    flex-direction: row;
    align-items: flex-start;
  }
}

/* News Ticker */
.news-ticker {
  background: linear-gradient(to right, #fff7ed, #ffedd5);
  border-bottom: 1px solid #fed7aa;
  padding: 12px 20px;
  text-align: center;
  font-size: 0.95rem;
  color: #9a3412;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.news-badge {
  background: #ef4444;
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: bold;
  text-transform: uppercase;
}

/* FAQ Accordion */
.faq-container {
  margin-top: 20px;
}
.faq-item {
  background: #f9fafb;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 10px;
}
.faq-item[open] {
  border-color: var(--primary);
  background: #fff;
}
.faq-summary {
  padding: 15px;
  cursor: pointer;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  list-style: none;
}
.faq-summary::after {
  content: "+";
  font-size: 1.5rem;
  color: var(--primary);
}
.faq-item[open] .faq-summary::after {
  content: "-";
}
.faq-summary::-webkit-details-marker {
  display: none;
}
.faq-answer {
  padding: 15px;
  border-top: 1px solid #f3f4f6;
  color: #4b5563;
  line-height: 1.6;
}

/* Features Grid (Why Choose Us) */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 20px;
}
.feature-card {
  background: #f8fafc;
  padding: 20px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}
.feature-icon {
  color: var(--primary);
  margin-right: 8px;
  vertical-align: middle;
}

/* =========================================
   6. LEGAL PAGES (Privacy, Terms, About, Contact)
   ========================================= */
.legal-wrapper {
  max-width: 800px;
  margin: 40px auto;
  padding: 0 20px;
  min-height: 60vh;
  width: 100%;
}

.legal-box {
  background: white;
  padding: 40px;
  margin-top: 10px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  border: 1px solid #e2e8f0;
}

.legal-box h1 {
  font-size: 2rem;
  color: #1e293b;
  margin-top: 0;
  margin-bottom: 10px;
}

.legal-box h2 {
  font-size: 1.3rem;
  color: #334155;
  margin-top: 30px;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 10px;
}

.legal-box p,
.legal-box li {
  color: #475569;
  line-height: 1.7;
  margin-bottom: 15px;
}

.legal-meta {
  font-size: 0.9rem;
  color: #94a3b8 !important;
  margin-bottom: 30px !important;
}

.highlight-box {
  background: #eff6ff;
  border-left: 4px solid #3b82f6;
  padding: 20px;
  border-radius: 6px;
  margin: 20px 0;
}

/* Contact Form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 20px;
}
.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
}

/* =========================================
   7. UPDATES & GUIDELINES STYLES
   ========================================= */
/* Status Badges */
.status-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
}
.status-active {
  background-color: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}
.status-warning {
  background-color: #fff7ed;
  color: #9a3412;
  border-left: 4px solid #f97316;
  padding: 15px;
  border-radius: 4px;
  margin-bottom: 25px;
  line-height: 1.6;
}

/* Tables */
.guidelines-table {
  width: 100%;
  border-collapse: collapse;
  margin: 25px 0;
  background: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.guidelines-table th,
.guidelines-table td {
  border: 1px solid #e2e8f0;
  padding: 14px;
  text-align: left;
  vertical-align: top;
}
.guidelines-table th {
  background-color: #f8fafc;
  color: #1e293b;
  font-weight: 700;
}

/* Promo Box */
.product-promo {
  background: linear-gradient(135deg, #4f46e5 0%, #818cf8 100%);
  color: white;
  padding: 30px;
  border-radius: 12px;
  margin: 30px 0;
  text-align: center;
  box-shadow: 0 10px 25px -5px rgba(79, 70, 229, 0.4);
}
.product-badge {
  background: #fbbf24;
  color: #78350f;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  display: inline-block;
  margin-bottom: 12px;
}
.cta-btn-white {
  display: inline-block;
  background: white;
  color: #4f46e5;
  padding: 12px 24px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  margin-top: 20px;
}
.cta-btn-white:hover {
  transform: translateY(-2px);
}

/* Checklist */
.checklist {
  list-style: none;
  padding: 0;
  margin: 20px 0;
}
.checklist li {
  padding-left: 30px;
  margin-bottom: 12px;
  position: relative;
  line-height: 1.6;
}
.checklist li::before {
  content: "✔";
  position: absolute;
  left: 0;
  color: #16a34a;
  font-weight: bold;
  font-size: 1.1em;
}
.action-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  padding: 20px;
  border-radius: 8px;
  margin-top: 20px;
}

/* =========================================
   8. FONTS PAGE STYLES
   ========================================= */
.font-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 20px;
}
.font-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}
.font-preview {
  font-family: "Noto Sans Gujarati", sans-serif;
  font-size: 1.5rem;
  color: #6366f1;
  margin: 15px 0;
}
.download-btn {
  background: #ffffff;
  color: #6366f1;
  border: 1px solid #6366f1;
}
.download-btn:hover {
  background: #6366f1;
  color: white;
}

/* =========================================
   9. FOOTER
   ========================================= */
footer {
  background: #fff;
  border-top: 1px solid var(--border);
  padding: 24px;
  text-align: center;
  font-size: 0.9rem;
  color: #6b7280;
  margin-top: auto;
}
.footer-links {
  margin-top: 12px;
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}
.footer-links a {
  color: var(--primary);
  text-decoration: none;
}

/* =========================================
   10. UNIVERSAL RESPONSIVE STYLES
   ========================================= */
@media (max-width: 900px) {
  /* 1. Reset Grid to Single Column */
  .page-wrapper {
    grid-template-columns: 1fr;
    padding: 15px;
    max-width: 100%;
  }

  /* 2. Hide Sidebars / Show Mobile Banner */
  .side-panel {
    display: none !important;
  }
  .mob-banner-area {
    display: flex;
  }

  /* 3. Header & Menu */
  .mobile-toggle {
    display: block;
  }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: white;
    flex-direction: column;
    padding: 20px;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    z-index: 999;
  }
  .nav-links.mobile-open {
    display: flex;
  }
  .nav-links a {
    width: 100%;
    text-align: center;
    border: 1px solid #f3f4f6;
  }

  /* 4. Controls & Inputs */
  .controls {
    flex-direction: column;
    align-items: stretch;
  }
  .btn-group {
    justify-content: space-between;
    margin-top: 10px;
  }
  .radio-group {
    justify-content: flex-start;
  }

  /* 5. Legal Pages */
  .legal-wrapper {
    margin: 20px auto;
    padding: 0 15px;
  }
  .legal-box {
    padding: 20px;
  }
  .legal-box h1 {
    font-size: 1.5rem;
  }

  /* 6. Tables (Scroll instead of break) */
  .guidelines-table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}
/* =========================================
   11. ULTRA-SMALL DEVICES (Galaxy Fold / < 350px)
   ========================================= */
@media (max-width: 350px) {
  /* 1. Reduce Layout Padding */
  .header-container {
    padding: 10px 12px; /* Reduce header padding */
  }

  .page-wrapper {
    padding: 10px 8px; /* Almost no padding on edges */
  }

  /* 2. Shrink Logo Text */
  .logo-text {
    font-size: 1rem; /* Smaller text so it fits next to the menu button */
  }
  .logo-img {
    height: 24px; /* Smaller logo icon */
  }

  /* 3. Stack the Buttons */
  .controls {
    padding: 15px 10px;
  }

  .btn-group {
    width: 100%;
    flex-direction: column; /* Stack Clear/Convert buttons vertically */
    gap: 10px;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%; /* Full width buttons */
  }

  /* 4. Fix Radio Buttons Wrapping */
  .radio-group {
    flex-direction: column; /* Stack radio options */
    align-items: flex-start;
    width: 100%;
  }

  /* 5. Allow Tables to Scroll */
  .guidelines-table {
    font-size: 0.8rem; /* Smaller text in tables */
  }
}

/* =========================================
   12. FONTS GUIDE PAGE STYLES (FIXED)
   ========================================= */
.guide-section {
  background: #fff;
  padding: 30px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  margin-bottom: 30px;
  line-height: 1.7;
  color: #374151;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

.step-card {
  display: flex;
  gap: 15px; /* Reduced gap slightly for better look */
  align-items: flex-start; /* Forces top alignment */
  margin-bottom: 25px;
  border-bottom: 1px solid #f3f4f6;
  padding-bottom: 20px;
}
.step-card:last-child {
  border-bottom: none;
}

.step-number {
  background: #6366f1;
  color: white;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  flex-shrink: 0;

  /* FIX: Removed margin-top so it sits flush with the text */
  margin-top: 0;
  font-size: 1rem;
}

.step-content {
  /* Ensures the text container takes up remaining space */
  flex: 1;
}

.step-content h3 {
  /* FIX: Ensure no top margin exists to push text down */
  margin-top: 0;
  margin-bottom: 8px;
  color: #1f2937;
  font-size: 1.1rem;
  line-height: 1.4; /* Matches bubble height better */
}

/* Screenshot styling */
.screenshot-placeholder {
  width: 100%;
  max-width: 600px;
  height: auto; /* Changed to auto so images don't stretch */
  background: #f9fafb;
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  margin-top: 15px;
  font-size: 0.9rem;
  flex-direction: column;
  gap: 10px;
  padding: 10px; /* Added padding */
}

/* Grid Layout for Downloads */
.font-download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.font-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  padding: 25px;
  border-radius: 12px;
  text-align: center;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);

  /* Fix for flex alignment if content varies */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.font-card:hover {
  transform: translateY(-5px);
  border-color: #6366f1;
  box-shadow: 0 10px 15px rgba(99, 102, 241, 0.1);
}

.download-btn {
  display: inline-block;
  background: #6366f1;
  color: white;
  text-decoration: none;
  padding: 12px 24px;
  border-radius: 8px;
  margin-top: 15px;
  font-weight: 600;
  width: 100%;
  border: none;
  cursor: pointer;
}
.download-btn:hover {
  background: #4f46e5;
}
/* =========================================
   13. RESPONSIVE & LAYOUT FIXES
   ========================================= */
/* FIX 1: Tablet & Mobile Layout (Below 900px) */
@media (max-width: 900px) {
  /* Stack everything vertically */
  .page-wrapper,
  .two-col-layout {
    display: flex;
    flex-direction: column;
    padding: 15px;
    grid-template-columns: 1fr; /* Reset grid */
  }

  /* Hide the Sidebar (Ads) on mobile to save space */
  .side-panel {
    display: none !important;
  }

  /* Make content full width */
  .main-column {
    width: 100%;
  }

  /* Adjust internal padding */
  .guide-section,
  .font-card {
    padding: 20px;
  }
}

/* FIX 2: Small Phones (Below 480px) */
@media (max-width: 480px) {
  /* Stack the "Step 1, Step 2" cards */
  .step-card {
    flex-direction: column;
    gap: 10px;
  }

  .step-number {
    width: 30px;
    height: 30px;
    font-size: 0.9rem;
  }

  /* Stack the Download Buttons */
  .font-download-grid {
    grid-template-columns: 1fr;
  }

  /* Resize Screenshots */
  .screenshot-placeholder {
    height: 150px;
    font-size: 0.8rem;
  }
}

/* --- CUSTOM SNACKBAR (notistack clone) --- */
.custom-snackbar {
  position: fixed;
  bottom: 20px;
  left: 20px;
  padding: 12px 24px;
  border-radius: 6px;
  color: white;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 9999;
}
.custom-snackbar.show {
  transform: translateY(0);
  opacity: 1;
}
.snackbar-success {
  background-color: #4caf50;
}
.snackbar-error {
  background-color: #ef4444;
}
.snackbar-info {
  background-color: #3b82f6;
}

/* --- CUSTOM DIALOG MODALS --- */
.custom-dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.2s;
}
.custom-dialog-overlay.show {
  opacity: 1;
}
.custom-dialog-box {
  background: white;
  padding: 25px;
  border-radius: 12px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  transform: scale(0.9);
  transition: transform 0.2s;
}
.custom-dialog-overlay.show .custom-dialog-box {
  transform: scale(1);
}
.custom-dialog-title {
  margin: 0 0 10px 0;
  font-size: 1.2rem;
  color: #0f172a;
}
.custom-dialog-msg {
  margin: 0 0 20px 0;
  color: #64748b;
  font-size: 0.95rem;
  line-height: 1.5;
  white-space: pre-wrap;
}
.custom-dialog-input {
  width: 100%;
  padding: 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  margin-bottom: 20px;
  font-family: inherit;
}
.custom-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
.spin-icon {
  animation: spin 1s linear infinite;
  display: inline-block;
}


/* --- NEW STYLES FOR ANIMATIONS AND BACK BUTTON --- */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spin-icon {
  animation: spin 1s linear infinite;
  display: inline-block;
}

.btn-back {
    background: #f1f5f9;
    color: #64748b;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    cursor: pointer;
}

.btn-back:hover {
    background: #e2e8f0;
    color: #0f172a;
}