/* ═══════════════════════════════════════
   eOfficeTools.com — main.css
   Premium light theme + dark mode
═══════════════════════════════════════ */

:root {
  --bg: #f8f9ff;
  --bg2: #ffffff;
  --surface: #ffffff;
  --surface2: #f1f3ff;
  --border: #e2e6f0;
  --text: #1a1d2e;
  --text2: #5a6080;
  --text3: #8892b0;
  --accent: #667eea;
  --accent2: #764ba2;
  --accent3: #f093fb;
  --green: #43e97b;
  --red: #f5576c;
  --header-h: 64px;
  --banner-h: 44px;
  --sidebar-w: 240px;
  --sidebar-w-collapsed: 56px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 12px rgba(102,126,234,.12);
  --shadow-md: 0 4px 24px rgba(102,126,234,.18);
  --shadow-lg: 0 8px 40px rgba(102,126,234,.22);
  --transition: .22s cubic-bezier(.4,0,.2,1);
}

[data-theme="dark"] {
  --bg: #0f1117;
  --bg2: #161b27;
  --surface: #1e2435;
  --surface2: #252b3d;
  --border: #2d3455;
  --text: #e8eaf8;
  --text2: #9aa3cc;
  --text3: #6b7494;
  --shadow: 0 2px 12px rgba(0,0,0,.4);
  --shadow-md: 0 4px 24px rgba(0,0,0,.5);
}

