/* =========================================================
   AioGalaxy — WebTools Styles
   File: /webtools/assets/css/webtools.css
   Same design tokens as the main landing page (aiogalaxy.com)
   so both sites look like one connected product.
   ========================================================= */

:root {
  /* ---- Same palette as landing page (/assets/css/style.css) ---- */
  --bg: #FFFFFF;
  --bg-panel: #F5F6FA;
  --bg-panel-hover: #ECEEF5;
  --border: rgba(11, 13, 26, 0.09);
  --text-primary: #12141F;
  --text-muted: #5A5F79;
  --accent: #DB7F1F;
  --accent-teal: #0FA787;

  --font-display: 'Manrope', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* ---- WebTools-only tokens (sidebar now light, matches landing page) ---- */
  --sidebar-bg: #FFFFFF;
  --sidebar-bg-soft: var(--bg-panel);
  --sidebar-text: var(--text-muted);
  --sidebar-border: var(--border);

  --danger: #E23D3D;
  --success: #0FA787;
  --surface-dark: #12141F;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 28px;

  --shadow-sm: 0 1px 2px rgba(18, 20, 31, 0.04);
  --shadow-md: 0 10px 24px rgba(18, 20, 31, 0.08);
  --shadow-lg: 0 20px 40px rgba(18, 20, 31, 0.12);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.15;
  margin: 0 0 12px;
  color: var(--text-primary);
}

p { color: var(--text-muted); margin: 0 0 12px; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent-teal);
  outline-offset: 2px;
}

.eyebrow {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-teal);
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  display: block;
}

/* =========================================================
   APP SHELL — page frame that holds sidebar + main content
   ========================================================= */
.app-shell {
  display: flex;
  min-height: calc(100vh - 70px);
  width: 100%;
}

.site-footer {
  width: 100% !important;
  clear: both !important;
  position: relative !important;
  z-index: 10 !important;
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%; /* Mobile par full width */
  background: var(--bg);
}
.page-content {
  padding: 20px; /* Mobile spacing */
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* iPad aur Tablets ke liye special padding */
@media (min-width: 768px) and (max-width: 1024px) {
  .page-content { padding: 30px; }
  .tools-grid { grid-template-columns: repeat(2, 1fr); } /* iPad portrait mein 2 cards best hain */
}

@media (min-width: 1025px) {
  .page-content { padding: 40px; }
}

@media (min-width: 1024px) {
  .page-content { padding: 40px; }
}

/* =========================================================
   SIDEBAR
   ========================================================= */
.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  color: var(--sidebar-text);
  border-right: 1px solid var(--sidebar-border);
  position: sticky;
  top: 70px;
  height: calc(100vh - 70px);
  display: none;
  flex-direction: column;
  box-shadow: 1px 0 0 rgba(255, 255, 255, .7) inset, 10px 0 40px rgba(18, 20, 31, .05);
}

@media (min-width: 768px) {
  .sidebar { display: flex; }
}

@media (max-width: 767px) {
  .app-shell {
    flex-direction: column;
  }
  .sidebar {
    display: flex;
    position: fixed;
    top: 0;
    left: -100%; /* Shuru mein screen se bahar */
    bottom: 0;
    z-index: 9999;
    width: 280px;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 10px 0 30px rgba(0,0,0,0.1);
  }
  .sidebar.is-open {
    left: 0; /* Button dabane par andar aa jaye */
  }
  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(18, 20, 31, 0.4);
    backdrop-filter: blur(4px);
    z-index: 9998;
  }
  .sidebar-backdrop.is-open {
    display: block;
  }
}

.sidebar-head {
  padding: 22px 22px;
  border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17px;
  color: var(--text-primary);
}

.sidebar-brand-icon {
  background: var(--accent);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sidebar-brand-icon svg { width: 18px; height: 18px; color: #fff; }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 10px;
}

.sidebar-group { margin-bottom: 10px; }

.sidebar-group-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  margin-bottom: 4px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
}
.sidebar-group-toggle:hover {
  background: var(--bg-panel);
}
.sidebar-group-toggle:hover { background: var(--bg-panel-hover); }
.sidebar-group-toggle svg { width: 14px; height: 14px; }

