/* ToolHub 5D — Futuristic Premium Design System */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;600;700;800;900&family=Space+Grotesk:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600&display=swap');

/* ── CSS VARIABLES ── */
:root {
  --font-display: 'Orbitron', sans-serif;
  --font-body: 'Space Grotesk', sans-serif;
  --font-ui: 'Inter', sans-serif;

  /* Dark theme (default) */
  --bg: #06060f;
  --bg2: #0d0d1f;
  --bg3: #12122a;
  --card: rgba(13,13,35,0.85);
  --card-hover: rgba(20,20,50,0.95);
  --glass: rgba(15,15,40,0.6);
  --glass2: rgba(255,255,255,0.04);
  --border: rgba(99,102,241,0.15);
  --border-h: rgba(99,102,241,0.45);
  --border-glow: rgba(139,92,246,0.3);
  --text: #e8e8ff;
  --text2: #9ca3c8;
  --text3: #6b7280;
  --muted: #4a5568;

  /* Brand colors */
  --indigo: #6366f1;
  --purple: #8b5cf6;
  --pink: #ec4899;
  --cyan: #06b6d4;
  --blue: #3b82f6;
  --green: #10b981;
  --amber: #f59e0b;
  --orange: #f97316;
  --red: #ef4444;
  --electric: #00d4ff;
  --neon-pink: #ff006e;
  --neon-purple: #7c3aed;

  /* Gradients */
  --grad-main: linear-gradient(135deg, #667eea 0%, #764ba2 40%, #ec4899 100%);
  --grad-ai: linear-gradient(135deg, #06b6d4 0%, #3b82f6 50%, #8b5cf6 100%);
  --grad-pdf: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
  --grad-img: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
  --grad-dev: linear-gradient(135deg, #8b5cf6 0%, #3b82f6 100%);
  --grad-fin: linear-gradient(135deg, #f59e0b 0%, #10b981 100%);
  --grad-health: linear-gradient(135deg, #ef4444 0%, #ec4899 100%);
  --grad-games: linear-gradient(135deg, #f97316 0%, #ec4899 100%);
  --grad-card: linear-gradient(135deg, rgba(99,102,241,0.08) 0%, rgba(139,92,246,0.04) 100%);

  /* Shadows */
  --sh-sm: 0 2px 8px rgba(0,0,0,0.3);
  --sh-md: 0 4px 20px rgba(0,0,0,0.4), 0 0 0 1px rgba(99,102,241,0.1);
  --sh-lg: 0 8px 40px rgba(0,0,0,0.5), 0 0 30px rgba(99,102,241,0.1);
  --sh-xl: 0 20px 60px rgba(0,0,0,0.6), 0 0 60px rgba(99,102,241,0.15);
  --sh-glow-indigo: 0 0 20px rgba(99,102,241,0.5), 0 0 60px rgba(99,102,241,0.2);
  --sh-glow-pink: 0 0 20px rgba(236,72,153,0.5), 0 0 60px rgba(236,72,153,0.2);
  --sh-glow-cyan: 0 0 20px rgba(6,182,212,0.5), 0 0 60px rgba(6,182,212,0.2);

  /* Radii */
  --r-xs: 6px; --r-sm: 10px; --r-md: 16px; --r-lg: 20px; --r-xl: 28px; --r-2xl: 36px;

  /* Transitions */
  --tr: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --tr-b: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  --tr-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);

  /* Sidebar */
  --sidebar-w: 260px;
  --navbar-h: 64px;
}

[data-theme="light"] {
  --bg: #f0f2ff;
  --bg2: #ffffff;
  --bg3: #f5f7ff;
  --card: rgba(255,255,255,0.9);
  --card-hover: rgba(255,255,255,1);
  --glass: rgba(255,255,255,0.7);
  --glass2: rgba(99,102,241,0.03);
  --border: rgba(99,102,241,0.12);
  --border-h: rgba(99,102,241,0.35);
  --text: #0f0f23;
  --text2: #374151;
  --text3: #6b7280;
  --muted: #9ca3af;
  --sh-md: 0 4px 20px rgba(99,102,241,0.1), 0 1px 4px rgba(0,0,0,0.05);
  --sh-lg: 0 8px 40px rgba(99,102,241,0.15), 0 2px 8px rgba(0,0,0,0.05);
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; -webkit-tap-highlight-color: transparent; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.3s, color 0.3s;
}
img { max-width: 100%; display: block; }
a { color: var(--indigo); text-decoration: none; transition: var(--tr); }
button { cursor: pointer; font-family: var(--font-body); border: none; outline: none; }
input, select, textarea { font-family: var(--font-body); }
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--indigo); border-radius: 99px; }
* { scrollbar-width: thin; scrollbar-color: var(--indigo) var(--bg2); }

/* ── PARTICLES ── */
#particle-canvas {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 0; opacity: 0.4;
}

/* ── ORBS ── */
.orb {
  position: fixed; border-radius: 50%;
  filter: blur(100px); pointer-events: none; z-index: 0;
}
.orb-1 { width: 600px; height: 600px; background: radial-gradient(circle, rgba(99,102,241,0.3) 0%, transparent 70%); top: -200px; left: -200px; animation: orb-float-1 25s ease-in-out infinite; }
.orb-2 { width: 500px; height: 500px; background: radial-gradient(circle, rgba(236,72,153,0.25) 0%, transparent 70%); bottom: -100px; right: -100px; animation: orb-float-2 30s ease-in-out infinite; }
.orb-3 { width: 400px; height: 400px; background: radial-gradient(circle, rgba(6,182,212,0.2) 0%, transparent 70%); top: 40%; left: 50%; transform: translateX(-50%); animation: orb-float-3 20s ease-in-out infinite; }
.orb-4 { width: 300px; height: 300px; background: radial-gradient(circle, rgba(139,92,246,0.2) 0%, transparent 70%); top: 20%; right: 20%; animation: orb-float-1 35s ease-in-out infinite reverse; }
@keyframes orb-float-1 { 0%,100%{transform:translate(0,0)} 33%{transform:translate(50px,-40px)} 66%{transform:translate(-30px,30px)} }
@keyframes orb-float-2 { 0%,100%{transform:translate(0,0)} 33%{transform:translate(-40px,25px)} 66%{transform:translate(30px,-40px)} }
@keyframes orb-float-3 { 0%,100%{transform:translateX(-50%) translateY(0)} 50%{transform:translateX(-50%) translateY(-30px)} }

/* ── SIDEBAR ── */
#sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--glass);
  backdrop-filter: blur(30px) saturate(200%);
  -webkit-backdrop-filter: blur(30px) saturate(200%);
  border-right: 1px solid var(--border);
  z-index: 1100;
  display: flex; flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}
#sidebar.open { transform: translateX(0); }
@media (min-width: 1200px) {
  #sidebar { transform: translateX(0); }
  #main-content { margin-left: var(--sidebar-w); }
  #navbar { left: var(--sidebar-w); }
  #sidebar-overlay { display: none !important; }
  .hamburger-btn { display: none !important; }
  .sidebar-close { display: none !important; }
}
#sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.5); z-index: 1050;
  backdrop-filter: blur(4px);
}
#sidebar-overlay.show { display: block; }