/* Category colour themes */
[data-category="pdf"]      { --cat-color: #e53e3e; --cat-bg: linear-gradient(135deg,#fff5f5,#fed7d7); }
[data-category="image"]    { --cat-color: #d69e2e; --cat-bg: linear-gradient(135deg,#fffff0,#fefcbf); }
[data-category="video"]    { --cat-color: #3182ce; --cat-bg: linear-gradient(135deg,#ebf8ff,#bee3f8); }
[data-category="audio"]    { --cat-color: #38a169; --cat-bg: linear-gradient(135deg,#f0fff4,#c6f6d5); }
[data-category="ai"]       { --cat-color: #805ad5; --cat-bg: linear-gradient(135deg,#faf5ff,#e9d8fd); }
[data-category="convert"]  { --cat-color: #dd6b20; --cat-bg: linear-gradient(135deg,#fffaf0,#feebc8); }
[data-category="text"]     { --cat-color: #2b6cb0; --cat-bg: linear-gradient(135deg,#ebf4ff,#bee3f8); }
[data-category="security"] { --cat-color: #276749; --cat-bg: linear-gradient(135deg,#f0fff4,#9ae6b4); }
[data-category="math"]     { --cat-color: #c05621; --cat-bg: linear-gradient(135deg,#fffaf0,#fbd38d); }
[data-category="web"]      { --cat-color: #2c7a7b; --cat-bg: linear-gradient(135deg,#e6fffa,#b2f5ea); }
[data-category="misc"]     { --cat-color: #553c9a; --cat-bg: linear-gradient(135deg,#faf5ff,#d6bcfa); }

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background var(--transition), color var(--transition);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ── TOP BANNER ── */
.top-banner {
  position: relative;
  height: var(--banner-h);
  overflow: hidden;
  z-index: 200;
}
.banner-track { position: relative; width: 100%; height: 100%; }
.banner-slide {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  background: var(--slide-bg);
  color: white; font-size: .875rem; font-weight: 500;
  opacity: 0; transition: opacity .6s ease;
  padding: 0 48px 0 12px;
}
.banner-slide.active { opacity: 1; }
.b-icon { font-size: 1.1rem; }
.b-text { flex: 1; text-align: center; text-shadow: 0 1px 2px rgba(0,0,0,.2); }
.b-cta {
  background: rgba(255,255,255,.25);
  color: white; border: 1px solid rgba(255,255,255,.5);
  padding: 4px 14px; border-radius: 20px; font-size: .8rem; font-weight: 600;
  white-space: nowrap; transition: background .2s;
}
.b-cta:hover { background: rgba(255,255,255,.4); text-decoration: none; }
.banner-dots {
  position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 5px;
}
.banner-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255,255,255,.5); transition: background .3s;
}
.banner-dot.active { background: white; }
.banner-close {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  color: white; font-size: 1rem; opacity: .7; padding: 4px 8px;
}
.banner-close:hover { opacity: 1; }

/* ── SITE HEADER ── */
.site-header {
  position: sticky; top: 0; z-index: 150;
  height: var(--header-h);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px;
  padding: 0 16px;
  box-shadow: var(--shadow);
}

/* Logo */
.logo-wrap {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; flex-shrink: 0;
  animation: logoFade 3s ease-in-out infinite;
}
@keyframes logoFade {
  0%,100% { opacity: 1; }
  50% { opacity: .75; }
}
.logo-icon { display: flex; align-items: center; }
.logo-text-wrap { display: flex; align-items: baseline; gap: 1px; }
.logo-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800; font-size: 1.25rem;
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.logo-tagline { font-size: .85rem; color: var(--text3); font-weight: 500; }

/* Security Ticker */
.security-ticker {
  display: flex; align-items: center; gap: 6px;
  flex: 1; max-width: 320px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 14px;
  overflow: hidden;
}
.ticker-icon { font-size: .9rem; flex-shrink: 0; }
.ticker-msg {
  font-size: .78rem; color: var(--text2); font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  animation: tickerFade 4s ease-in-out infinite;
}
@keyframes tickerFade {
  0%,15%,85%,100% { opacity: 1; }
  40%,60% { opacity: 0; }
}

/* Search */
.search-wrap {
  position: relative; flex: 1; max-width: 460px;
}
.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 24px;
  padding: 8px 14px;
  transition: border-color .2s, box-shadow .2s;
}
.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(102,126,234,.15);
}
.search-icon { font-size: 1rem; color: var(--text3); flex-shrink: 0; }
.search-box input {
  flex: 1; border: none; outline: none; background: transparent;
  font-size: .875rem; color: var(--text); font-family: inherit;
}
.search-box input::placeholder { color: var(--text3); }
.search-kbd {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 4px; padding: 2px 6px; font-size: .7rem; color: var(--text3);
  font-family: inherit;
}
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  max-height: 400px; overflow-y: auto; z-index: 300;
  display: none;
}
.search-results.open { display: block; }
.search-result-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; cursor: pointer;
  transition: background .15s;
}
.search-result-item:hover { background: var(--surface2); }
.search-result-item .r-emoji { font-size: 1.2rem; }
.search-result-item .r-name { font-size: .875rem; font-weight: 500; color: var(--text); }
.search-result-item .r-cat { font-size: .75rem; color: var(--text3); margin-left: auto; }

/* Header controls */
.header-controls { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.btn-icon {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--surface2); border: 1px solid var(--border);
  font-size: 1.1rem; display: flex; align-items: center; justify-content: center;
  transition: background .2s, transform .2s;
}
.btn-icon:hover { background: var(--surface); transform: scale(1.1); }
.btn-dashboard {
  display: flex; align-items: center; gap: 6px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white; padding: 8px 16px; border-radius: 20px;
  font-size: .85rem; font-weight: 600;
  transition: transform .2s, box-shadow .2s;
}
.btn-dashboard:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(102,126,234,.4); }

/* ── APP LAYOUT ── */
.app-layout {
  display: flex; flex: 1;
  min-height: calc(100vh - var(--header-h) - var(--banner-h) - 52px - 200px);
}

/* ── SIDEBAR ── */
.sidebar {
  position: sticky; top: var(--header-h);
  height: calc(100vh - var(--header-h));
  width: var(--sidebar-w);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  overflow-y: auto; overflow-x: hidden;
  flex-shrink: 0;
  transition: width var(--transition);
  z-index: 100;
}
.sidebar.collapsed { width: var(--sidebar-w-collapsed); }
.sidebar-toggle {
  position: absolute; right: -14px; top: 20px;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--bg2); border: 1px solid var(--border);
  font-size: .9rem; color: var(--text2);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow); z-index: 10;
  transition: transform var(--transition);
}
.sidebar.collapsed .sidebar-toggle { transform: rotate(180deg); }
.sidebar-label {
  font-size: .65rem; font-weight: 700; letter-spacing: .1em;
  color: var(--text3); padding: 16px 16px 8px;
}
.sidebar.collapsed .sidebar-label { opacity: 0; }
.sidebar-nav { padding-bottom: 24px; }
.sidebar-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; cursor: pointer;
  border-radius: 0; transition: background .15s, color .15s;
  position: relative;
}
.sidebar-item:hover { background: var(--surface2); }
.sidebar-item.active {
  background: linear-gradient(135deg, rgba(102,126,234,.12), rgba(118,75,162,.08));
  color: var(--accent);
  border-right: 3px solid var(--accent);
}
.sidebar-item .s-emoji { font-size: 1.2rem; flex-shrink: 0; }
.sidebar-item .s-label { font-size: .875rem; font-weight: 500; white-space: nowrap; }
.sidebar-item .s-count {
  margin-left: auto; font-size: .7rem; color: var(--text3);
  background: var(--surface2); border-radius: 10px; padding: 1px 7px;
}
.sidebar.collapsed .s-label,
.sidebar.collapsed .s-count { display: none; }
.sidebar.collapsed .sidebar-item { justify-content: center; padding: 12px 0; }

/* ── MAIN CONTENT ── */
.main-content {
  flex: 1; min-width: 0;
  padding: 24px;
  background: var(--bg);
  transition: background var(--transition);
}
/* Per-category background */
[data-category]:not([data-category="home"]) .main-content {
  background: var(--cat-bg, var(--bg));
}

.view { display: block; }
.view.hidden { display: none !important; }

/* ── FEATURE SLIDER ── */
.feature-slider {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  height: 280px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-md);
}
.feature-slides { position: relative; width: 100%; height: 100%; }
.feature-slide {
  position: absolute; inset: 0;
  display: flex; align-items: center;
  padding: 32px 40px;
  opacity: 0; transition: opacity .6s ease;
}
.feature-slide.active { opacity: 1; }
.slide-content { max-width: 500px; color: white; }
.slide-badge {
  display: inline-block;
  background: rgba(255,255,255,.2);
  border: 1px solid rgba(255,255,255,.4);
  padding: 4px 12px; border-radius: 20px;
  font-size: .75rem; font-weight: 600; letter-spacing: .05em;
  margin-bottom: 12px;
}
.slide-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 2rem; font-weight: 800; line-height: 1.2;
  margin-bottom: 10px; text-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.slide-desc { font-size: 1rem; opacity: .9; line-height: 1.5; margin-bottom: 18px; }
