/* =========================================================
   ONLINE GENERATOR TOOLS — VIP PROFESSIONAL DESIGN SYSTEM
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #f7f5f0;
  --bg-card: #ffffff;
  --text: #111827;
  --text-secondary: #4b5563;
  --muted: #9ca3af;
  --border: #e5e1d8;
  --border-light: #f0ece4;
  --primary: #f59e0b;
  --primary-hover: #d97706;
  --primary-soft: #fffbeb;
  --accent: #ea580c;
  --blue: #2563eb;
  --blue-soft: #eff6ff;
  --green: #059669;
  --green-soft: #ecfdf5;
  --purple: #7c3aed;
  --purple-soft: #f5f3ff;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow: 0 4px 20px rgba(0,0,0,0.06);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.1);
  --shadow-glow: 0 0 0 4px rgba(245,158,11,0.15);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.otg-home-wrap,
.otg-tool-wrapper,
.otg-category-page,
.otg-wrapper {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background: var(--bg);
}

/* ========== HERO ========== */
.otg-hero {
  background: 
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(245,158,11,0.12), transparent),
    linear-gradient(180deg, #fffdf8 0%, var(--bg) 100%);
  padding: 56px 20px 48px;
  text-align: center;
  border-bottom: 1px solid var(--border-light);
  position: relative;
  overflow: hidden;
}

.otg-hero-inner {
  max-width: 680px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.otg-logo-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: white;
  border: 1px solid var(--border);
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  letter-spacing: -0.01em;
}

.otg-hero-title {
  font-size: clamp(1.85rem, 5vw, 2.75rem);
  font-weight: 800;
  margin: 0 0 14px;
  letter-spacing: -0.035em;
  line-height: 1.15;
  color: var(--text);
}

.otg-hero-title span {
  background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.otg-hero-sub {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin: 0 auto 32px;
  max-width: 520px;
  font-weight: 400;
}

/* ========== LIVE SEARCH ========== */
.otg-search-box {
  position: relative;
  max-width: 580px;
  margin: 0 auto;
}

.otg-search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  opacity: 0.5;
  pointer-events: none;
  z-index: 2;
}

.otg-live-search {
  width: 100%;
  padding: 18px 56px 18px 52px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  font-size: 1.05rem;
  font-family: inherit;
  background: white;
  box-shadow: var(--shadow);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  color: var(--text);
}

.otg-live-search::placeholder { color: var(--muted); }

.otg-live-search:focus {
  border-color: var(--primary);
  box-shadow: var(--shadow), var(--shadow-glow);
}

.otg-kbd {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 4px 9px;
  font-size: 0.72rem;
  color: var(--muted);
  font-family: inherit;
  font-weight: 500;
  pointer-events: none;
}

.otg-search-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 10px);
  background: white;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  max-height: 420px;
  overflow-y: auto;
  z-index: 200;
  text-align: left;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.18s, transform 0.18s, visibility 0.18s;
}

.otg-search-results.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.otg-search-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 18px;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid var(--border-light);
  transition: background 0.12s;
}

.otg-search-item:last-child { border-bottom: none; }
.otg-search-item:hover,
.otg-search-item:focus {
  background: var(--primary-soft);
  outline: none;
}

.otg-search-item-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--primary-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.otg-search-item strong {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.otg-search-item span {
  font-size: 0.8rem;
  color: var(--muted);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

.otg-search-empty {
  padding: 32px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}

/* ========== LAYOUT ========== */
.otg-layout {
  display: grid;
  grid-template-columns: 270px 1fr;
  gap: 32px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 36px 24px 80px;
}

/* ========== SIDEBAR ========== */
.otg-sidebar {
  position: sticky;
  top: 24px;
  align-self: start;
  height: fit-content;
}

.otg-sidebar-inner {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.otg-sidebar-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 14px;
}

.otg-cat-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.otg-cat-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 11px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
}

.otg-cat-link:hover {
  background: var(--primary-soft);
  color: var(--accent);
}

.otg-cat-icon {
  font-size: 1.2rem;
  width: 26px;
  text-align: center;
  line-height: 1;
}

.otg-cat-name { flex: 1; }

.otg-cat-count {
  font-size: 0.72rem;
  background: #f3f4f6;
  color: var(--muted);
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
}

.otg-side-popular {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.otg-side-tool {
  display: block;
  padding: 8px 12px;
  border-radius: 9px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition);
  font-weight: 500;
}

.otg-side-tool:hover {
  background: var(--primary-soft);
  color: var(--accent);
}

/* ========== MAIN + SECTION ========== */
.otg-main { min-width: 0; }

.otg-section-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.otg-section-icon {
  width: 52px;
  height: 52px;
  background: linear-gradient(145deg, #f59e0b, #f97316);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
  box-shadow: 0 6px 18px rgba(245,158,11,0.35);
  flex-shrink: 0;
}

.otg-section-head h2 {
  font-size: 1.45rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.025em;
}

.otg-section-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ========== TOOL CARDS ========== */
.otg-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 18px;
}

.otg-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  position: relative;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.otg-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #f59e0b, #f97316);
  opacity: 0;
  transition: opacity var(--transition);
}

