/* ==========================================================================
   Muneeb Composing - Roman Urdu to Urdu Converter Design System
   Website: muneebcomposing.com
   Primary Theme: Deep Green (#0f766e) & Accent Gold (#f59e0b)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Noto+Naskh+Arabic:wght@400;600;700&family=Noto+Nastaliq+Urdu:wght@400;600;700&family=Poppins:wght@500;600;700&display=swap');

:root {
  /* Color Palette - Light Mode */
  --primary: #0f766e;
  --primary-hover: #0d9488;
  --primary-dark: #042f2e;
  --primary-light: #ccfbf1;
  --accent: #f59e0b;
  --accent-hover: #d97706;
  --accent-light: #fef3c7;
  
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-inverse: #ffffff;
  
  --border: #e2e8f0;
  --border-focus: #0f766e;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-gold: 0 4px 14px 0 rgba(245, 158, 11, 0.35);

  --font-sans: 'Inter', 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-urdu-nastaliq: 'Noto Nastaliq Urdu', 'Jameel Noori Nastaliq', 'Urdu Typesetting', serif;
  --font-urdu-naskh: 'Noto Naskh Arabic', 'Segoe UI', sans-serif;

  --radius-sm: 0.375rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-full: 9999px;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

/* Dark Theme Overrides */
[data-theme="dark"] {
  --bg-main: #0f172a;
  --bg-card: #1e293b;
  --bg-subtle: #334155;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  
  --border: #334155;
  --border-focus: #14b8a6;
  
  --primary-light: #134e4a;
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3);
  --shadow-lg: 0 10px 25px -3px rgb(0 0 0 / 0.4);
}

/* Reset & Base Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Layout Elements */
.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header & Navigation */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background-color var(--transition-normal);
}

[data-theme="dark"] .header {
  background-color: rgba(30, 41, 59, 0.92);
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.5rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 700;
  font-size: 1.35rem;
}

.logo-icon {
  width: 2.6rem;
  height: 2.6rem;
  background: linear-gradient(135deg, var(--primary), #042f2e);
  color: #ffffff;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-urdu-nastaliq);
  font-size: 1.4rem;
  box-shadow: var(--shadow-md);
  border: 2px solid var(--accent);
}

.logo-text span {
  color: var(--primary);
}

[data-theme="dark"] .logo-text span {
  color: #14b8a6;
}

.logo-tag {
  font-size: 0.7rem;
  background-color: var(--accent-light);
  color: #b45309;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-left: 0.4rem;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  list-style: none;
}

.nav-link {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color var(--transition-fast);
  padding: 0.4rem 0;
  position: relative;
}

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

[data-theme="dark"] .nav-link:hover, [data-theme="dark"] .nav-link.active {
  color: #14b8a6;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--primary);
  border-radius: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.theme-toggle-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-main);
  width: 2.6rem;
  height: 2.6rem;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.theme-toggle-btn:hover {
  background: var(--border);
  transform: rotate(15deg);
}

.mobile-nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 1.5rem;
  cursor: pointer;
}

/* Ad Placement Placeholder Styling */
.ad-container {
  width: 100%;
  margin: 1.5rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-subtle);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 0.5rem;
  position: relative;
  overflow: hidden;
}

.ad-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.25rem;
}

.ad-slot-header {
  min-height: 90px;
  max-width: 728px;
}

.ad-slot-inline {
  min-height: 250px;
  max-width: 336px;
}

.ad-slot-below-tool {
  min-height: 90px;
  width: 100%;
  max-width: 970px;
}

/* Main Hero & Tool Section */
.hero-section {
  padding: 2.5rem 0 1.5rem 0;
  text-align: center;
}

.hero-title {
  font-size: clamp(1.8rem, 4vw, 2.75rem);
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.25;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.hero-title span {
  color: var(--primary);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 760px;
  margin: 0 auto 2rem auto;
}

/* Converter Tool Component */
.converter-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  margin-bottom: 2.5rem;
}

.tool-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background-color: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.control-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.font-select, .font-size-slider {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.font-select:focus {
  border-color: var(--primary);
}

.converter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 380px;
}

@media (max-width: 868px) {
  .converter-grid {
    grid-template-columns: 1fr;
  }
}

.panel {
  display: flex;
  flex-direction: column;
  position: relative;
}

.panel-input {
  border-right: 1px solid var(--border);
}