.slide-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: white; color: var(--accent);
  padding: 10px 22px; border-radius: 24px;
  font-weight: 700; font-size: .9rem;
  transition: transform .2s, box-shadow .2s;
}
.slide-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.2); text-decoration: none; }
.slide-emoji { font-size: 4rem; position: absolute; right: 40px; opacity: .25; }
.feature-dots {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 6px; z-index: 2;
}
.fdot {
  width: 8px; height: 8px; border-radius: 4px;
  background: rgba(255,255,255,.5); cursor: pointer;
  transition: width .3s, background .3s;
}
.fdot.active { width: 20px; background: white; }
.fs-prev, .fs-next {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.2); color: white;
  border: 1px solid rgba(255,255,255,.3);
  width: 36px; height: 36px; border-radius: 50%;
  font-size: 1rem; display: flex; align-items: center; justify-content: center;
  z-index: 2; transition: background .2s;
}
.fs-prev { left: 12px; }
.fs-next { right: 12px; }
.fs-prev:hover, .fs-next:hover { background: rgba(255,255,255,.4); }

/* ── SECTIONS ── */
.dash-section { margin-bottom: 36px; }
.section-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.2rem; font-weight: 700;
  color: var(--text); margin-bottom: 16px;
  padding-bottom: 8px; border-bottom: 2px solid var(--border);
}

/* ── CATEGORY GRID ── */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}
.cat-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px;
  cursor: pointer; text-align: center;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  position: relative; overflow: hidden;
}
.cat-card::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--cat-color, #667eea)20, transparent);
  opacity: 0; transition: opacity .3s;
}
.cat-card:hover { transform: translateY(-4px) scale(1.03); box-shadow: var(--shadow-md); }
.cat-card:hover::before { opacity: 1; }
.cat-card .cc-emoji { font-size: 2rem; margin-bottom: 8px; display: block; }
.cat-card .cc-name { font-size: .875rem; font-weight: 600; color: var(--text); }
.cat-card .cc-count { font-size: .75rem; color: var(--text3); margin-top: 3px; }

/* ── TOOLS GRID ── */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.tool-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  position: relative; overflow: hidden;
}
.tool-card::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #667eea, #f093fb, #43e97b, #4facfe);
  background-size: 300% 300%;
  animation: gradShift 4s ease infinite;
  opacity: 0;
  transition: opacity .3s;
  z-index: 0;
}
@keyframes gradShift {
  0%,100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.tool-card:hover::after { opacity: 1; }
.tool-card:hover { transform: scale(1.04); box-shadow: var(--shadow-lg); }
.tool-card > * { position: relative; z-index: 1; }
.tool-card:hover .tc-name,
.tool-card:hover .tc-desc { color: white; }
.tc-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.tc-emoji { font-size: 1.5rem; }
.tc-name { font-size: .9rem; font-weight: 600; color: var(--text); line-height: 1.3; }
.tc-desc { font-size: .78rem; color: var(--text2); line-height: 1.4; }
.tc-badge {
  display: inline-block; font-size: .65rem; font-weight: 700; letter-spacing: .05em;
  padding: 2px 7px; border-radius: 10px; margin-top: 8px;
  background: linear-gradient(135deg, #667eea, #764ba2); color: white;
}

/* ── TOOLS VIEW HEADER ── */
.tools-view-header {
  margin-bottom: 24px;
  padding: 20px 24px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.tools-view-header h1 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.6rem; font-weight: 800; color: var(--text);
}
.tools-view-header p { color: var(--text2); margin-top: 6px; font-size: .9rem; }

/* ── BACK BUTTON ── */
.back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text2); padding: 8px 16px; border-radius: var(--radius-sm);
  font-size: .875rem; font-weight: 500; margin-bottom: 20px;
  transition: background .2s, color .2s;
}
.back-btn:hover { background: var(--surface2); color: var(--text); }