.sidebar-group-arrow { transition: transform 0.2s ease; flex-shrink: 0; }
.sidebar-group.open .sidebar-group-arrow { transform: rotate(90deg); }

.sidebar-group-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}
.sidebar-group.open .sidebar-group-list { max-height: 600px; }

.sidebar-group-list li { margin-bottom: 2px; }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.2s ease;
}
.sidebar-link:hover {
  background: var(--bg-panel);
  color: var(--accent);
}
.sidebar-link:hover { background: var(--bg-panel-hover); color: var(--text-primary); }
.sidebar-link.is-active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

/* ---- Mobile top bar (shown below 768px instead of sidebar) ---- */
.mobile-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
  color: var(--text-primary);
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
@media (min-width: 768px) {
  .mobile-topbar { display: none; }
}
.mobile-topbar-brand {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--text-primary);
  font-size: 15px;
}
.mobile-menu-btn {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
}
.mobile-menu-btn svg { width: 20px; height: 20px; }

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: #c46f1a; transform: translateY(-2px); }
.btn-secondary { background: var(--bg-panel); color: var(--text-primary); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg-panel-hover); }
.btn-dark { background: var(--surface-dark); color: #fff; }
.btn-dark:hover { background: #23263a; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-block { width: 100%; }

/* =========================================================
   CARDS
   ========================================================= */
.panel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.hero-panel {
  background:
    radial-gradient(500px 260px at 10% 0%, rgba(219, 127, 31, 0.08), transparent 60%),
    radial-gradient(420px 220px at 95% 30%, rgba(15, 167, 135, 0.07), transparent 60%),
    var(--bg-panel);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius-xl);
  padding: 40px;
  position: relative;
  overflow: hidden;
}
.hero-panel p { color: var(--text-muted); }
.hero-panel h1 { color: var(--text-primary); font-size: clamp(28px, 4vw, 42px); }

.tool-card {
  display: block;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(219, 127, 31, 0.35);
}
.tool-card-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  background: rgba(219, 127, 31, 0.1);
  color: var(--accent);
}
.tool-card-icon svg { width: 19px; height: 19px; }
.tool-card h3 { font-size: 15.5px; margin-bottom: 4px; }
.tool-card p { font-size: 12.5px; margin-bottom: 10px; }
.tool-card-link {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  margin-top: 8px;
}

.tools-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 480px) { .tools-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 640px) { .tools-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .tools-grid { grid-template-columns: repeat(4, 1fr); } }

/* =========================================================
   FORMS
   ========================================================= */