.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1rem; border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-logo { display: flex; align-items: center; gap: 10px; }
.logo-icon { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; background: var(--glass2); border: 1px solid var(--border-glow); border-radius: var(--r-md); }
.logo-text { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; background: var(--grad-main); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; line-height: 1; }
.logo-badge { font-family: var(--font-display); font-size: 0.7rem; font-weight: 800; background: var(--grad-ai); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.sidebar-close { background: none; color: var(--text2); font-size: 1rem; padding: 6px; border-radius: var(--r-sm); transition: var(--tr); }
.sidebar-close:hover { background: var(--glass2); color: var(--text); }

.sidebar-search {
  display: flex; align-items: center; gap: 8px;
  margin: 0.75rem; padding: 0 12px;
  background: var(--glass2); border: 1px solid var(--border);
  border-radius: var(--r-md); flex-shrink: 0;
}
.sidebar-search-icon { color: var(--text3); font-size: 0.85rem; }
.sidebar-search input {
  flex: 1; background: none; border: none; color: var(--text);
  font-size: 0.85rem; padding: 10px 0; outline: none;
}
.sidebar-search input::placeholder { color: var(--text3); }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 0.5rem; }
.sidebar-section-label {
  font-family: var(--font-display); font-size: 0.6rem; font-weight: 600;
  color: var(--text3); letter-spacing: 1px; padding: 0.75rem 0.5rem 0.35rem;
}
.sidebar-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 0.65rem 0.75rem;
  background: none; color: var(--text2);
  border-radius: var(--r-sm); font-size: 0.88rem; font-weight: 500;
  transition: var(--tr); margin-bottom: 2px; position: relative;
}
.sidebar-item:hover { background: var(--glass2); color: var(--text); }
.sidebar-item.active {
  background: linear-gradient(90deg, rgba(99,102,241,0.2), rgba(99,102,241,0.05));
  color: #818cf8; border-left: 2px solid var(--indigo);
}
.si-icon { font-size: 1rem; width: 20px; text-align: center; }
.si-label { flex: 1; }
.si-badge { font-size: 0.6rem; font-weight: 700; padding: 2px 6px; border-radius: 99px; background: var(--indigo); color: white; }
.si-badge.new { background: linear-gradient(90deg, #06b6d4, #8b5cf6); }
.si-badge.hot { background: linear-gradient(90deg, #f97316, #ec4899); }
.si-count { font-size: 0.72rem; background: var(--glass2); border: 1px solid var(--border); color: var(--text2); padding: 1px 7px; border-radius: 99px; }

.sidebar-upgrade {
  margin: 0.75rem; padding: 0.85rem;
  background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(236,72,153,0.1));
  border: 1px solid rgba(99,102,241,0.25); border-radius: var(--r-lg);
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.upgrade-icon { font-size: 1.4rem; }
.upgrade-text { flex: 1; }
.upgrade-title { font-weight: 700; font-size: 0.85rem; color: var(--text); }
.upgrade-desc { font-size: 0.7rem; color: var(--text3); }
.upgrade-btn {
  padding: 5px 12px; background: var(--grad-main); color: white;
  border-radius: 99px; font-size: 0.75rem; font-weight: 600;
  box-shadow: 0 0 12px rgba(99,102,241,0.3);
}
.upgrade-btn:hover { transform: scale(1.05); }

.sidebar-stats {
  padding: 0.75rem 1rem; border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 4px; flex-shrink: 0;
}
.stat-row { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--text3); }
.stat-val { color: var(--indigo); font-weight: 600; }

/* ── NAVBAR ── */
#navbar {
  position: fixed; top: 0; right: 0; left: 0;
  height: var(--navbar-h); z-index: 1000;
  background: var(--glass);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
  padding: 0 1rem; transition: box-shadow 0.3s;
}
#navbar.scrolled { box-shadow: 0 2px 30px rgba(0,0,0,0.3), 0 0 0 1px rgba(99,102,241,0.1); }

.navbar-left { display: flex; align-items: center; gap: 10px; }
.hamburger-btn {
  width: 38px; height: 38px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 5px;
  background: var(--glass2); border: 1px solid var(--border);
  border-radius: var(--r-sm); flex-shrink: 0;
}
.hamburger-btn span { display: block; width: 16px; height: 2px; background: var(--text2); border-radius: 2px; transition: var(--tr); }
.hamburger-btn:hover { border-color: var(--indigo); }

.nav-logo { display: flex; align-items: center; gap: 8px; }
.nav-logo-icon { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; }
.nav-logo-text { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; background: var(--grad-main); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.nav-logo-5d { font-family: var(--font-display); font-size: 0.75rem; font-weight: 800; background: var(--grad-ai); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

.navbar-search-wrap { flex: 1; max-width: 520px; margin: 0 auto; }
.search-container { position: relative; display: flex; align-items: center; }
.search-icon { position: absolute; left: 12px; font-size: 0.9rem; pointer-events: none; z-index: 1; }
#search-input {
  width: 100%; padding: 10px 44px 10px 38px;
  background: var(--glass2); border: 1.5px solid var(--border);
  border-radius: var(--r-xl); color: var(--text); font-size: 0.88rem;
  outline: none; transition: var(--tr);
}
#search-input:focus { border-color: var(--indigo); background: var(--card); box-shadow: 0 0 0 3px rgba(99,102,241,0.1), var(--sh-glow-indigo); }
#search-input::placeholder { color: var(--text3); }
.voice-btn { position: absolute; right: 10px; background: none; color: var(--text3); font-size: 1rem; padding: 4px; border-radius: 6px; }
.voice-btn:hover { color: var(--indigo); }
.voice-btn.active { color: var(--pink); animation: pulse 1s infinite; }

.search-dropdown {
  display: none; position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: var(--card); border: 1px solid var(--border-h);
  border-radius: var(--r-lg); overflow: hidden;
  box-shadow: var(--sh-xl); z-index: 2000; max-height: 380px; overflow-y: auto;
}
.search-dropdown.show { display: block; }
.search-result-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; cursor: pointer; transition: var(--tr);
  border-bottom: 1px solid var(--border); font-size: 0.88rem;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--glass2); }
.sri-icon { font-size: 1.2rem; }
.sri-info { flex: 1; }
.sri-name { font-weight: 600; }
.sri-cat { font-size: 0.75rem; color: var(--text3); }
.no-results { padding: 1.5rem; text-align: center; color: var(--text3); }

.navbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.nav-ai-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px; background: linear-gradient(135deg, var(--indigo), var(--purple));
  color: white; border-radius: var(--r-xl); font-size: 0.82rem; font-weight: 600;
  box-shadow: 0 0 15px rgba(99,102,241,0.3); transition: var(--tr-b);
  white-space: nowrap;
}
.nav-ai-btn:hover { transform: translateY(-1px); box-shadow: var(--sh-glow-indigo); }

/* Auth buttons in navbar */
.nav-auth-btns { display: flex; align-items: center; gap: 6px; visibility: visible; }
.nav-login-btn {
  padding: 7px 14px; border-radius: var(--r-sm); font-size: 0.85rem; font-weight: 600;
  background: var(--glass2); border: 1px solid var(--border);
  color: var(--text); cursor: pointer; transition: var(--tr-b);
}
.nav-login-btn:hover { border-color: var(--indigo); color: var(--indigo); transform: translateY(-1px); }
.nav-signup-btn {
  padding: 7px 14px; border-radius: var(--r-sm); font-size: 0.85rem; font-weight: 600;
  background: var(--indigo); border: 1px solid var(--indigo);
  color: #fff; cursor: pointer; transition: var(--tr-b);
}
.nav-signup-btn:hover { opacity: 0.88; transform: translateY(-1px); box-shadow: var(--sh-glow-indigo); }
.nav-icon-btn {
  width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  background: var(--glass2); border: 1px solid var(--border);
  border-radius: var(--r-sm); color: var(--text2); font-size: 1rem; transition: var(--tr-b);
}
.nav-icon-btn:hover { border-color: var(--indigo); color: var(--text); transform: translateY(-1px); }
.notif-btn { position: relative; }
.notif-dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; background: var(--pink); border-radius: 50%; border: 2px solid var(--bg); }
.nav-avatar-btn { background: none; border: none; cursor: pointer; }
.avatar-ring {
  width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--indigo); font-size: 1.1rem; background: var(--glass2);
  box-shadow: 0 0 10px rgba(99,102,241,0.3);
}

/* Auth dropdown */
.auth-menu {
  position: fixed; top: calc(var(--navbar-h) + 8px); right: 1rem;
  background: var(--card); border: 1px solid var(--border-h);
  border-radius: var(--r-lg); box-shadow: var(--sh-xl);
  min-width: 220px; z-index: 1200; display: none;
  backdrop-filter: blur(20px);
}
.auth-menu.open { display: block; animation: fadeSlideDown 0.2s ease; }
.auth-menu-item {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; cursor: pointer; transition: var(--tr);
  font-size: 0.88rem; color: var(--text);
  border-bottom: 1px solid var(--border);
}
.auth-menu-item:last-child { border-bottom: none; }
.auth-menu-item:hover { background: var(--glass2); }

/* Notifications */
.notif-panel {
  position: fixed; top: calc(var(--navbar-h) + 8px); right: 1rem;
  background: var(--card); border: 1px solid var(--border-h);
  border-radius: var(--r-lg); box-shadow: var(--sh-xl);
  width: 320px; z-index: 1200; display: none;
  backdrop-filter: blur(20px);
}
.notif-panel.open { display: block; animation: fadeSlideDown 0.2s ease; }
.notif-header { display: flex; justify-content: space-between; align-items: center; padding: 1rem; border-bottom: 1px solid var(--border); }
.notif-header h3 { font-size: 0.95rem; font-weight: 700; }
.notif-header button { background: none; color: var(--text3); font-size: 1rem; }
.notif-list { max-height: 300px; overflow-y: auto; }
.notif-item { display: flex; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 0.83rem; }
.notif-item:last-child { border-bottom: none; }
.notif-dot-item { font-size: 1.2rem; flex-shrink: 0; }
.notif-item b { display: block; color: var(--text); margin-bottom: 2px; }
.notif-item p { color: var(--text3); line-height: 1.4; }