/* ── TOOL RUNNER ── */
.tool-runner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 800px;
  box-shadow: var(--shadow);
}
.runner-header { margin-bottom: 20px; }
.runner-emoji { font-size: 2.5rem; margin-bottom: 8px; display: block; }
.runner-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.4rem; font-weight: 800; color: var(--text);
}
.runner-desc { color: var(--text2); margin-top: 4px; font-size: .9rem; }

/* Upload zone */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center; cursor: pointer;
  transition: border-color .2s, background .2s;
  margin: 20px 0;
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--accent);
  background: rgba(102,126,234,.05);
}
.upload-zone .uz-icon { font-size: 2.5rem; margin-bottom: 10px; }
.upload-zone .uz-title { font-weight: 600; color: var(--text); font-size: .95rem; }
.upload-zone .uz-sub { color: var(--text3); font-size: .8rem; margin-top: 4px; }
.upload-zone input[type="file"] { display: none; }
.uz-or {
  color: var(--text3); font-size: .8rem; margin: 8px 0;
  display: flex; align-items: center; gap: 8px;
}
.uz-or::before, .uz-or::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* Form fields */
.field-group { margin-bottom: 16px; }
.field-label { font-size: .85rem; font-weight: 500; color: var(--text2); margin-bottom: 6px; display: block; }
.field-input, .field-select, .field-textarea {
  width: 100%; padding: 10px 14px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text);
  font-size: .875rem; font-family: inherit;
  transition: border-color .2s, box-shadow .2s;
}
.field-input:focus, .field-select:focus, .field-textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(102,126,234,.15);
}
.field-textarea { resize: vertical; min-height: 100px; }

/* Run button */
.btn-run {
  display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white; padding: 12px 28px; border-radius: 24px;
  font-weight: 700; font-size: .95rem; width: 100%; justify-content: center;
  transition: transform .2s, box-shadow .2s, opacity .2s;
  margin-top: 8px;
}
.btn-run:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(102,126,234,.45); }
.btn-run:disabled { opacity: .6; cursor: not-allowed; }

/* Progress */
.progress-wrap { margin: 16px 0; display: none; }
.progress-wrap.show { display: block; }
.progress-bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; margin-bottom: 8px; }
.progress-fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, #667eea, #764ba2);
  border-radius: 3px; transition: width .3s ease;
}
.progress-status { font-size: .8rem; color: var(--text3); text-align: center; }

/* Result area */
.result-area {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px; margin-top: 16px;
  display: none;
}
.result-area.show { display: block; }
.result-text { white-space: pre-wrap; word-break: break-all; font-size: .85rem; color: var(--text); }
.btn-copy, .btn-download {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 20px;
  font-size: .82rem; font-weight: 600; margin-top: 10px; margin-right: 8px;
  transition: transform .2s, box-shadow .2s;
}
.btn-copy { background: var(--surface); border: 1.5px solid var(--border); color: var(--text); }
.btn-copy:hover { border-color: var(--accent); color: var(--accent); }
.btn-download { background: linear-gradient(135deg, #43e97b, #38f9d7); color: #1a4731; border: none; }
.btn-download:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(67,233,123,.4); }

/* ── STATS BAR ── */
.stats-bar {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; gap: 0;
  padding: 10px 24px;
}
.stat-item { display: flex; align-items: center; gap: 8px; padding: 0 20px; }
.stat-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #43e97b;
}
.stat-dot.live {
  animation: livePulse 2s ease-in-out infinite;
  box-shadow: 0 0 0 0 rgba(67,233,123,.6);
}
@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(67,233,123,.6); }
  70% { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.stat-icon { font-size: 1rem; }
.stat-val { font-size: 1rem; font-weight: 700; color: var(--text); }
.stat-label { font-size: .78rem; color: var(--text3); }
.stat-divider { width: 1px; height: 28px; background: var(--border); }

/* ── FOOTER ── */
.site-footer {
  background: var(--bg2);
  border-top: 2px solid var(--border);
  padding: 0;
}
.footer-top {
  display: flex; gap: 32px; flex-wrap: wrap;
  padding: 36px 32px 28px;
}
.footer-brand { max-width: 240px; flex-shrink: 0; }
.footer-logo {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800; font-size: 1.1rem; color: var(--text);
  margin-bottom: 12px;
}
.footer-desc { font-size: .82rem; color: var(--text3); line-height: 1.6; }
.footer-cats { display: flex; gap: 32px; flex-wrap: wrap; flex: 1; }
.footer-col h4 { font-size: .8rem; font-weight: 700; letter-spacing: .08em; color: var(--text3); margin-bottom: 12px; text-transform: uppercase; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 7px; }
.footer-col a { font-size: .82rem; color: var(--text2); transition: color .2s; }
.footer-col a:hover { color: var(--accent); text-decoration: none; }
.footer-bottom {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 32px;
  border-top: 1px solid var(--border);
  gap: 12px; flex-wrap: wrap;
}
.footer-copy { font-size: .78rem; color: var(--text3); }
.footer-copy a { color: var(--text3); }
.footer-copy a:hover { color: var(--accent); }
.btn-home {
  display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white; padding: 8px 18px; border-radius: 20px;
  font-size: .82rem; font-weight: 600;
  transition: transform .2s, box-shadow .2s;
  white-space: nowrap;
}
.btn-home:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(102,126,234,.4); }