.field { margin-bottom: 16px; }
.field-label {
  display: block;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.field-input,
.field-select,
.field-textarea {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-primary);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field-input:focus,
.field-select:focus,
.field-textarea:focus {
  border-color: var(--accent-teal);
  box-shadow: 0 0 0 3px rgba(15, 167, 135, 0.12);
  outline: none;
}
.field-textarea { resize: vertical; min-height: 110px; }

.field-range {
  width: 100%;
  accent-color: var(--accent);
}

/* =========================================================
   BADGES / STATUS
   ========================================================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 999px;
}
.badge-success { background: rgba(15, 167, 135, 0.12); color: var(--accent-teal); }
.badge-danger { background: rgba(226, 61, 61, 0.12); color: var(--danger); }
.badge-neutral { background: var(--bg-panel); color: var(--text-muted); }

/* =========================================================
   ALERTS / RESULT BOXES
   ========================================================= */
.alert {
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 13.5px;
  border: 1px solid transparent;
}
.alert-info { background: rgba(15, 167, 135, 0.08); color: #0b5e4c; border-color: rgba(15, 167, 135, 0.2); }
.alert-danger { background: rgba(226, 61, 61, 0.08); color: #8f1f1f; border-color: rgba(226, 61, 61, 0.2); }

/* =========================================================
   CODE / OUTPUT BOX
   ========================================================= */
.code-box {
  background: var(--surface-dark);
  color: #E5E7EB;
  border-radius: var(--radius-md);
  padding: 18px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  overflow-x: auto;
  position: relative;
}
.code-box-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}
.copy-btn {
  background: var(--accent);
  color: #fff;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
}
.copy-btn.is-copied { background: var(--accent-teal); }

/* =========================================================
   TABLES
   ========================================================= */
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
}

/* =========================================================
   TOOLS FOOTER
   ========================================================= */
.tools-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 26px 24px;
  background: var(--bg);
}
.tools-footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}
@media (min-width: 768px) {
  .tools-footer-inner { flex-direction: row; text-align: left; }
}
.tools-footer strong { color: var(--text-primary); }
.tools-footer-powered { display: flex; align-items: center; gap: 6px; }
.tools-footer-powered a { color: var(--accent); font-weight: 700; transition: color 0.15s ease; }
.tools-footer-powered a:hover { color: #c46f1a; }

/* =========================================================
   SMALL HELPERS (used sparingly — keep semantic classes first)
   ========================================================= */
.section { margin-bottom: 48px; }
.section-head { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.text-center { text-align: center; }
.hidden { display: none !important; }

/* Mobile: site header scrolls away, only the WebTools bar stays sticky; site menu opens above it */
@media (max-width: 767px) {
  .site-header { position: relative; z-index: 60; }
}

/* =========================================================
   SEO GUIDE & VALUE CONTENT SYSTEM (Theme-Adaptive, Zero Inline Styles)
   ========================================================= */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  margin: 18px 0 24px;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  background: var(--bg);
}

.data-table th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: var(--bg-panel);
  padding: 12px 14px;
  border: 1px solid var(--border);
}

.data-table td {
  padding: 12px 14px;
  border: 1px solid var(--border);
  color: var(--text-primary);
  vertical-align: top;
}

.data-table tr:hover td {
  background: var(--bg-panel-hover);
}

.guide-article {
  margin-top: 48px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
  max-width: 860px;
}

.guide-article h2 {
  font-size: 24px;
  margin: 32px 0 14px;
  color: var(--text-primary);
}

.guide-article h3 {
  font-size: 18px;
  margin: 24px 0 10px;
  color: var(--text-primary);
}

.guide-article p {
  font-size: 15px;
  line-height: 1.75;
  margin-bottom: 16px;
  color: var(--text-muted);
}

.guide-article p strong {
  color: var(--text-primary);
}

.guide-article ul,
.guide-article ol {
  color: var(--text-muted);
  font-size: 14.5px;
  line-height: 1.75;
  margin: 0 0 20px 0;
  padding-left: 22px;
}

.guide-article li {
  margin-bottom: 8px;
}

.guide-article li strong {
  color: var(--text-primary);
}

.code-snippet {
  background: var(--surface-dark);
  color: #E5E7EB;
  border-radius: var(--radius-sm);
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  overflow-x: auto;
  margin: 14px 0 22px;
  border: 1px solid var(--border);
}

.code-snippet code {
  color: #93C5FD;
  font-family: inherit;
}

.faq-container {
  margin-top: 48px;
}

.faq-container h2 {
  font-size: 22px;
  margin-bottom: 24px;
}

.faq-item {
  margin-bottom: 12px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.faq-item:hover {
  border-color: var(--accent);
}

.faq-item summary {
  font-weight: 600;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 15px;
}

.faq-item p {
  margin-top: 10px;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 0;
}

.anatomy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin: 18px 0 24px;
}

.anatomy-block {
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-panel);
  text-align: center;
}

.anatomy-block .anatomy-part {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}

.anatomy-block .anatomy-desc {
  font-size: 11.5px;
  color: var(--text-muted);
}