.otg-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: #fcd34d;
}

.otg-card:hover::before { opacity: 1; }

.otg-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--primary-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  margin-bottom: 14px;
  transition: transform var(--transition);
}

.otg-card:hover .otg-card-icon {
  transform: scale(1.08);
}

.otg-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}

.otg-card h3 {
  font-size: 1rem;
  font-weight: 650;
  margin: 0;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.otg-card-desc {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 14px;
  flex-grow: 1;
  line-height: 1.5;
}

.otg-card-arrow {
  align-self: flex-end;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #f9fafb;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 1rem;
  transition: all var(--transition);
}

.otg-card:hover .otg-card-arrow {
  background: var(--primary);
  color: white;
  transform: translateX(2px);
}

.otg-pill {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.otg-pill-popular {
  background: var(--blue-soft);
  color: var(--blue);
}

.otg-pill-new {
  background: var(--green-soft);
  color: var(--green);
}

.otg-pill-count {
  background: #f3f4f6;
  color: var(--muted);
}

/* Category cards special */
.otg-cat-card .otg-card-icon {
  background: var(--purple-soft);
}

/* ========== TOOL PAGE ========== */
.otg-tool-wrapper {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 16px 80px;
}

.otg-tool-header {
  text-align: center;
  margin-bottom: 32px;
}

.otg-tool-title {
  font-size: 1.85rem;
  font-weight: 750;
  margin: 0 0 10px;
  letter-spacing: -0.03em;
}

.otg-tool-desc {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 520px;
  margin: 0 auto;
}

.otg-tool-body {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}

.otg-tool-footer {
  text-align: center;
  margin-top: 24px;
  color: var(--muted);
  font-size: 0.875rem;
}

/* ========== FORMS ========== */
.otg-textarea,
.otg-input,
.otg-select {
  width: 100%;
  padding: 13px 15px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  margin-bottom: 14px;
  transition: border-color var(--transition), box-shadow var(--transition);
  font-family: inherit;
  background: white;
  color: var(--text);
}

.otg-textarea:focus,
.otg-input:focus,
.otg-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
}

.otg-textarea {
  min-height: 160px;
  resize: vertical;
  line-height: 1.55;
}

.otg-label {
  display: block;
  font-weight: 600;
  margin-bottom: 7px;
  font-size: 0.875rem;
  color: var(--text);
}

.otg-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.otg-row > * {
  flex: 1;
  min-width: 130px;
}

.otg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  background: linear-gradient(145deg, #f59e0b, #f97316);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  font-family: inherit;
  letter-spacing: -0.01em;
}

.otg-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(245,158,11,0.4);
}

.otg-btn:active { transform: translateY(0); }

.otg-btn-secondary {
  background: #f3f4f6;
  color: var(--text);
}

.otg-btn-secondary:hover {
  background: #e5e7eb;
  box-shadow: none;
  transform: none;
}

.otg-result {
  margin-top: 20px;
  padding: 18px;
  background: var(--primary-soft);
  border: 1px solid #fde68a;
  border-radius: 12px;
  font-size: 1.05rem;
  font-weight: 600;
  text-align: center;
  display: none;
  line-height: 1.5;
}

.otg-result.show { display: block; animation: otgFadeIn 0.25s ease; }

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

.otg-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
  font-size: 0.875rem;
}

.otg-stat {
  background: #f3f4f6;
  padding: 7px 13px;
  border-radius: 8px;
  font-weight: 500;
}

.otg-stat b { font-weight: 700; color: var(--text); }

.otg-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.otg-output {
  margin-top: 14px;
  padding: 16px;
  background: #f9fafb;
  border-radius: 10px;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 48px;
  font-size: 0.95rem;
  line-height: 1.5;
  border: 1px solid var(--border-light);
}

.otg-qr-preview {
  text-align: center;
  margin-top: 24px;
}

.otg-qr-preview canvas {
  border-radius: 14px;
  box-shadow: var(--shadow);
  max-width: 260px;
}

.otg-color-swatch {
  width: 58px;
  height: 58px;
  border-radius: 12px;
  border: 3px solid white;
  box-shadow: 0 3px 12px rgba(0,0,0,0.15);
  display: inline-block;
  vertical-align: middle;
  margin-right: 14px;
}