/* ── TOAST ── */
.toast {
  position: fixed; bottom: 80px; right: 20px; z-index: 9999;
  background: var(--text); color: var(--bg2);
  padding: 12px 20px; border-radius: var(--radius-sm);
  font-size: .875rem; font-weight: 500;
  transform: translateY(20px); opacity: 0;
  transition: transform .3s, opacity .3s;
  pointer-events: none; max-width: 340px;
}
.toast.show { transform: translateY(0); opacity: 1; }

/* ── DARK THEME overrides ── */
[data-theme="dark"] .logo-name {
  background: linear-gradient(135deg, #a78bfa, #c084fc);
  -webkit-background-clip: text;
}
[data-theme="dark"] .cat-card { background: var(--surface); }
[data-theme="dark"] .tool-card { background: var(--surface); }
[data-theme="dark"] .field-input,
[data-theme="dark"] .field-select,
[data-theme="dark"] .field-textarea { background: var(--surface2); }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .security-ticker { display: none; }
  .search-wrap { max-width: unset; }
  .cat-grid { grid-template-columns: repeat(auto-fill, minmax(130px,1fr)); }
  .feature-slider { height: 200px; }
  .slide-title { font-size: 1.4rem; }
  .slide-emoji { display: none; }
}
@media (max-width: 680px) {
  .main-content { padding: 16px; }
  .tools-grid { grid-template-columns: repeat(auto-fill, minmax(160px,1fr)); }
  .footer-top { flex-direction: column; }
  .footer-cats { flex-direction: column; gap: 16px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .logo-tagline { display: none; }
  .search-kbd { display: none; }
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text3); }

/* ═══════════════════════════════════════════════════════
   RESPONSIVE: Screen Size + Orientation Detection
   Covers: Desktop, Tablet, Mobile — Portrait & Landscape
═══════════════════════════════════════════════════════ */

/* ── Root font scaling per device ── */
:root { --base-font: 16px; }

@media (max-width: 480px)  { :root { --base-font: 14px; } }
@media (max-width: 360px)  { :root { --base-font: 13px; } }
@media (min-width: 1400px) { :root { --base-font: 17px; } }
@media (min-width: 1800px) { :root { --base-font: 18px; } }
html { font-size: var(--base-font); }

/* ════════════════════════════════
   DESKTOP LARGE (>1400px)
════════════════════════════════ */
@media (min-width: 1400px) {
  :root { --sidebar-w: 280px; }
  .tools-grid { grid-template-columns: repeat(auto-fill, minmax(240px,1fr)); }
  .cat-grid    { grid-template-columns: repeat(auto-fill, minmax(180px,1fr)); }
  .feature-slider { height: 320px; }
  .slide-title { font-size: 2.4rem; }
  .slide-desc  { font-size: 1.1rem; }
  .tool-runner { max-width: 900px; }
}

/* ════════════════════════════════
   DESKTOP STANDARD (1024–1399px)
════════════════════════════════ */
@media (min-width: 1024px) and (max-width: 1399px) {
  :root { --sidebar-w: 240px; }
  .tools-grid { grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); }
  .feature-slider { height: 280px; }
}

/* ════════════════════════════════
   TABLET LANDSCAPE (768–1023px, landscape)
════════════════════════════════ */
@media (min-width: 768px) and (max-width: 1023px) and (orientation: landscape) {
  :root { --sidebar-w: 200px; --header-h: 58px; }
  .sidebar { width: var(--sidebar-w); }
  .tools-grid { grid-template-columns: repeat(auto-fill, minmax(190px,1fr)); gap: 12px; }
  .cat-grid   { grid-template-columns: repeat(auto-fill, minmax(140px,1fr)); }
  .feature-slider { height: 220px; }
  .slide-title { font-size: 1.5rem; }
  .slide-desc  { font-size: .9rem; }
  .logo-name   { font-size: 1.1rem; }
  .security-ticker { max-width: 220px; }
}

/* ════════════════════════════════
   TABLET PORTRAIT (768–1023px, portrait)
════════════════════════════════ */
@media (min-width: 768px) and (max-width: 1023px) and (orientation: portrait) {
  :root { --sidebar-w: 0px; --header-h: 60px; }
  .sidebar { display: none; }
  .tools-grid { grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); }
  .cat-grid   { grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); }
  .feature-slider { height: 240px; }
  .slide-title { font-size: 1.6rem; }
  .slide-emoji { font-size: 3rem; }
  .main-content { padding: 20px; }
  .security-ticker { max-width: 260px; }
  .search-wrap { max-width: 320px; }
}

