/* ==============================================================================
   otoUP - Modern Production SaaS Stylesheet
   Designed for High Performance, Core Web Vitals, Mobile First, and Dark/Light Modes
   ============================================================================== */

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-bengali: 'Hind Siliguri', 'Inter', sans-serif;
  
  /* Color Palette - Light Mode */
  --bg-primary: #f8fafc;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-input: #f8fafc;
  --border-color: #e2e8f0;
  --border-focus: #2563eb;
  
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-border: #bfdbfe;
  
  --success-color: #10b981;
  --success-light: #ecfdf5;
  --danger-color: #ef4444;
  --danger-light: #fef2f2;
  --warning-color: #f59e0b;
  
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
  --shadow-glow: 0 0 20px rgba(37, 99, 235, 0.15);
}

[data-theme="dark"] {
  --bg-primary: #0b0f19;
  --bg-surface: #111827;
  --bg-card: #1f2937;
  --bg-input: #0b0f19;
  --border-color: #374151;
  --border-focus: #3b82f6;
  
  --text-primary: #f9fafb;
  --text-secondary: #d1d5db;
  --text-muted: #9ca3af;
  
  --primary-color: #3b82f6;
  --primary-hover: #60a5fa;
  --primary-light: rgba(59, 130, 246, 0.15);
  --primary-border: #1e3a8a;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.25);
}

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

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

body {
  width: 100%;
  overflow-x: hidden;
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-content {
  flex: 1;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ==============================================================================
   Header & Navigation
   ============================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background-color 0.2s, border-color 0.2s;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  gap: 1.5rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.45rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.brand-name span {
  color: var(--primary-color);
}

.header-center {
  flex: 1;
  max-width: 520px;
}

.global-search-wrapper {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 44px;
  padding: 0 1rem 0 2.75rem;
  background-color: var(--bg-input);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s ease;
}

.search-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-light);
  background-color: var(--bg-surface);
}

.search-suggestions {
  position: absolute;
  top: 50px;
  left: 0;
  right: 0;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 420px;
  overflow-y: auto;
  z-index: 200;
}

.suggestion-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.25rem;
  text-decoration: none;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.15s;
}

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

.suggestion-item:hover {
  background-color: var(--primary-light);
}

.suggestion-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.suggestion-cat {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--primary-color);
  background: var(--primary-light);
  padding: 2px 8px;
  border-radius: 4px;
}

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

.nav-links {
  display: flex;
  gap: 1.25rem;
}

.nav-link {
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.95rem;
  transition: color 0.15s;
}

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

.lang-btn {
  text-decoration: none;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  background-color: var(--primary-light);
  color: var(--primary-color);
  border: 1px solid var(--primary-border);
  transition: all 0.15s;
}

.lang-btn:hover {
  background-color: var(--primary-color);
  color: #fff;
}

.theme-toggle {
  background: var(--bg-input);
  border: 1.5px solid var(--border-color);
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.theme-toggle:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: 1px solid var(--border-color);
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  cursor: pointer;
}

/* ==============================================================================
   Hero Section
   ============================================================================== */
.hero-section {
  padding: 5rem 0 4rem;
  background: radial-gradient(100% 100% at 50% 0%, var(--primary-light) 0%, transparent 80%);
}

.hero-title {
  font-size: 3rem;
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 1.25rem;
  letter-spacing: -0.03em;
}

.text-gradient {
  background: linear-gradient(135deg, #2563eb 0%, #10b981 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 720px;
  margin: 0 auto 2.5rem;
  line-height: 1.6;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.4rem 1.1rem;
  background-color: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  border-radius: 9999px;
  box-shadow: var(--shadow-sm);
  color: var(--text-primary);
}

.hero-search-box {
  display: flex;
  max-width: 640px;
  margin: 0 auto;
  gap: 0.65rem;
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-md);
  padding: 4px;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-color);
}

.hero-search-input {
  flex: 1;
  height: 52px;
  padding: 0 1.25rem;
  border: none;
  font-size: 1.1rem;
  outline: none;
  background: transparent;
  color: var(--text-primary);
}

.hero-search-btn {
  height: 52px;
  padding: 0 1.75rem;
  font-size: 1rem;
}