/* ── MAIN CONTENT ── */
#main-content {
  padding-top: var(--navbar-h);
  min-height: 100vh;
  position: relative; z-index: 1;
}

/* ── PAGES ── */
.page { display: none; padding: 1.5rem; animation: fadeIn 0.3s ease; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeSlideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* ── HERO ── */
.hero-section {
  display: flex; flex-direction: row-reverse; align-items: center; gap: 2rem;
  padding: 2rem 0 2.5rem; min-height: 420px;
  position: relative; overflow: hidden;
}
.hero-content { flex: 1; z-index: 2; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; background: rgba(99,102,241,0.1);
  border: 1px solid rgba(99,102,241,0.3); border-radius: 99px;
  font-size: 0.78rem; font-weight: 600; color: #818cf8; margin-bottom: 1rem;
  animation: pulse-glow 3s ease-in-out infinite;
}
@keyframes pulse-glow { 0%,100%{box-shadow:0 0 10px rgba(99,102,241,0.2)} 50%{box-shadow:0 0 20px rgba(99,102,241,0.4)} }

.hero-title { line-height: 1.1; margin-bottom: 1rem; }
.hero-title-line1 {
  display: block; font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 900;
  background: linear-gradient(135deg, #e8e8ff 0%, #818cf8 50%, #c084fc 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.hero-title-line2 {
  display: block; font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2.8rem); font-weight: 800;
  background: var(--grad-main);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  animation: gradient-shift 4s ease-in-out infinite;
}
@keyframes gradient-shift { 0%,100%{filter:hue-rotate(0deg)} 50%{filter:hue-rotate(30deg)} }

.hero-subtitle { font-size: 1rem; color: var(--text2); margin-bottom: 1.5rem; max-width: 450px; line-height: 1.7; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }

/* ── HERO VISUAL ── */
.hero-visual { flex: 0 0 auto; position: relative; width: 320px; height: 320px; }
.hero-cube-wrap { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); perspective: 600px; }
.hero-cube {
  width: 120px; height: 120px;
  transform-style: preserve-3d;
  animation: cube-rotate 12s linear infinite;
}
@keyframes cube-rotate { from { transform: rotateY(0deg) rotateX(15deg); } to { transform: rotateY(360deg) rotateX(15deg); } }
.cube-face {
  position: absolute; width: 120px; height: 120px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 1.8rem; font-weight: 900;
  border: 2px solid rgba(99,102,241,0.4);
  backdrop-filter: blur(10px);
}
.cube-face.front  { background: rgba(99,102,241,0.15); transform: translateZ(60px); color: #818cf8; }
.cube-face.back   { background: rgba(236,72,153,0.15); transform: rotateY(180deg) translateZ(60px); color: #ec4899; }
.cube-face.left   { background: rgba(6,182,212,0.15); transform: rotateY(-90deg) translateZ(60px); }
.cube-face.right  { background: rgba(139,92,246,0.15); transform: rotateY(90deg) translateZ(60px); }
.cube-face.top    { background: rgba(245,158,11,0.15); transform: rotateX(90deg) translateZ(60px); }
.cube-face.bottom { background: rgba(16,185,129,0.15); transform: rotateX(-90deg) translateZ(60px); color: #10b981; font-size: 2rem; }

.hero-floating-icons { position: absolute; inset: 0; pointer-events: none; }
.fi {
  position: absolute; font-size: 1.4rem;
  background: var(--glass); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 8px;
  backdrop-filter: blur(10px); animation: float-icon 6s ease-in-out infinite;
  box-shadow: var(--sh-md);
}
.fi-1 { top: 5%; left: 5%; animation-delay: 0s; }
.fi-2 { top: 5%; right: 5%; animation-delay: 0.5s; }
.fi-3 { top: 30%; left: 0; animation-delay: 1s; }
.fi-4 { top: 30%; right: 0; animation-delay: 1.5s; }
.fi-5 { bottom: 30%; left: 5%; animation-delay: 2s; }
.fi-6 { bottom: 30%; right: 5%; animation-delay: 2.5s; }
.fi-7 { bottom: 5%; left: 15%; animation-delay: 3s; }
.fi-8 { bottom: 5%; right: 15%; animation-delay: 3.5s; }
@keyframes float-icon { 0%,100%{transform:translateY(0) rotate(0deg)} 33%{transform:translateY(-12px) rotate(3deg)} 66%{transform:translateY(6px) rotate(-2deg)} }

/* ── STATS BAR ── */
.stats-bar {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1px; background: var(--border);
  border: 1px solid var(--border); border-radius: var(--r-xl);
  overflow: hidden; margin-bottom: 1.5rem;
}
.stat-item {
  background: var(--card); padding: 1.25rem;
  text-align: center; display: flex; flex-direction: column; gap: 4px;
  transition: var(--tr);
}
.stat-item:hover { background: var(--card-hover); }
.stat-icon { font-size: 1.5rem; }
.stat-num { font-family: var(--font-display); font-size: 1.4rem; font-weight: 800; background: var(--grad-main); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.stat-desc { font-size: 0.78rem; color: var(--text3); }

/* ── CATEGORY SCROLL ── */
.cat-scroll-wrap { margin-bottom: 1.5rem; overflow-x: auto; }
.cat-scroll { display: flex; gap: 8px; padding-bottom: 4px; }
.cat-chip {
  flex-shrink: 0; padding: 8px 16px;
  background: var(--glass2); border: 1px solid var(--border);
  border-radius: 99px; color: var(--text2); font-size: 0.83rem; font-weight: 500;
  transition: var(--tr); white-space: nowrap;
}
.cat-chip:hover, .cat-chip.active {
  background: linear-gradient(135deg, rgba(99,102,241,0.2), rgba(139,92,246,0.1));
  border-color: var(--indigo); color: #818cf8;
}

/* ── SECTION ── */
.section-wrap { margin-bottom: 2rem; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.section-title { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.view-all-btn { color: var(--indigo); font-size: 0.82rem; background: none; font-weight: 600; }
.view-all-btn:hover { color: var(--purple); text-decoration: underline; }

/* ── TOOL CARDS ── */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.tools-grid-full {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.tool-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.25rem;
  cursor: pointer;
  transition: var(--tr-b);
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 8px;
}
.tool-card::before {
  content: ''; position: absolute; inset: 0; opacity: 0;
  background: var(--grad-card); transition: opacity 0.3s; border-radius: inherit;
}
.tool-card:hover { transform: translateY(-4px) scale(1.01); border-color: var(--border-glow); box-shadow: var(--sh-lg), 0 0 20px rgba(99,102,241,0.15); }
.tool-card:hover::before { opacity: 1; }

.tc-icon { font-size: 1.8rem; line-height: 1; }
.tc-name { font-weight: 700; font-size: 0.9rem; color: var(--text); line-height: 1.3; }
.tc-desc { font-size: 0.78rem; color: var(--text3); line-height: 1.5; flex: 1; }
.tc-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.tc-badge { font-size: 0.65rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; }
.tc-badge.popular { background: rgba(99,102,241,0.15); color: #818cf8; }
.tc-badge.new { background: rgba(6,182,212,0.15); color: #06b6d4; }
.tc-badge.ai { background: rgba(139,92,246,0.15); color: #a78bfa; }
.tc-open-btn {
  font-size: 0.75rem; font-weight: 600; color: var(--indigo);
  background: rgba(99,102,241,0.08); border: 1px solid rgba(99,102,241,0.2);
  padding: 4px 10px; border-radius: 99px; transition: var(--tr);
}
.tc-open-btn:hover { background: var(--indigo); color: white; }
.tc-fav { position: absolute; top: 10px; right: 10px; background: none; font-size: 0.9rem; opacity: 0; transition: var(--tr); }
.tool-card:hover .tc-fav { opacity: 1; }
.tc-fav.active { opacity: 1; }

/* Category-colored left border */
.tool-card[data-cat="ai"] { border-left: 3px solid var(--cyan); }
.tool-card[data-cat="pdf"] { border-left: 3px solid var(--red); }
.tool-card[data-cat="image"] { border-left: 3px solid var(--green); }
.tool-card[data-cat="developer"] { border-left: 3px solid var(--purple); }
.tool-card[data-cat="finance"] { border-left: 3px solid var(--amber); }
.tool-card[data-cat="health"] { border-left: 3px solid var(--pink); }
.tool-card[data-cat="student"] { border-left: 3px solid var(--indigo); }
.tool-card[data-cat="games"] { border-left: 3px solid var(--orange); }
.tool-card[data-cat="fun"] { border-left: 3px solid #a78bfa; }

/* ── GAMES ── */
.games-scroll { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.game-thumb {
  flex-shrink: 0; width: 110px; cursor: pointer;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 1rem;
  text-align: center; transition: var(--tr-b);
}
.game-thumb:hover { transform: translateY(-4px); border-color: var(--orange); box-shadow: 0 0 20px rgba(249,115,22,0.2); }
.gt-img { font-size: 2.2rem; margin-bottom: 6px; }
.gt-name { font-size: 0.75rem; font-weight: 600; color: var(--text2); line-height: 1.3; }

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}
.game-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 1.5rem;
  cursor: pointer; text-align: center; transition: var(--tr-b);
  display: flex; flex-direction: column; gap: 10px; align-items: center;
}
.game-card:hover { transform: translateY(-6px); border-color: rgba(249,115,22,0.4); box-shadow: 0 10px 30px rgba(249,115,22,0.2); }
.game-card-icon { font-size: 2.8rem; }
.game-card-name { font-weight: 700; font-size: 0.92rem; }
.game-card-desc { font-size: 0.75rem; color: var(--text3); }
.game-card-btn {
  padding: 6px 16px; background: var(--grad-games);
  color: white; border-radius: 99px; font-size: 0.78rem; font-weight: 600;
  box-shadow: 0 0 10px rgba(249,115,22,0.3); transition: var(--tr-b);
}
.game-card-btn:hover { transform: scale(1.05); }

/* ── AI BANNER ── */
.ai-banner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.5rem; margin-bottom: 2rem;
  background: linear-gradient(135deg, rgba(6,182,212,0.1), rgba(99,102,241,0.1), rgba(139,92,246,0.1));
  border: 1px solid rgba(99,102,241,0.25); border-radius: var(--r-xl);
  cursor: pointer; transition: var(--tr-b); gap: 1rem;
  position: relative; overflow: hidden;
}
.ai-banner::before { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, transparent, rgba(99,102,241,0.05)); border-radius: inherit; }
.ai-banner:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(99,102,241,0.15); }
.ai-banner-left { display: flex; align-items: center; gap: 14px; }
.ai-banner-icon { font-size: 2.5rem; animation: ai-pulse 3s ease-in-out infinite; }
@keyframes ai-pulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.1)} }
.ai-banner-title { font-weight: 800; font-size: 1rem; color: var(--text); }
.ai-banner-desc { font-size: 0.82rem; color: var(--text2); }
.ai-banner-right { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.ai-powered { font-size: 0.7rem; text-align: right; color: var(--text3); }
.ai-powered b { font-family: var(--font-display); font-size: 0.8rem; background: var(--grad-ai); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.ai-ask-btn {
  padding: 10px 20px; background: var(--grad-main);
  color: white; border-radius: 99px; font-size: 0.85rem; font-weight: 700;
  box-shadow: var(--sh-glow-indigo); transition: var(--tr-b); white-space: nowrap;
}
.ai-ask-btn:hover { transform: scale(1.05); }

/* ── RECENT CHIPS ── */
.recent-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.recent-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; background: var(--card);
  border: 1px solid var(--border); border-radius: 99px;
  cursor: pointer; font-size: 0.82rem; transition: var(--tr); color: var(--text);
}
.recent-chip:hover { border-color: var(--indigo); background: var(--glass2); }
.recent-chip-icon { font-size: 1rem; }

/* ── DOUBLE GRID ── */
.double-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 2rem; }
.feedback-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: 1.5rem;
  text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center;
}
.fc-icon { font-size: 2rem; }
.feedback-card h3 { font-weight: 700; }
.feedback-card p { font-size: 0.85rem; color: var(--text2); }
.fav-preview { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-xl); padding: 1.5rem; }
.fav-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.fav-chip {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; background: var(--glass2);
  border: 1px solid var(--border); border-radius: 99px;
  cursor: pointer; font-size: 0.78rem; color: var(--text2); transition: var(--tr);
}
.fav-chip:hover { border-color: var(--indigo); color: var(--text); }

/* ── BUTTONS ── */
.btn-primary-glow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px; background: var(--grad-main);
  color: white; border-radius: var(--r-xl); font-size: 0.9rem; font-weight: 700;
  box-shadow: var(--sh-glow-indigo); transition: var(--tr-b);
}
.btn-primary-glow:hover { transform: translateY(-2px); box-shadow: 0 0 30px rgba(99,102,241,0.6), 0 8px 20px rgba(0,0,0,0.3); }
.btn-secondary-glow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px; background: var(--glass2);
  border: 1.5px solid var(--border-glow); color: var(--text);
  border-radius: var(--r-xl); font-size: 0.9rem; font-weight: 600;
  transition: var(--tr-b); backdrop-filter: blur(10px);
}
.btn-secondary-glow:hover { transform: translateY(-2px); border-color: var(--purple); box-shadow: var(--sh-glow-indigo); background: rgba(99,102,241,0.08); }
.btn-android-download {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 30px; text-decoration: none;
  background: linear-gradient(135deg, #00e676 0%, #00c853 50%, #00897b 100%);
  color: #fff; border-radius: var(--r-xl);
  font-size: 1rem; font-weight: 800;
  border: 2px solid rgba(255,255,255,0.3); transition: var(--tr-b);
  box-shadow: 0 6px 24px rgba(0,200,83,0.55), 0 0 0 3px rgba(0,230,118,0.2);
  letter-spacing: .04em;
  animation: pulse-green 2.2s ease-in-out infinite;
  cursor: pointer;
}
@keyframes pulse-green {
  0%, 100% { box-shadow: 0 6px 24px rgba(0,200,83,0.55), 0 0 0 3px rgba(0,230,118,0.2); }
  50% { box-shadow: 0 8px 32px rgba(0,200,83,0.85), 0 0 0 7px rgba(0,230,118,0.12); }
}
.btn-android-download:hover { transform: translateY(-3px) scale(1.03); box-shadow: 0 10px 36px rgba(0,200,83,0.75), 0 0 0 5px rgba(0,230,118,0.18); filter: brightness(1.1); animation: none; }
.btn-android-download:active { transform: scale(0.97); }
.btn-outline-glow {
  padding: 10px 20px; background: transparent;
  border: 1.5px solid var(--border-glow); color: var(--indigo);
  border-radius: var(--r-xl); font-size: 0.85rem; font-weight: 600; transition: var(--tr-b);
}
.btn-outline-glow:hover { background: rgba(99,102,241,0.1); transform: translateY(-1px); }
.btn-ghost { padding: 8px 14px; background: none; color: var(--text3); font-size: 0.82rem; border-radius: var(--r-sm); }

/* ── PAGE HEADERS ── */
.page-header-row { margin-bottom: 1.5rem; }
.page-heading { font-family: var(--font-display); font-size: 1.4rem; font-weight: 800; background: var(--grad-main); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; margin-bottom: 0.5rem; display: flex; align-items: center; gap: 10px; }
.page-subheading { color: var(--text2); font-size: 0.88rem; }
.tools-filter-wrap { display: flex; flex-direction: column; gap: 12px; }
.filter-input {
  width: 100%; max-width: 360px; padding: 10px 16px;
  background: var(--glass2); border: 1.5px solid var(--border);
  border-radius: var(--r-xl); color: var(--text); font-size: 0.88rem; outline: none;
  transition: var(--tr);
}
.filter-input:focus { border-color: var(--indigo); }

/* ── TOOL PAGE ── */
.tool-page { max-width: 800px; margin: 0 auto; }
.tool-page-header {
  display: flex; gap: 1.25rem; align-items: flex-start;
  margin-bottom: 1.5rem; padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.tool-page-icon {
  width: 64px; height: 64px; border-radius: var(--r-lg);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; flex-shrink: 0;
  background: var(--glass2); border: 1px solid var(--border);
  box-shadow: var(--sh-md);
}
.tool-page-info { flex: 1; }
.breadcrumb { font-size: 0.78rem; color: var(--text3); margin-bottom: 6px; }
.breadcrumb span { cursor: pointer; transition: var(--tr); }
.breadcrumb span:hover { color: var(--indigo); }
.tool-page-title { font-family: var(--font-display); font-size: 1.4rem; font-weight: 800; margin-bottom: 6px; }
.tool-page-desc { color: var(--text2); font-size: 0.88rem; margin-bottom: 12px; }
.tool-page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tool-action-btn {
  padding: 7px 14px; background: var(--glass2); border: 1px solid var(--border);
  border-radius: 99px; color: var(--text2); font-size: 0.78rem; font-weight: 600; transition: var(--tr);
}
.tool-action-btn:hover { border-color: var(--indigo); color: var(--indigo); }
.tool-action-btn.active { background: rgba(99,102,241,0.15); border-color: var(--indigo); color: #818cf8; }

/* Tool widget */
.tool-widget {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: 1.5rem; margin-bottom: 1rem;
}
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 0.82rem; font-weight: 600; color: var(--text2); }
.form-input, .form-select, .form-textarea {
  padding: 10px 14px; background: var(--glass2);
  border: 1.5px solid var(--border); border-radius: var(--r-md);
  color: var(--text); font-size: 0.88rem; outline: none; transition: var(--tr); width: 100%;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--indigo); box-shadow: 0 0 0 3px rgba(99,102,241,0.1); }
.form-select { cursor: pointer; background-color: var(--bg2); }
.form-textarea { resize: vertical; min-height: 100px; font-family: var(--font-body); }
input[type="range"] { width: 100%; accent-color: var(--indigo); }

.result-box {
  background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(139,92,246,0.05));
  border: 1px solid rgba(99,102,241,0.2); border-radius: var(--r-lg);
  padding: 1.25rem; text-align: center;
}
.result-value { font-family: var(--font-display); font-size: 2rem; font-weight: 800; background: var(--grad-main); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.result-label { font-size: 0.82rem; color: var(--text3); margin-bottom: 1rem; }
.result-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border-radius: var(--r-md); overflow: hidden; margin-bottom: 1rem; }
.result-item { background: var(--card); padding: 0.75rem; text-align: center; }
.result-item-value { font-weight: 700; font-size: 0.95rem; color: var(--indigo); }
.result-item-label { font-size: 0.7rem; color: var(--text3); }
.copy-result-btn {
  padding: 8px 20px; background: var(--glass2); border: 1px solid var(--border);
  color: var(--text2); border-radius: 99px; font-size: 0.8rem; transition: var(--tr);
}
.copy-result-btn:hover { border-color: var(--indigo); color: var(--indigo); }