/* ════════════════════════════════
   MOBILE LANDSCAPE (max 767px, landscape)
════════════════════════════════ */
@media (max-width: 767px) and (orientation: landscape) {
  :root { --header-h: 50px; --banner-h: 34px; }
  .sidebar { display: none; }
  .top-banner { height: var(--banner-h); font-size: .75rem; }
  .site-header { height: var(--header-h); padding: 0 12px; }
  .logo-name   { font-size: 1rem; }
  .logo-tagline { display: none; }
  .security-ticker { display: none; }
  .search-wrap { max-width: 280px; }
  .search-box  { padding: 5px 10px; }
  .search-box input { font-size: .8rem; }
  .search-kbd  { display: none; }
  .main-content { padding: 10px 14px; }
  .feature-slider { height: 160px; }
  .slide-title { font-size: 1.1rem; }
  .slide-desc  { font-size: .8rem; margin-bottom: 10px; }
  .slide-btn   { padding: 7px 14px; font-size: .78rem; }
  .slide-emoji { display: none; }
  .feature-dots { bottom: 6px; }
  .tools-grid { grid-template-columns: repeat(auto-fill, minmax(170px,1fr)); gap: 10px; }
  .cat-grid   { grid-template-columns: repeat(auto-fill, minmax(120px,1fr)); gap: 10px; }
  .tool-card  { padding: 12px; }
  .tc-name    { font-size: .82rem; }
  .tc-desc    { font-size: .72rem; }
  .stats-bar  { padding: 7px 12px; }
  .stat-val   { font-size: .88rem; }
  .stat-label { font-size: .68rem; }
  .section-title { font-size: 1rem; }
  .tool-runner { padding: 16px; }
  .runner-title { font-size: 1.1rem; }
  .btn-run    { padding: 10px; font-size: .88rem; }
  .footer-top { display: none; }
  .footer-bottom { padding: 10px 14px; }
  .footer-copy { font-size: .68rem; }
}