/* ==============================================================================
   Cards & Grids
   ============================================================================== */
.section {
  padding: 4rem 0;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 2.25rem;
}

.section-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-top: 0.35rem;
}

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

.tool-card {
  display: flex;
  flex-direction: column;
  background-color: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-sm);
}

.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-color);
}

.tool-card-icon {
  margin-bottom: 1rem;
}

.tool-icon-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--primary-light);
  color: var(--primary-color);
  border-radius: var(--radius-sm);
  font-weight: 800;
  font-size: 1.1rem;
}

.tool-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.45rem;
  color: var(--text-primary);
}

.tool-card-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.25rem;
}

.category-card {
  background-color: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  border-top-width: 4px;
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

.category-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.category-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-top: 0.5rem;
}

.category-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

/* ==============================================================================
   Tool Page - Main Architecture & Interface
   ============================================================================== */
.tool-page {
  padding: 2.5rem 0 5rem;
}

.tool-header {
  margin-bottom: 2rem;
}

.tool-title {
  font-size: 2.5rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}

.tool-description {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 850px;
  line-height: 1.6;
}

.tool-main-card {
  background-color: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 2.5rem;
}

.inputs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.form-label {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.form-control {
  height: 48px;
  padding: 0 1rem;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  background-color: var(--bg-input);
  color: var(--text-primary);
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: all 0.2s;
}

.form-control:focus {
  border-color: var(--border-focus);
  background-color: var(--bg-surface);
  box-shadow: 0 0 0 3px var(--primary-light);
}

textarea.form-control {
  height: auto;
  padding: 0.85rem 1rem;
  min-height: 110px;
  line-height: 1.5;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 1.75rem;
  font-weight: 700;
  font-size: 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.15s ease-in-out;
  user-select: none;
}

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

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

.btn-secondary {
  background-color: var(--bg-input);
  color: var(--text-secondary);
  border: 1.5px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: var(--border-color);
}

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

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

.btn-sm {
  height: 36px;
  padding: 0 1rem;
  font-size: 0.85rem;
}

.btn-lg {
  height: 52px;
  padding: 0 2.25rem;
  font-size: 1.1rem;
}

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

/* ==============================================================================
   Result Component
   ============================================================================== */
.result-container {
  background-color: var(--primary-light);
  border: 2px solid var(--primary-border);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  margin-top: 2rem;
  animation: fadeIn 0.25s ease-out;
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--primary-border);
}

.result-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary-color);
}

.result-hero-card {
  padding: 1rem;
}

.primary-metric {
  font-size: 2.75rem;
  font-weight: 900;
  line-height: 1.1;
  color: var(--primary-color);
  letter-spacing: -0.02em;
}

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

.metric-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.metric-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.metric-val {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
}

/* Documentation & FAQ Cards */
.doc-card {
  background-color: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.doc-card h2 {
  font-size: 1.45rem;
  font-weight: 800;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.doc-content {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.7;
}

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

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

.faq-question {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem 0;
  background: none;
  border: none;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
}

.faq-question:hover {
  color: var(--primary-color);
}

.faq-answer {
  padding-bottom: 1.25rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ==============================================================================
   Footer
   ============================================================================== */
.site-footer {
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  padding: 4rem 0 2.5rem;
  margin-top: 5rem;
}

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

.footer-desc {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin: 0.75rem 0 1.25rem;
  line-height: 1.6;
}

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

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

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.92rem;
  transition: color 0.15s;
}

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

.footer-heading {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 1.25rem;
}

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 1.75rem;
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-muted);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .header-center { display: none; }
  .mobile-menu-btn { display: flex; }
}

@media (max-width: 600px) {
  .hero-title { font-size: 2.2rem; }
  .tool-title { font-size: 1.85rem; }
  .primary-metric { font-size: 2.1rem; }
  .hero-search-box { flex-direction: column; background: transparent; border: none; box-shadow: none; padding: 0; }
  .hero-search-input { background: var(--bg-surface); border: 1.5px solid var(--border-color); border-radius: var(--radius-sm); margin-bottom: 0.5rem; }
  .footer-grid { grid-template-columns: 1fr; }
  .tool-actions { flex-direction: column; width: 100%; }
  .tool-actions .btn { width: 100%; }
}