.info-box {
  padding: 12px 16px; border-radius: var(--r-md); font-size: 0.82rem; line-height: 1.6; margin-bottom: 1rem;
}
.info-box-blue { background: rgba(59,130,246,0.08); border: 1px solid rgba(59,130,246,0.2); color: #93c5fd; }
.info-box-green { background: rgba(16,185,129,0.08); border: 1px solid rgba(16,185,129,0.2); color: #6ee7b7; }
.info-box-amber { background: rgba(245,158,11,0.08); border: 1px solid rgba(245,158,11,0.2); color: #fde68a; }

/* ── AI CHAT ── */
.ai-chat-wrap { max-width: 800px; margin: 0 auto; display: flex; flex-direction: column; height: calc(100vh - 200px); }
.ai-chat-messages { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; padding: 1rem 0; }
.ai-message { display: flex; gap: 10px; animation: fadeIn 0.3s ease; }
.ai-msg { flex-direction: row; }
.user-msg { flex-direction: row-reverse; }
.ai-avatar { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; background: linear-gradient(135deg, var(--indigo), var(--purple)); border: 2px solid rgba(99,102,241,0.3); }
.user-avatar { background: linear-gradient(135deg, var(--pink), var(--orange)); }
.ai-bubble {
  max-width: 75%; padding: 12px 16px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 18px; border-top-left-radius: 4px;
  font-size: 0.88rem; line-height: 1.7; color: var(--text);
}
.user-bubble {
  background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(139,92,246,0.1));
  border-color: rgba(99,102,241,0.25); border-top-left-radius: 18px; border-top-right-radius: 4px;
}
.ai-typing { display: flex; align-items: center; gap: 4px; padding: 10px 16px; }
.typing-dot { width: 6px; height: 6px; background: var(--indigo); border-radius: 50%; animation: typing 1.4s ease-in-out infinite; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing { 0%,60%,100%{transform:translateY(0)} 30%{transform:translateY(-6px)} }

.ai-chat-input-wrap {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: 1rem; margin-top: 1rem;
}
.ai-model-select {
  width: 100%; padding: 8px 12px; margin-bottom: 10px;
  background: var(--glass2); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--r-md); font-size: 0.82rem;
}
.ai-input-row { display: flex; gap: 10px; align-items: flex-end; }
#ai-chat-input {
  flex: 1; padding: 12px 16px; background: var(--glass2);
  border: 1.5px solid var(--border); border-radius: var(--r-lg);
  color: var(--text); font-size: 0.88rem; resize: none; outline: none; transition: var(--tr);
  max-height: 120px; overflow-y: auto;
}
#ai-chat-input:focus { border-color: var(--indigo); }
.ai-send-btn {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--grad-main); color: white; font-size: 1.1rem;
  box-shadow: var(--sh-glow-indigo); transition: var(--tr-b); flex-shrink: 0;
}
.ai-send-btn:hover { transform: scale(1.1); }
.ai-quick-prompts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.ai-quick-prompts span {
  padding: 5px 12px; background: var(--glass2);
  border: 1px solid var(--border); border-radius: 99px;
  font-size: 0.75rem; cursor: pointer; color: var(--text2); transition: var(--tr);
}
.ai-quick-prompts span:hover { border-color: var(--indigo); color: var(--indigo); }