/* ========== MOBILE ========== */
@media (max-width: 960px) {
  .otg-layout {
    grid-template-columns: 1fr;
    padding: 24px 16px 60px;
    gap: 24px;
  }
  .otg-sidebar {
    position: static;
    order: 2;
  }
  .otg-sidebar-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }
  .otg-main { order: 1; }
}

@media (max-width: 640px) {
  .otg-hero { padding: 36px 16px 32px; }
  .otg-hero-title { font-size: 1.6rem; }
  .otg-hero-sub { font-size: 0.95rem; }
  .otg-tools-grid { grid-template-columns: 1fr; gap: 14px; }
  .otg-sidebar-inner { grid-template-columns: 1fr; }
  .otg-tool-body { padding: 20px; }
  .otg-row { flex-direction: column; }
  .otg-kbd { display: none; }
  .otg-live-search { padding: 16px 18px 16px 48px; font-size: 1rem; }
  .otg-section-head h2 { font-size: 1.25rem; }
  .otg-card { padding: 18px; }
}

/* Focus visible for a11y */
.otg-card:focus-visible,
.otg-cat-link:focus-visible,
.otg-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.otg-hidden { display: none !important; }

/* Generic tool (for all remaining tools — clean, no errors) */
.otg-generic-tool {
  max-width: 100%;
}
.otg-generic-header {
  text-align: center;
  margin-bottom: 20px;
}
.otg-generic-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
}
.otg-generic-note {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
}

/* Extra polish */
.otg-card h3 {
  font-weight: 650;
}
.otg-tool-body {
  position: relative;
}
.otg-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* =====================================================
   TOOL PAGE — PROFESSIONAL INTERFACE
   ===================================================== */

.otg-tool-wrapper {
  max-width: 680px;
  margin: 0 auto;
  padding: 40px 16px 80px;
}

.otg-tool-header {
  text-align: center;
  margin-bottom: 28px;
}

.otg-tool-icon-lg {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  background: linear-gradient(145deg, #fff7ed, #ffedd5);
  border: 1px solid #fed7aa;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  box-shadow: 0 4px 16px rgba(245,158,11,0.12);
}

.otg-tool-title {
  font-size: 1.75rem;
  font-weight: 750;
  margin: 0 0 8px;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.25;
}

.otg-tool-desc {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 480px;
  margin: 0 auto 12px;
  line-height: 1.5;
}

.otg-tool-cat-link {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--primary-soft);
  transition: background 0.15s;
}

.otg-tool-cat-link:hover {
  background: #ffedd5;
}

.otg-tool-body {
  background: white;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.05);
}

.otg-tool-footer {
  text-align: center;
  margin-top: 24px;
}

.otg-trust-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.otg-trust-badges span {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: white;
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}

/* Form polish inside tools */
.otg-tool-body .otg-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.otg-tool-body .otg-input,
.otg-tool-body .otg-textarea,
.otg-tool-body .otg-select {
  border-radius: 12px;
  border: 1.5px solid var(--border);
  padding: 14px 16px;
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.otg-tool-body .otg-input:focus,
.otg-tool-body .otg-textarea:focus,
.otg-tool-body .otg-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(245,158,11,0.12);
}

.otg-tool-body .otg-btn {
  border-radius: 12px;
  padding: 14px 28px;
  font-size: 0.95rem;
  font-weight: 600;
}

.otg-tool-body .otg-result {
  border-radius: 14px;
  padding: 18px 20px;
  font-size: 1.05rem;
  margin-top: 20px;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid #fde68a;
}

.otg-tool-body .otg-stats {
  gap: 8px;
}

.otg-tool-body .otg-stat {
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 0.875rem;
}

.otg-tool-body .otg-actions {
  gap: 10px;
  margin-top: 8px;
}

.otg-tool-body .otg-output {
  border-radius: 12px;
  border: 1px solid var(--border-light);
  background: #fafafa;
  padding: 16px;
}

/* Homepage extra polish */
.otg-hero {
  position: relative;
}

.otg-hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

.otg-card {
  border-radius: 18px;
}

.otg-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  font-size: 1.4rem;
}

.otg-section-icon {
  border-radius: 16px;
}

/* Mobile tool page */
@media (max-width: 640px) {
  .otg-tool-wrapper {
    padding: 28px 14px 60px;
  }
  .otg-tool-body {
    padding: 20px;
    border-radius: 16px;
  }
  .otg-tool-title {
    font-size: 1.45rem;
  }
  .otg-tool-icon-lg {
    width: 60px;
    height: 60px;
    font-size: 1.7rem;
    border-radius: 16px;
  }
  .otg-trust-badges span {
    font-size: 0.75rem;
    padding: 5px 10px;
  }
}