/* ════════════════════════════════
   MOBILE PORTRAIT (max 767px, portrait)
════════════════════════════════ */
@media (max-width: 767px) and (orientation: portrait) {
  :root { --header-h: 56px; --banner-h: 38px; }
  .sidebar { display: none; }
  .security-ticker { display: none; }
  .search-kbd { display: none; }
  .logo-tagline { display: none; }
  .site-header { padding: 0 12px; gap: 10px; }
  .logo-name   { font-size: 1.05rem; }
  .search-wrap { max-width: unset; flex: 1; }
  .search-box  { padding: 7px 12px; }
  .search-box input { font-size: .82rem; }
  .main-content { padding: 14px; }
  .feature-slider { height: 200px; border-radius: 10px; }
  .slide-title { font-size: 1.25rem; }
  .slide-desc  { font-size: .82rem; }
  .slide-emoji { display: none; }
  .slide-btn   { padding: 8px 16px; font-size: .8rem; }
  .dash-section { margin-bottom: 24px; }
  .section-title { font-size: 1rem; }
  .tools-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .cat-grid   { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .tool-card  { padding: 14px 12px; }
  .tc-emoji   { font-size: 1.3rem; }
  .tc-name    { font-size: .82rem; }
  .tc-desc    { font-size: .72rem; }
  .tc-badge   { font-size: .6rem; padding: 2px 6px; }
  .cc-emoji   { font-size: 1.6rem; }
  .cc-name    { font-size: .78rem; }
  .cc-count   { font-size: .68rem; }
  .stats-bar  { padding: 8px 12px; flex-wrap: wrap; gap: 6px; }
  .stat-divider { display: none; }
  .stat-item  { gap: 4px; }
  .stat-val   { font-size: .9rem; }
  .stat-label { font-size: .68rem; }
  .tool-runner { padding: 18px 14px; }
  .runner-emoji { font-size: 2rem; }
  .runner-title { font-size: 1.2rem; }
  .runner-desc  { font-size: .82rem; }
  .upload-zone  { padding: 28px 16px; }
  .btn-run { padding: 12px; font-size: .9rem; }
  .field-input, .field-select, .field-textarea { font-size: .875rem; padding: 9px 12px; }
  .back-btn { font-size: .8rem; padding: 6px 12px; margin-bottom: 14px; }
  .footer-top { padding: 20px 14px 14px; flex-direction: column; }
  .footer-cats { display: none; }
  .footer-bottom { padding: 12px 14px; flex-direction: column; align-items: flex-start; gap: 10px; }
  .footer-copy { font-size: .72rem; line-height: 1.6; }
  .btn-home { width: 100%; justify-content: center; }
  .search-results { max-height: 280px; }
  .tools-view-header { padding: 14px; }
  .tools-view-header h1 { font-size: 1.2rem; }
}

/* ════════════════════════════════
   VERY SMALL MOBILE (max 380px)
════════════════════════════════ */
@media (max-width: 380px) {
  .tools-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .cat-grid   { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .tool-card  { padding: 10px; }
  .tc-name    { font-size: .78rem; }
  .slide-title { font-size: 1.1rem; }
  .logo-name  { font-size: .95rem; }
  .btn-dashboard span:last-child { display: none; }
  .btn-dashboard { padding: 7px 10px; }
  .feature-slider { height: 180px; }
  .runner-title { font-size: 1.05rem; }
  .stat-val   { font-size: .82rem; }
}

/* ════════════════════════════════
   TOUCH DEVICE ENHANCEMENTS
════════════════════════════════ */
@media (hover: none) and (pointer: coarse) {
  /* Bigger tap targets */
  .sidebar-item { padding: 13px 16px; }
  .tool-card    { padding: 16px; }
  .btn-run      { min-height: 48px; }
  .btn-icon     { width: 42px; height: 42px; }
  .search-box input { min-height: 36px; }
  /* Remove hover effects that don't work on touch */
  .tool-card:hover { transform: none; }
  .cat-card:hover  { transform: none; }
  /* Add active press effect instead */
  .tool-card:active { transform: scale(0.97); opacity: .85; transition: transform .1s, opacity .1s; }
  .cat-card:active  { transform: scale(0.96); opacity: .85; transition: transform .1s, opacity .1s; }
  .btn-run:active   { transform: scale(0.98); }
  .sidebar-toggle { width: 36px; height: 36px; }
  .upload-zone { padding: 36px 20px; }
}

/* ════════════════════════════════
   HIGH DPI / RETINA SCREENS
════════════════════════════════ */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .logo-icon svg { image-rendering: crisp-edges; }
  ::-webkit-scrollbar { width: 4px; }
}

/* ════════════════════════════════
   PRINT MODE
════════════════════════════════ */
@media print {
  .top-banner, .site-header, .sidebar,
  .stats-bar, .site-footer, .btn-run,
  .back-btn, .feature-slider { display: none !important; }
  .main-content { padding: 0; }
  .tool-runner  { box-shadow: none; border: 1px solid #ccc; }
  body { background: white; color: black; }
}

/* ═══════════════════════════════════════
   ADSENSE SLOTS
═══════════════════════════════════════ */
.adsense-slot { width: 100%; text-align: center; overflow: hidden; }
.adsense-top  { min-height: 90px; background: var(--surface2); border-bottom: 1px solid var(--border); }
.adsense-mid  { min-height: 90px; margin: 0 0 24px; }
.adsense-footer { min-height: 90px; background: var(--surface2); border-bottom: 1px solid var(--border); }
.adsense-placeholder {
  display: flex; align-items: center; justify-content: center;
  min-height: 90px; color: var(--text3); font-size: .8rem;
  background: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(102,126,234,.03) 10px, rgba(102,126,234,.03) 20px);
  border: 1px dashed var(--border);
}
.adsense-placeholder.small { min-height: 60px; }

/* ═══════════════════════════════════════
   LANGUAGE SELECTOR
═══════════════════════════════════════ */
.lang-select-wrap select {
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 6px 10px;
  font-size: .8rem;
  color: var(--text);
  cursor: pointer;
  outline: none;
  transition: border-color .2s;
  font-family: inherit;
}
.lang-select-wrap select:hover { border-color: var(--accent); }
@media (max-width: 767px) { .lang-select-wrap { display: none; } }

/* ═══════════════════════════════════════
   SOCIAL BUTTONS
═══════════════════════════════════════ */
.footer-social { display: flex; gap: 8px; margin-top: 12px; }
.social-btn {
  width: 34px; height: 34px; border-radius: 8px;
  background: var(--surface2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem; font-weight: 700; color: var(--text2);
  text-decoration: none; transition: all .2s;
}
.social-btn:hover { background: var(--accent); color: white; border-color: var(--accent); text-decoration: none; }

/* ═══════════════════════════════════════
   LEGAL PAGES (Privacy, Terms, About, Contact)
═══════════════════════════════════════ */
.legal-page {
  max-width: 860px; margin: 0 auto;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 40px 48px;
  box-shadow: var(--shadow);
}
.legal-page h1 { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 2rem; font-weight: 800; margin-bottom: 8px; }
.legal-page .legal-meta { font-size: .82rem; color: var(--text3); margin-bottom: 32px; padding-bottom: 16px; border-bottom: 2px solid var(--border); }
.legal-page h2 { font-size: 1.15rem; font-weight: 700; margin: 28px 0 10px; color: var(--text); }
.legal-page p { font-size: .92rem; color: var(--text2); line-height: 1.75; margin-bottom: 14px; }
.legal-page ul { margin: 10px 0 14px 20px; }
.legal-page li { font-size: .9rem; color: var(--text2); line-height: 1.7; margin-bottom: 6px; }
.legal-page a { color: var(--accent); }
.legal-page .contact-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 16px; margin-top: 20px; }
.legal-page .contact-card { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; text-align: center; }
.legal-page .contact-card .cc-icon { font-size: 2rem; margin-bottom: 8px; }
.legal-page .contact-card h3 { font-size: .95rem; font-weight: 700; margin-bottom: 6px; }
.legal-page .contact-card p { font-size: .82rem; color: var(--text3); margin: 0; }
@media (max-width: 680px) { .legal-page { padding: 24px 16px; } .legal-page h1 { font-size: 1.5rem; } }

/* ═══════════════════════════════════════
   RTL SUPPORT (Arabic)
═══════════════════════════════════════ */
[dir="rtl"] .sidebar { border-right: none; border-left: 1px solid var(--border); }
[dir="rtl"] .sidebar-toggle { right: auto; left: -14px; }
[dir="rtl"] .search-icon { order: 1; }
[dir="rtl"] .site-header { flex-direction: row-reverse; }
[dir="rtl"] .logo-wrap { flex-direction: row-reverse; }
[dir="rtl"] .header-controls { flex-direction: row-reverse; }
[dir="rtl"] .tool-card { text-align: right; }
[dir="rtl"] .sidebar-item { flex-direction: row-reverse; }

/* ═══════════════════════════════════════
   MOBILE BOTTOM NAV + DRAWER
═══════════════════════════════════════ */
.mobile-bottom-nav {
  display: none; position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 60px;
  background: var(--bg2); border-top: 1px solid var(--border);
  box-shadow: 0 -4px 20px rgba(0,0,0,.1);
  z-index: 500;
  padding-bottom: env(safe-area-inset-bottom);
}
.mbn-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px; padding: 6px 0;
  background: none; border: none; color: var(--text3);
  cursor: pointer; transition: color .2s;
  -webkit-tap-highlight-color: transparent;
}
.mbn-item.active { color: var(--accent); }
.mbn-item:active { opacity: .7; }
.mbn-icon  { font-size: 1.3rem; line-height: 1; }
.mbn-label { font-size: .62rem; font-weight: 600; }