/* ── FEEDBACK ── */
.feedback-tabs { display: flex; gap: 4px; margin-bottom: 1.5rem; flex-wrap: wrap; }
.fb-tab {
  padding: 9px 18px; background: var(--glass2); border: 1px solid var(--border);
  border-radius: var(--r-xl); color: var(--text2); font-size: 0.83rem; font-weight: 600; transition: var(--tr);
}
.fb-tab.active { background: linear-gradient(135deg, var(--indigo), var(--purple)); border-color: transparent; color: white; box-shadow: var(--sh-glow-indigo); }
.feedback-form-wrap { max-width: 640px; }
.feedback-form { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-xl); padding: 1.5rem; }
.feedback-form h3 { font-weight: 700; margin-bottom: 1rem; }
.feedback-form .form-group { margin-bottom: 1rem; }
.rating-stars { display: flex; gap: 8px; font-size: 1.6rem; cursor: pointer; }
.rating-star { transition: var(--tr-b); }
.rating-star:hover, .rating-star.active { transform: scale(1.2); filter: drop-shadow(0 0 6px gold); }
.submit-feedback-btn {
  width: 100%; padding: 12px; background: var(--grad-main);
  color: white; border-radius: var(--r-xl); font-size: 0.9rem; font-weight: 700;
  box-shadow: var(--sh-glow-indigo); transition: var(--tr-b); margin-top: 1rem;
}
.submit-feedback-btn:hover { transform: translateY(-2px); }