@media (max-width: 868px) {
  .panel-input {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background-color: rgba(0, 0, 0, 0.02);
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

[data-theme="dark"] .panel-header {
  background-color: rgba(255, 255, 255, 0.02);
}

.converter-textarea {
  width: 100%;
  height: 100%;
  min-height: 280px;
  padding: 1.25rem;
  border: none;
  outline: none;
  resize: vertical;
  background-color: transparent;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 1.1rem;
  line-height: 1.7;
}

.output-textarea {
  direction: rtl;
  text-align: right;
  font-family: var(--font-urdu-nastaliq);
  font-size: 1.6rem;
  line-height: 2.2;
}

.panel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background-color: var(--bg-subtle);
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.action-buttons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  box-shadow: var(--shadow-md);
}

.btn-accent {
  background-color: var(--accent);
  color: #0f172a;
}

.btn-accent:hover {
  background-color: var(--accent-hover);
  box-shadow: var(--shadow-gold);
}

.btn-outline {
  background-color: transparent;
  border-color: var(--border);
  color: var(--text-main);
}

.btn-outline:hover {
  background-color: var(--bg-subtle);
  border-color: var(--text-muted);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

.keyboard-drawer {
  background-color: var(--bg-subtle);
  border-top: 1px solid var(--border);
  padding: 1rem 1.25rem;
  display: none;
}

.keyboard-drawer.open {
  display: block;
}

.keyboard-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  direction: rtl;
}

.key-btn {
  font-family: var(--font-urdu-nastaliq);
  font-size: 1.25rem;
  padding: 0.3rem 0.75rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.key-btn:hover {
  background-color: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* Content Sections */
.section {
  padding: 4rem 0;
}

.section-alt {
  background-color: var(--bg-card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 3rem auto;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.75rem;
}

.section-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
}

/* Feature Cards Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.75rem;
}

.feature-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}

.feature-icon {
  width: 3.25rem;
  height: 3.25rem;
  background-color: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
}

[data-theme="dark"] .feature-icon {
  color: #14b8a6;
}

.feature-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

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

/* Steps Process Section */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  position: relative;
}

.step-card {
  background-color: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  position: relative;
}

.step-num {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--border);
}

.step-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--primary);
}

/* Table Styling */
.table-wrapper {
  overflow-x: auto;
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  margin: 2rem 0;
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.custom-table th, .custom-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.custom-table th {
  background-color: var(--bg-subtle);
  font-weight: 700;
  color: var(--text-main);
}

.custom-table tr:last-child td {
  border-bottom: none;
}

.urdu-cell {
  font-family: var(--font-urdu-nastaliq);
  font-size: 1.4rem;
  direction: rtl;
  text-align: right;
  color: var(--primary);
}

[data-theme="dark"] .urdu-cell {
  color: #14b8a6;
}

/* FAQ Accordion */
.faq-grid {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.faq-item {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--transition-fast);
}

.faq-question {
  padding: 1.25rem;
  font-weight: 600;
  font-size: 1.05rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

.faq-question::after {
  content: '+';
  font-size: 1.4rem;
  color: var(--primary);
  transition: transform var(--transition-fast);
}

.faq-item.active .faq-question::after {
  content: '-';
  transform: rotate(180deg);
}

.faq-answer {
  padding: 0 1.25rem 1.25rem 1.25rem;
  color: var(--text-muted);
  display: none;
  line-height: 1.7;
}

.faq-item.active .faq-answer {
  display: block;
}

/* Blog Article Styles */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
}

.blog-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.blog-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.blog-card-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.blog-meta {
  font-size: 0.8rem;
  color: var(--accent-hover);
  font-weight: 600;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

.blog-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.blog-title a {
  text-decoration: none;
  color: var(--text-main);
  transition: color var(--transition-fast);
}

.blog-title a:hover {
  color: var(--primary);
}

.blog-excerpt {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

.article-container {
  max-width: 840px;
  margin: 2rem auto;
  background-color: var(--bg-card);
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}

.article-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.5rem;
  margin-bottom: 2rem;
}

.article-title {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 1rem;
}

.article-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 2rem 0 1rem 0;
  color: var(--primary);
}

[data-theme="dark"] .article-content h2 {
  color: #14b8a6;
}

.article-content h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 1.5rem 0 0.75rem 0;
}

.article-content p {
  margin-bottom: 1.25rem;
  font-size: 1.05rem;
  color: var(--text-main);
}

.article-content ul, .article-content ol {
  margin: 1rem 0 1.5rem 1.5rem;
}

.article-content li {
  margin-bottom: 0.5rem;
}

/* Footer */
.footer {
  background-color: #042f2e;
  color: #94a3b8;
  padding: 4rem 0 2rem 0;
  margin-top: auto;
  border-top: 3px solid var(--accent);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 2.5rem;
  margin-bottom: 3rem;
}

@media (max-width: 868px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 540px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

.footer-brand p {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: #cbd5e1;
}

.footer-title {
  color: #ffffff;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 1.25rem;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.65rem;
}

.footer-links a {
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  background-color: var(--text-main);
  color: var(--bg-main);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: slideIn 0.3s ease forwards;
}

@keyframes slideIn {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Cookie Banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: var(--bg-card);
  border-top: 2px solid var(--primary);
  box-shadow: var(--shadow-lg);
  padding: 1.25rem;
  z-index: 9998;
  display: none;
}

.cookie-content {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.cookie-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 800px;
}

.cookie-actions {
  display: flex;
  gap: 0.75rem;
}

/* Responsive Mobile Navigation */
@media (max-width: 768px) {
  .nav-menu {
    position: fixed;
    top: 4.5rem;
    left: 0;
    width: 100%;
    background-color: var(--bg-card);
    flex-direction: column;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    display: none;
  }
  .nav-menu.open {
    display: flex;
  }
  .mobile-nav-toggle {
    display: block;
  }
}