.mobile-drawer-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.55); z-index: 600;
  backdrop-filter: blur(4px);
}
.mobile-drawer-overlay.open { display: block; }
.mobile-drawer {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--bg2); border-radius: 20px 20px 0 0;
  z-index: 700; max-height: 80vh;
  transform: translateY(100%);
  transition: transform .32s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom);
}
.mobile-drawer.open { transform: translateY(0); }
.drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  font-weight: 700; font-size: 1rem; flex-shrink: 0;
}
.drawer-header button {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--surface2); border: 1px solid var(--border);
  font-size: 1rem; color: var(--text2);
  display: flex; align-items: center; justify-content: center;
}
.drawer-body { overflow-y: auto; padding: 8px 0; -webkit-overflow-scrolling: touch; }
.drawer-cat-item {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 20px; cursor: pointer; transition: background .15s;
  -webkit-tap-highlight-color: transparent;
}
.drawer-cat-item:active { background: var(--surface2); }
.drawer-emoji {
  font-size: 1.4rem; width: 42px; height: 42px;
  background: var(--surface2); border-radius: 10px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.drawer-info { flex: 1; }
.drawer-name  { display: block; font-size: .9rem; font-weight: 600; color: var(--text); }
.drawer-count { display: block; font-size: .73rem; color: var(--text3); margin-top: 2px; }
.drawer-arrow { color: var(--text3); font-size: 1.2rem; }

@media (max-width: 767px) {
  .mobile-bottom-nav { display: flex !important; }
  .site-footer { padding-bottom: 70px; }
  .stats-bar   { margin-bottom: 60px; }
}
@supports (padding: env(safe-area-inset-bottom)) {
  .mobile-bottom-nav {
    padding-bottom: env(safe-area-inset-bottom);
    height: calc(60px + env(safe-area-inset-bottom));
  }
}

/* ── COMING SOON BADGES ─────────────────────────── */
.coming-soon-card { opacity: 0.82; }
.coming-soon-card:hover { opacity: 1; cursor: pointer; }
.tc-badges { margin-top: 7px; display: flex; flex-wrap: wrap; gap: 4px; }
.tc-badge { font-size: .62rem; font-weight: 700; padding: 2px 8px; border-radius: 10px; letter-spacing: .04em; color: white; animation: popIn .25s ease; }
.badge-soon    { background: linear-gradient(135deg,#f093fb,#f5576c); }
.badge-free    { background: linear-gradient(135deg,#43e97b,#38f9d7); color: #1a4731; }
.badge-popular { background: linear-gradient(135deg,#667eea,#764ba2); }
.badge-ai      { background: linear-gradient(135deg,#805ad5,#b794f4); }
@keyframes popIn { from { transform:scale(0.7); opacity:0; } to { transform:scale(1); opacity:1; } }