/* ── TOAST ── */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 12px 20px; border-radius: var(--r-lg);
  font-size: 0.85rem; font-weight: 600; color: white;
  box-shadow: var(--sh-lg); animation: toast-in 0.3s ease;
  max-width: 300px; display: flex; align-items: center; gap: 8px;
}
@keyframes toast-in { from{opacity:0;transform:translateX(100%)} to{opacity:1;transform:translateX(0)} }
.toast.success { background: linear-gradient(135deg, var(--green), #059669); }
.toast.error { background: linear-gradient(135deg, var(--red), #dc2626); }
.toast.info { background: linear-gradient(135deg, var(--indigo), var(--purple)); }
.toast.warning { background: linear-gradient(135deg, var(--amber), var(--orange)); }

/* ── MODALS ── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(8px);
  z-index: 9000; align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal-card {
  background: var(--card); border: 1px solid var(--border-h);
  border-radius: var(--r-2xl); padding: 2rem;
  max-width: 480px; width: 90%; position: relative;
  box-shadow: var(--sh-xl); animation: modal-in 0.3s cubic-bezier(0.34,1.56,0.64,1);
  backdrop-filter: blur(20px);
}
@keyframes modal-in { from{opacity:0;transform:scale(0.85)} to{opacity:1;transform:scale(1)} }
.modal-close {
  position: absolute; top: 14px; right: 14px;
  background: var(--glass2); border: 1px solid var(--border);
  color: var(--text2); width: 32px; height: 32px; border-radius: 50%;
  font-size: 0.9rem; display: flex; align-items: center; justify-content: center; transition: var(--tr);
}
.modal-close:hover { background: var(--red); color: white; }

/* Auth modal */
.auth-tabs { display: flex; margin-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.auth-tab { flex: 1; padding: 10px; font-weight: 700; color: var(--text3); background: none; font-size: 0.9rem; border-bottom: 2px solid transparent; transition: var(--tr); }
.auth-tab.active { color: var(--indigo); border-bottom-color: var(--indigo); }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form h2 { font-family: var(--font-display); font-size: 1.3rem; margin-bottom: 0.5rem; }
.auth-form .form-input { background: var(--glass2); }
.auth-divider { text-align: center; color: var(--text3); font-size: 0.8rem; margin: 4px 0; position: relative; }
.auth-divider::before, .auth-divider::after { content: ''; position: absolute; top: 50%; width: 40%; height: 1px; background: var(--border); }
.auth-divider::before { left: 0; } .auth-divider::after { right: 0; }
.google-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px; background: var(--glass2); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--r-lg); font-weight: 600; font-size: 0.88rem; transition: var(--tr);
}
.google-btn:hover { border-color: var(--indigo); background: rgba(99,102,241,0.05); }
.auth-submit { width: 100%; padding: 12px; background: var(--grad-main); color: white; border-radius: var(--r-lg); font-weight: 700; box-shadow: var(--sh-glow-indigo); transition: var(--tr-b); font-size: 0.9rem; }
.auth-submit:hover { transform: translateY(-2px); }
.auth-link { text-align: center; font-size: 0.82rem; color: var(--text3); }
.auth-link a { color: var(--indigo); }
.auth-error { color: var(--red); font-size: 0.8rem; background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.2); padding: 8px 12px; border-radius: var(--r-sm); }

/* Upgrade modal */
.upgrade-card { text-align: center; }
.upgrade-modal-content { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.upgrade-crown { font-size: 3rem; animation: float-icon 3s ease-in-out infinite; }
.upgrade-card h2 { font-family: var(--font-display); font-size: 1.4rem; background: var(--grad-main); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.upgrade-features { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
.uf-item { padding: 10px; background: var(--glass2); border: 1px solid var(--border); border-radius: var(--r-md); font-size: 0.83rem; }

/* ── PWA BANNER ── */
.pwa-banner {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--card); border-top: 1px solid var(--border);
  padding: 12px 16px; display: flex; align-items: center; justify-content: space-between;
  z-index: 8000; box-shadow: 0 -10px 30px rgba(0,0,0,0.3);
  backdrop-filter: blur(20px); gap: 12px;
}
.pwa-banner-content { display: flex; align-items: center; gap: 10px; }
.pwa-icon { font-size: 1.5rem; }
.pwa-banner-content b { font-size: 0.88rem; }
.pwa-banner-content p { font-size: 0.75rem; color: var(--text3); }
.pwa-banner-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ── BADGE ── */
.badge-new { font-size: 0.7rem; font-weight: 700; padding: 2px 8px; background: linear-gradient(90deg, #06b6d4, #8b5cf6); color: white; border-radius: 99px; vertical-align: middle; }

/* ── GAME VIEW ── */
.game-view-wrap { max-width: 700px; margin: 0 auto; }
.game-view-header { display: flex; align-items: center; gap: 12px; margin-bottom: 1.5rem; }
.game-back-btn { padding: 8px 16px; background: var(--glass2); border: 1px solid var(--border); color: var(--text); border-radius: var(--r-xl); font-size: 0.85rem; transition: var(--tr); }
.game-back-btn:hover { border-color: var(--indigo); }
.game-canvas-wrap { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-xl); overflow: hidden; }
.game-score-bar { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.game-score-val { font-family: var(--font-display); font-size: 1.4rem; font-weight: 800; background: var(--grad-main); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.game-control-btn { padding: 8px 20px; background: var(--grad-main); color: white; border-radius: 99px; font-size: 0.85rem; font-weight: 600; transition: var(--tr-b); }
.game-control-btn:hover { transform: scale(1.05); }

/* Simple game styles */
.ttt-board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 300px; margin: 2rem auto; }
.ttt-cell { aspect-ratio: 1; background: var(--glass2); border: 2px solid var(--border); border-radius: var(--r-md); display: flex; align-items: center; justify-content: center; font-size: 2.5rem; cursor: pointer; transition: var(--tr-b); }
.ttt-cell:hover { border-color: var(--indigo); background: rgba(99,102,241,0.08); }
.ttt-cell.x { color: #818cf8; }
.ttt-cell.o { color: #ec4899; }
.coin-flip-wrap { text-align: center; padding: 2rem; }
.coin { width: 120px; height: 120px; margin: 1.5rem auto; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 3rem; background: linear-gradient(135deg, var(--amber), var(--orange)); box-shadow: 0 0 30px rgba(245,158,11,0.4); transition: transform 0.6s; }
.coin.flip { animation: coin-spin 1s ease; }
@keyframes coin-spin { 0%{transform:rotateY(0)} 100%{transform:rotateY(720deg)} }

/* Snake game */
#snake-canvas { display: block; border-radius: var(--r-lg); }
#game-2048-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 1rem; }
.tile-2048 { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: var(--r-md); font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; transition: all 0.15s; background: var(--glass2); border: 1px solid var(--border); }

/* ── SKELETON ── */
.skeleton { background: linear-gradient(90deg, var(--glass2) 25%, rgba(99,102,241,0.06) 50%, var(--glass2) 75%); background-size: 200% 100%; animation: skeleton-shine 1.5s infinite; border-radius: var(--r-md); }
@keyframes skeleton-shine { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* ── HEALTH TOOLS ── */
.health-dashboard { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.health-metric { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-xl); padding: 1.5rem; text-align: center; }
.health-metric-value { font-family: var(--font-display); font-size: 2rem; font-weight: 800; background: var(--grad-health); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.health-metric-label { font-size: 0.82rem; color: var(--text3); }

/* Heart rate monitor */
.hr-monitor { text-align: center; padding: 2rem; }
.hr-display { font-family: var(--font-display); font-size: 4rem; font-weight: 900; background: var(--grad-health); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; line-height: 1; }
.hr-bpm { font-size: 1rem; color: var(--text3); margin-bottom: 1.5rem; }
.hr-heart { font-size: 3rem; animation: heartbeat 1s ease-in-out infinite; }
@keyframes heartbeat { 0%,100%{transform:scale(1)} 20%{transform:scale(1.2)} 40%{transform:scale(1)} }
.camera-preview { width: 100%; max-width: 300px; border-radius: var(--r-xl); margin: 1rem auto; display: block; }

/* ── TOOL SEO CONTENT ── */
.tool-seo-content { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.tool-seo-content h2 { font-size: 1.2rem; font-weight: 700; margin-bottom: 1rem; }
.tool-seo-content h3 { font-size: 1rem; font-weight: 600; margin: 1rem 0 0.5rem; color: var(--indigo); }
.tool-seo-content p { font-size: 0.88rem; color: var(--text2); margin-bottom: 0.75rem; line-height: 1.7; }
.tool-seo-content ul, .tool-seo-content ol { padding-left: 1.25rem; margin-bottom: 0.75rem; }
.tool-seo-content li { font-size: 0.88rem; color: var(--text2); margin-bottom: 4px; line-height: 1.6; }
.seo-faq { display: flex; flex-direction: column; gap: 12px; }
.seo-faq-item { background: var(--glass2); border: 1px solid var(--border); border-radius: var(--r-md); padding: 1rem; }
.seo-faq-item strong { font-size: 0.88rem; color: var(--text); }
.seo-faq-item p { font-size: 0.82rem; color: var(--text2); margin-top: 6px; }

/* ── ANIMATIONS ── */
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.5} }
@keyframes spin { from{transform:rotate(0deg)} to{transform:rotate(360deg)} }

/* ── ADMIN ── */
.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-bottom: 1.5rem; }
.admin-metric { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-xl); padding: 1.5rem; }
.admin-metric-num { font-family: var(--font-display); font-size: 2rem; font-weight: 800; background: var(--grad-main); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.admin-metric-label { font-size: 0.82rem; color: var(--text3); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.admin-table th { padding: 10px 12px; background: var(--glass2); text-align: left; font-size: 0.78rem; font-weight: 700; color: var(--text3); border-bottom: 1px solid var(--border); }
.admin-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); color: var(--text2); }
.admin-table tr:hover td { background: var(--glass2); }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  :root { --navbar-h: 56px; }
  .hero-section { flex-direction: column; padding: 1rem 0 1.5rem; min-height: auto; }
  .hero-visual { width: 240px; height: 240px; margin: 0 auto 1rem; }
  .hero-cube { width: 110px; height: 110px; }
  .hero-cube-wrap { perspective: 700px; }
  .cube-face { width: 110px; height: 110px; font-size: 1.6rem; border: 2px solid rgba(99,102,241,0.5); box-shadow: 0 0 18px rgba(99,102,241,0.25); }
  .cube-face.front  { transform: translateZ(55px); }
  .cube-face.back   { transform: rotateY(180deg) translateZ(55px); }
  .cube-face.left   { transform: rotateY(-90deg) translateZ(55px); }
  .cube-face.right  { transform: rotateY(90deg) translateZ(55px); }
  .cube-face.top    { transform: rotateX(90deg) translateZ(55px); }
  .cube-face.bottom { transform: rotateX(-90deg) translateZ(55px); }
  .fi { display: flex; }
  .stats-bar { grid-template-columns: repeat(2, 1fr); }
  .double-grid { grid-template-columns: 1fr; }
  .tools-grid, .tools-grid-full { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .ai-banner { flex-direction: column; align-items: flex-start; }
  .ai-banner-right { width: 100%; justify-content: space-between; }
  .navbar-search-wrap { display: none; }
  .nav-ai-btn span { display: none; }
  .nav-ai-btn { padding: 8px; }
  .nav-login-btn { padding: 6px 10px; font-size: 0.78rem; }
  .nav-signup-btn { padding: 6px 10px; font-size: 0.78rem; }
  .hero-title-line1 { font-size: 1.8rem; }
  .hero-title-line2 { font-size: 1.5rem; }
  .fi { display: none; }
  .page { padding: 1rem; }
  .tool-page-header { flex-direction: column; align-items: flex-start; }
  .tool-page-icon { width: 50px; height: 50px; font-size: 1.6rem; }
}

@media (max-width: 480px) {
  .stats-bar { grid-template-columns: repeat(2, 1fr); }
  .tools-grid, .tools-grid-full { grid-template-columns: repeat(2, 1fr); }
  .games-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-badge { font-size: 0.7rem; }
  .result-grid { grid-template-columns: 1fr; }
  .hero-cta { flex-direction: column; }
  .btn-primary-glow, .btn-secondary-glow { justify-content: center; }
}

/* Android-specific optimizations */
@media (max-width: 600px) and (hover: none) {
  .tool-card:hover { transform: none; }
  .btn-primary-glow:hover { transform: none; }
  .tool-card:active { transform: scale(0.98); background: var(--card-hover); }
  .sidebar-item:active { background: var(--glass2); }
  .btn-primary-glow:active { transform: scale(0.97); }
}

/* Safe area for Android/iOS */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .pwa-banner { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .ai-chat-input-wrap { padding-bottom: calc(1rem + env(safe-area-inset-bottom)); }
}

/* ── QR RESULT ── */
.qr-output { display: flex; flex-direction: column; align-items: center; gap: 1rem; padding: 1rem; }
#qr-container canvas, #qr-container img { border-radius: var(--r-md); }
.qr-actions { display: flex; gap: 8px; }

/* ── COLOR PICKER ── */
.color-picker-wrap { display: flex; flex-direction: column; gap: 12px; }
input[type="color"] { width: 80px; height: 80px; border-radius: var(--r-md); cursor: pointer; border: none; padding: 4px; background: none; }
.color-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.color-swatch { width: 36px; height: 36px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; transition: var(--tr-b); }
.color-swatch:hover { transform: scale(1.2); border-color: white; }

/* ── FILE UPLOAD ── */
.file-drop-zone {
  border: 2px dashed var(--border); border-radius: var(--r-xl);
  padding: 2.5rem; text-align: center; cursor: pointer;
  transition: var(--tr); color: var(--text3);
}
.file-drop-zone:hover, .file-drop-zone.drag-over { border-color: var(--indigo); background: rgba(99,102,241,0.05); color: var(--indigo); }
.file-drop-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.file-drop-label { font-weight: 600; margin-bottom: 4px; }
.file-drop-hint { font-size: 0.78rem; }

/* ── PROGRESS ── */
.progress-bar { height: 8px; background: var(--glass2); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--grad-main); border-radius: 99px; transition: width 0.5s ease; }

/* ── POMODORO ── */
.pomodoro-ring { width: 200px; height: 200px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 1.5rem auto; position: relative; }
.pomodoro-time { font-family: var(--font-display); font-size: 2.5rem; font-weight: 900; }
.pomodoro-svg { position: absolute; top: 0; left: 0; transform: rotate(-90deg); }

/* ── LOVE CALCULATOR ── */
.love-result { text-align: center; padding: 1.5rem; }
.love-percent { font-family: var(--font-display); font-size: 4rem; font-weight: 900; background: var(--grad-health); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.love-hearts { font-size: 2rem; margin: 0.75rem 0; }

/* ═══════════════════════════════════════════════════════════════
   COMPILER HUB
═══════════════════════════════════════════════════════════════ */

.compiler-hub { max-width: 1400px; margin: 0 auto; padding-bottom: 2rem; }

/* Header */
.compiler-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.compiler-title { font-family: var(--font-display); font-size: 1.8rem; font-weight: 900;
  background: linear-gradient(135deg, #6366f1, #a855f7, #ec4899);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; margin: 0; }
.compiler-subtitle { color: var(--text2); font-size: 0.88rem; margin: 0.2rem 0 0; }

/* Language Tabs */
.compiler-tabs {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 1rem;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-xl);
  padding: 6px;
}
.compiler-tab {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: var(--r-md); border: none;
  background: transparent; color: var(--text2); font-size: 0.85rem; font-weight: 600;
  cursor: pointer; transition: all 0.18s; white-space: nowrap;
}
.compiler-tab:hover { background: var(--glass2); color: var(--text1); }
.compiler-tab.active {
  background: color-mix(in srgb, var(--lang-color) 18%, transparent);
  color: var(--lang-color);
  box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--lang-color) 40%, transparent);
}
.ct-icon { font-size: 1rem; }

/* IDE Layout */
.compiler-ide {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  height: 520px; min-height: 400px;
}

/* Panel Shared */
.compiler-editor-panel,
.compiler-output-panel {
  display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-xl); overflow: hidden;
}

/* Panel Bar */
.compiler-panel-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; background: var(--glass2);
  border-bottom: 1px solid var(--border); min-height: 42px; flex-shrink: 0;
}
.cpb-lang { display: flex; align-items: center; gap: 6px; font-size: 0.85rem; font-weight: 700; color: var(--text1); }
.cpb-actions { display: flex; align-items: center; gap: 6px; }
.cpb-btn {
  display: flex; align-items: center; gap: 4px;
  padding: 5px 10px; border-radius: var(--r-md); border: 1px solid var(--border);
  background: var(--glass); color: var(--text2); font-size: 0.78rem; font-weight: 600;
  cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.cpb-btn:hover { background: var(--card-hover); color: var(--text1); }
.cpb-run {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff; border-color: transparent; padding: 5px 16px; font-size: 0.85rem;
  box-shadow: 0 2px 8px rgba(99,102,241,0.35);
}
.cpb-run:hover { filter: brightness(1.1); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(99,102,241,0.5); }
.cpb-run:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.cpb-ai-debug {
  background: linear-gradient(135deg, #ec4899, #8b5cf6);
  color: #fff; border-color: transparent;
  box-shadow: 0 2px 8px rgba(236,72,153,0.35);
}
.cpb-ai-debug:hover { filter: brightness(1.1); transform: translateY(-1px); }

/* Editor */
.compiler-editor-wrap {
  display: flex; flex: 1; overflow: hidden; position: relative;
}
.line-numbers {
  padding: 12px 8px; text-align: right; min-width: 38px;
  font-family: 'Courier New', monospace; font-size: 0.8rem; line-height: 1.6;
  color: var(--text3); background: color-mix(in srgb, var(--bg) 60%, transparent);
  border-right: 1px solid var(--border); overflow: hidden; user-select: none;
  flex-shrink: 0;
}
.compiler-editor {
  flex: 1; padding: 12px; resize: none; border: none; outline: none;
  background: transparent; color: var(--text1);
  font-family: 'Courier New', Consolas, monospace; font-size: 0.85rem; line-height: 1.6;
  tab-size: 2; overflow: auto;
}

/* Output */
.compiler-output {
  flex: 1; overflow: auto; padding: 12px;
  font-family: 'Courier New', Consolas, monospace; font-size: 0.83rem; line-height: 1.65;
  background: color-mix(in srgb, #000 40%, var(--card));
}
.compiler-iframe { width: 100%; height: 100%; border: none; background: #fff; }

.output-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; gap: 8px; color: var(--text3); }
.op-icon { font-size: 2rem; opacity: 0.4; }
.op-text { font-size: 0.85rem; font-family: var(--font-body); }
.output-running { display: flex; align-items: center; gap: 10px; padding: 1rem; color: var(--text2); font-family: var(--font-body); }
.run-spinner { width: 18px; height: 18px; border: 2px solid var(--border); border-top-color: #6366f1; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.output-empty { color: var(--text3); font-family: var(--font-body); font-size: 0.85rem; padding: 1rem; }
.output-error-block { background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.3); border-radius: var(--r-md); padding: 12px; margin-top: 8px; }
.oeb-header { color: #ef4444; font-weight: 700; margin-bottom: 6px; font-family: var(--font-body); font-size: 0.85rem; }
.oeb-msg { color: #fca5a5; font-size: 0.82rem; white-space: pre-wrap; word-break: break-word; margin: 0 0 8px; }
.oeb-ai-btn {
  background: linear-gradient(135deg, #ec4899, #8b5cf6); color: #fff;
  border: none; padding: 6px 14px; border-radius: var(--r-md); cursor: pointer;
  font-size: 0.8rem; font-weight: 600; font-family: var(--font-body);
  box-shadow: 0 2px 8px rgba(236,72,153,0.35);
}
.oeb-ai-btn:hover { filter: brightness(1.1); }

/* Console output */
.console-output { display: flex; flex-direction: column; }
.co-line { display: flex; gap: 8px; padding: 1px 0; }
.co-prefix { color: var(--text3); min-width: 14px; }
.co-text { color: #d4d4d4; white-space: pre-wrap; word-break: break-all; }
.co-error .co-prefix, .co-error .co-text { color: #f87171; }
.co-warn .co-prefix, .co-warn .co-text  { color: #fbbf24; }
.co-info .co-prefix, .co-info .co-text  { color: #60a5fa; }

/* AI Debug Panel */
.ai-debug-panel {
  display: flex; flex-direction: column;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, #0f0e17 60%, var(--card));
  max-height: 320px; flex-shrink: 0;
}
.ai-debug-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; background: var(--glass2); border-bottom: 1px solid var(--border);
  font-size: 0.82rem; font-weight: 700; color: var(--text1); flex-shrink: 0;
}
.ai-model-tag { background: rgba(99,102,241,0.2); color: #818cf8; padding: 2px 7px; border-radius: 99px; font-size: 0.7rem; margin-left: 6px; }
.ai-debug-close { background: none; border: none; color: var(--text2); cursor: pointer; font-size: 1rem; padding: 0 4px; }
.ai-debug-close:hover { color: var(--text1); }
.ai-debug-messages { flex: 1; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 10px; }
.ai-msg { display: flex; align-items: flex-start; gap: 8px; }
.ai-msg-bot { flex-direction: row; }
.ai-msg-user { flex-direction: row-reverse; }
.ai-msg-avatar { font-size: 1.1rem; flex-shrink: 0; margin-top: 2px; }
.ai-user-avatar { font-size: 1rem; }
.ai-msg-bubble {
  background: var(--glass2); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 8px 12px;
  font-family: var(--font-body); font-size: 0.82rem; line-height: 1.55; color: var(--text1);
  max-width: 90%; word-break: break-word;
}
.ai-msg-user .ai-msg-bubble { background: rgba(99,102,241,0.15); border-color: rgba(99,102,241,0.3); color: #c7d2fe; }
.ai-thinking { display: flex; align-items: center; gap: 4px; padding: 10px 14px; }
.ai-thinking span { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #818cf8; animation: ai-bounce 1.2s ease-in-out infinite; }
.ai-thinking span:nth-child(2) { animation-delay: 0.2s; }
.ai-thinking span:nth-child(3) { animation-delay: 0.4s; }
@keyframes ai-bounce { 0%,80%,100%{transform:scale(0.6);opacity:0.4} 40%{transform:scale(1);opacity:1} }
.ai-code-block { background: rgba(0,0,0,0.4); border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; font-family: 'Courier New', monospace; font-size: 0.78rem; overflow-x: auto; margin: 4px 0; white-space: pre; color: #a5f3fc; }
.ai-inline-code { background: rgba(0,0,0,0.3); padding: 1px 5px; border-radius: 4px; font-family: 'Courier New', monospace; font-size: 0.8rem; color: #a5f3fc; }
.ai-debug-input-wrap { display: flex; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--border); flex-shrink: 0; background: var(--glass2); }
.ai-debug-input { flex: 1; background: var(--card); border: 1px solid var(--border); color: var(--text1); border-radius: var(--r-md); padding: 7px 12px; font-size: 0.83rem; outline: none; font-family: var(--font-body); }
.ai-debug-input:focus { border-color: #6366f1; box-shadow: 0 0 0 2px rgba(99,102,241,0.2); }
.ai-debug-send { background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; border: none; border-radius: var(--r-md); padding: 7px 16px; cursor: pointer; font-size: 0.82rem; font-weight: 700; white-space: nowrap; }
.ai-debug-send:hover { filter: brightness(1.1); }
.ai-debug-send:disabled { opacity: 0.5; cursor: not-allowed; }

/* Info Bar */
.compiler-info-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 4px; font-size: 0.75rem; color: var(--text3); margin-top: 8px;
}
.ci-sep { opacity: 0.4; }
.ci-status { font-weight: 600; color: var(--text2); }
.ci-runtime { margin-left: auto; }

/* Mobile */
@media (max-width: 768px) {
  .compiler-ide { grid-template-columns: 1fr; height: auto; }
  .compiler-editor-panel { height: 320px; }
  .compiler-output-panel { height: 300px; }
  .compiler-tabs { gap: 4px; padding: 4px; }
  .compiler-tab { padding: 5px 10px; font-size: 0.78rem; }
  .ct-label { display: none; }
  .ct-icon { font-size: 1.1rem; }
  .compiler-title { font-size: 1.4rem; }
}

/* ── INTERNET TOGGLE ── */
.filter-row-bottom {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.internet-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
  background: var(--bg2, #1a1a2e);
  border: 1px solid var(--border, rgba(255,255,255,0.1));
  border-radius: 24px;
  padding: 6px 14px 6px 10px;
  transition: border-color 0.2s;
}
.internet-toggle-wrap:hover { border-color: var(--accent, #6366f1); }
.it-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text2, #aaa);
  white-space: nowrap;
}
.it-switch {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}
.it-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.it-slider {
  position: absolute;
  inset: 0;
  background: var(--red, #ef4444);
  border-radius: 22px;
  transition: background 0.25s;
  cursor: pointer;
}
.it-slider::before {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  left: 3px; top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.25s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.it-switch input:checked + .it-slider {
  background: var(--green, #10b981);
}
.it-switch input:checked + .it-slider::before {
  transform: translateX(18px);
}
.it-status {
  font-size: 0.75rem;
  font-weight: 700;
  min-width: 22px;
  color: var(--green, #10b981);
  transition: color 0.2s;
}
.it-status.off { color: var(--red, #ef4444); }

/* Blur effect for online tools when internet is OFF */
.tool-card.internet-disabled {
  opacity: 0.38;
  filter: blur(1.5px) grayscale(0.5);
  pointer-events: none;
  position: relative;
  transition: opacity 0.25s, filter 0.25s;
}
.tool-card.internet-disabled::after {
  content: '📵 Needs Internet';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--red, #ef4444);
  background: rgba(0,0,0,0.18);
  border-radius: inherit;
  letter-spacing: 0.02em;
  pointer-events: none;
}
/* Online indicator dot on tool cards */
.tc-online-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green, #10b981);
  flex-shrink: 0;
  box-shadow: 0 0 5px var(--green, #10b981);
  display: inline-block;
  margin-left: auto;
}
