:root {
  --primary: #0f766e;
  --primary-dark: #115e59;
  --secondary: #1e293b;
  --accent: #f59e0b;
  --bg-light: #f8fafc;
  --white: #ffffff;
  --text-dark: #0f172a;
  --text-muted: #475569;
  --border: #e2e8f0;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-light);
  color: var(--text-dark);
  line-height: 1.6;
}

.urdu-text {
  font-family: 'Noto Nastaliq Urdu', 'Jameel Noori Nastaleeq', serif;
  direction: rtl;
  line-height: 2;
}

/* Header & Navigation */
header {
  background-color: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.logo {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo span {
  background: var(--primary);
  color: var(--white);
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  font-size: 1.2rem;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  align-items: center;
  flex-wrap: wrap;
}

nav a {
  text-decoration: none;
  color: var(--text-dark);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s;
}

nav a:hover, nav a.active {
  color: var(--primary);
}

.btn {
  display: inline-block;
  padding: 0.65rem 1.35rem;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  font-size: 0.95rem;
  transition: all 0.2s;
  text-align: center;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--white) !important;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  transform: translateY(-1px);
}

.btn-outline {
  background-color: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background-color: var(--primary);
  color: var(--white);
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, #0f766e 0%, #1e293b 100%);
  color: var(--white);
  padding: 4rem 1.5rem;
  text-align: center;
}

.hero-content {
  max-width: 850px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 2.6rem;
  font-weight: 800;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.hero p {
  font-size: 1.15rem;
  color: #e2e8f0;
  margin-bottom: 2rem;
}

.hero-cta-group {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-hero {
  background-color: var(--accent);
  color: #0f172a;
  font-size: 1.1rem;
  padding: 0.85rem 2rem;
  font-weight: 700;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4);
}

.btn-hero:hover {
  background-color: #fbbf24;
  transform: translateY(-2px);
}

/* Container & Sections */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.section-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.section-header h2 {
  font-size: 2rem;
  color: var(--secondary);
  margin-bottom: 0.5rem;
}

.section-header p {
  color: var(--text-muted);
  max-width: 650px;
  margin: 0 auto;
}

/* Category Filter Tabs */
.filter-bar {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.filter-btn {
  padding: 0.5rem 1.1rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text-muted);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn.active, .filter-btn:hover {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

/* Template Grid */
.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.template-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s;
}

.template-card:hover {
  transform: translateY(-4px);
}

.template-preview {
  padding: 1.25rem;
  min-height: 210px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.badge-lang {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 0.7rem;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  font-weight: 600;
}

.template-info {
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex-grow: 1;
  justify-content: space-between;
}

.template-info h3 {
  font-size: 1.05rem;
  color: var(--text-dark);
}

.template-info p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Content Sections (400+ Words SEO/Guide Content) */
.content-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2.5rem;
  margin-bottom: 2.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.content-section h2 {
  font-size: 1.65rem;
  color: var(--primary-dark);
  margin-bottom: 1rem;
  border-bottom: 2px solid #ccfbf1;
  padding-bottom: 0.5rem;
}

.content-section h3 {
  font-size: 1.2rem;
  color: var(--secondary);
  margin: 1.25rem 0 0.5rem;
}

.content-section p {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.feature-box {
  background: var(--bg-light);
  padding: 1.25rem;
  border-radius: 8px;
  border-left: 4px solid var(--primary);
}

.steps-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.step-card {
  background: var(--bg-light);
  padding: 1.25rem;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.step-num {
  display: inline-block;
  width: 30px;
  height: 30px;
  background: var(--primary);
  color: var(--white);
  border-radius: 50%;
  text-align: center;
  line-height: 30px;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.examples-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.example-box {
  background: #f1f5f9;
  padding: 1.25rem;
  border-radius: 8px;
  border: 1px dashed #94a3b8;
  font-size: 0.9rem;
}

.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-q {
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 0.4rem;
}

.faq-a {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Feedback Form */
.feedback-form {
  display: grid;
  gap: 1rem;
  max-width: 600px;
}

.feedback-form input, .feedback-form textarea, .feedback-form select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
}

/* Footer */
footer {
  background-color: var(--secondary);
  color: #cbd5e1;
  padding: 3rem 1.5rem 1.5rem;
  margin-top: 4rem;
}

.footer-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid #334155;
}

.footer-col h4 {
  color: var(--white);
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  margin-bottom: 0.5rem;
}

.footer-col a {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.9rem;
}

.footer-col a:hover {
  color: var(--white);
  text-decoration: underline;
}

.footer-bottom {
  max-width: 1200px;
  margin: 1.5rem auto 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
  color: #94a3b8;
}

.cf-badge {
  background: #334155;
  color: #f8fafc;
  padding: 0.35rem 0.8rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.8rem;
}

/* Editor Specific Layout */
.editor-workspace {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 900px) {
  .editor-workspace {
    grid-template-columns: 1fr;
  }
}

.editor-controls {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.control-group {
  margin-bottom: 1.1rem;
}

.control-group label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 0.35rem;
  color: var(--text-dark);
}

.control-group input, .control-group textarea, .control-group select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.92rem;
  font-family: inherit;
}

.template-switcher-bar {
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.template-menu-pills {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tpl-pill {
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: var(--white);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.tpl-pill:hover, .tpl-pill.active {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

.canvas-container {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
}

#ad-poster {
  width: 100%;
  max-width: 540px;
  min-height: 620px;
  border-radius: 12px;
  padding: 2.25rem;
  box-shadow: 0 10px 25px rgba(0,0,0,0.12);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  transition: all 0.25s ease;
}