/* =========================================================
   HackFolio — Global Styles (Dark Theme)
   ========================================================= */

:root {
  --bg-primary:  #0d1117;
  --bg-secondary:#161b22;
  --bg-tertiary: #141826;
  --bg-card: rgba(14, 18, 32, 0.85);
  --glass: rgba(255,255,255,0.05);
  --glass-border: rgba(255,255,255,0.08);
  --accent-1:    #6c63ff;
  --accent-2:    #00d4ff;
  --accent-3:    #ff6584;
  --accent-4:    #43e97b;
  --accent-gradient: linear-gradient(135deg, #6c63ff, #00d4ff);
  --accent-gradient2: linear-gradient(135deg, #ff6584, #6c63ff);
  --text-primary: #f0f4ff;
  --text-secondary: #8892b0;
  --text-muted: #4a5578;
  --sidebar-w: 240px;
  --sidebar-w-sm: 64px;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
  --transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
}

/* Light theme override */
body.light {
  --bg-primary: #f0f4ff;
  --bg-secondary: #e8ecf8;
  --bg-tertiary: #dde3f5;
  --bg-card: rgba(255,255,255,0.85);
  --glass: rgba(0,0,0,0.03);
  --glass-border: rgba(0,0,0,0.08);
  --text-primary: #1a1f3a;
  --text-secondary: #4a5578;
  --text-muted: #8892b0;
}

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

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
  transition: background 0.3s, color 0.3s;
}

/* =========================================================
   Canvas Background
   ========================================================= */
#bg-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* =========================================================
   Sidebar Navigation
   ========================================================= */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: rgba(8,11,20,0.95);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--glass-border);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  padding: 2rem 0;
  transition: var(--transition);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 1.5rem 2rem;
  border-bottom: 1px solid var(--glass-border);
}

.logo-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent-gradient);
  box-shadow: 0 0 12px var(--accent-1);
  animation: pulse 2s infinite;
}

.logo-text {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  list-style: none;
  padding: 1.5rem 0;
  flex: 1;
}

.nav-links li { margin: 4px 12px; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.nav-link::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%) scaleY(0);
  width: 3px; height: 70%;
  background: var(--accent-gradient);
  border-radius: 0 3px 3px 0;
  transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
  background: var(--glass);
}

.nav-link.active::before,
.nav-link:hover::before { transform: translateY(-50%) scaleY(1); }

.nav-icon {
  font-size: 1rem;
  width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--glass-border);
}

/* =========================================================
   Main Content
   ========================================================= */
.main-content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  position: relative;
  z-index: 1;
  transition: margin-left 0.3s;
}

/* =========================================================
   Pages
   ========================================================= */
.page {
  display: none;
  padding: 2rem 2.5rem;
  min-height: 100vh;
  animation: fadeIn 0.4s ease;
}

.page.active { display: block; }

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

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 700;
}

.page-subtitle {
  color: var(--text-secondary);
  margin-top: 0.25rem;
  font-size: 0.9rem;
}

/* =========================================================
   Hero Section
   ========================================================= */
.hero-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3rem;
  padding: 3rem 0 4rem;
  min-height: 85vh;
  position: relative;
}

.hero-particles { position: absolute; inset: 0; pointer-events: none; }

.hero-content { flex: 1; max-width: 600px; position: relative; z-index: 2; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(108,99,255,0.15);
  border: 1px solid rgba(108,99,255,0.3);
  color: #a39bff;
  padding: 6px 16px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  animation: slideDown 0.6s ease;
}

.hero-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1rem;
  animation: slideDown 0.7s ease;
}

.gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.15rem;
  color: var(--accent-2);
  margin-bottom: 1.25rem;
  height: 1.8rem;
  animation: slideDown 0.8s ease;
}

.cursor {
  display: inline-block;
  animation: blink 1s infinite;
  color: var(--accent-1);
}

@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

.hero-desc {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 2rem;
  animation: slideDown 10s ;
  /* animation: slideDown 0.9s ease; */
}

.hero-actions {
  display: flex;
  gap: 1rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
  animation: slideDown 1s ease;
}

.hero-stats {
  display: flex;
  gap: 2.5rem;
  animation: slideDown 1.1s ease;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-num {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

/* Hero Visual */
.hero-visual {
  flex-shrink: 0;
  position: relative;
  width: 380px;
  height: 380px;
  animation: fadeIn 1.2s ease;
}

.hero-avatar-ring {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}

.avatar-img {
  width: 140px; height: 140px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 800;
  color: white;
  position: relative;
  z-index: 3;
  box-shadow: 0 0 40px rgba(108,99,255,0.5);
}

.ring {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px solid transparent;
  animation: spinRing linear infinite;
}

.ring-1 { width: 180px; height: 180px; border-color: rgba(108,99,255,0.4); animation-duration: 10s; }
.ring-2 { width: 230px; height: 230px; border-color: rgba(0,212,255,0.25); animation-duration: 15s; animation-direction: reverse; }
.ring-3 { width: 290px; height: 290px; border-color: rgba(255,101,132,0.2); animation-duration: 20s; border-style: dashed; }

@keyframes spinRing { from{transform:translate(-50%,-50%) rotate(0)} to{transform:translate(-50%,-50%) rotate(360deg)} }

.skill-orbs {
  position: absolute;
  width: 100%; height: 100%;
  top: 0; left: 0;
}

.skill-orb {
  position: absolute;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--accent-2);
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  animation: orbitOrb calc(8s + var(--i, 0) * 2s) linear infinite;
}

.skill-orb:nth-child(1) { top: 5%; left: 40%; animation-delay: 0s; }
.skill-orb:nth-child(2) { top: 20%; left: 80%; animation-delay: -1s; }
.skill-orb:nth-child(3) { top: 60%; left: 85%; animation-delay: -2s; }
.skill-orb:nth-child(4) { top: 85%; left: 50%; animation-delay: -3s; }
.skill-orb:nth-child(5) { top: 65%; left: 5%; animation-delay: -4s; }
.skill-orb:nth-child(6) { top: 25%; left: 5%; animation-delay: -5s; }

@keyframes orbitOrb {
  0%  { transform: translateY(0); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0); }
}

/* Quick Feed */
.quick-feed {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  padding-bottom: 3rem;
}

.feed-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  transition: var(--transition);
  backdrop-filter: blur(10px);
}

.feed-card:hover {
  border-color: var(--accent-1);
  box-shadow: 0 8px 32px rgba(108,99,255,0.15);
  transform: translateY(-4px);
}

.feed-icon { font-size: 2rem; flex-shrink: 0; }

.feed-content { flex: 1; }
.feed-content h3 { font-size: 0.9rem; font-weight: 700; margin-bottom: 4px; color: var(--text-primary); }
.feed-content p { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.5; }

/* =========================================================
   Glass Card
   ========================================================= */
.glass-card {
  background: var(--glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: var(--transition);
}

.glass-card:hover {
  border-color: rgba(108,99,255,0.3);
  box-shadow: var(--shadow);
}

/* =========================================================
   Buttons
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 4px 20px rgba(108,99,255,0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(108,99,255,0.5);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
}

.btn-outline:hover {
  border-color: var(--accent-1);
  color: var(--accent-1);
  background: rgba(108,99,255,0.08);
}

.btn-sm { padding: 7px 14px; font-size: 0.8rem; }

/* =========================================================
   Input Fields
   ========================================================= */
.input-field {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  transition: var(--transition);
  margin-bottom: 12px;
  outline: none;
}

.input-field:focus {
  border-color: var(--accent-1);
  box-shadow: 0 0 0 3px rgba(108,99,255,0.15);
  background: rgba(108,99,255,0.05);
}

.input-field::placeholder { color: var(--text-muted); }

select.input-field { cursor: pointer; }
select.input-field option { background: var(--bg-secondary); }

textarea.input-field { resize: vertical; min-height: 100px; }

/* =========================================================
   Profile Page
   ========================================================= */
.profile-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 2rem;
  align-items: start;
}

.profile-card {
  text-align: center;
  position: sticky;
  top: 2rem;
}

.profile-avatar-wrap {
  position: relative;
  display: inline-block;
  margin-bottom: 1rem;
}

.profile-avatar {
  width: 100px; height: 100px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 800;
  color: white;
  margin: 0 auto;
  box-shadow: 0 0 30px rgba(108,99,255,0.4);
}

.online-dot {
  position: absolute;
  bottom: 4px; right: 4px;
  width: 14px; height: 14px;
  background: var(--accent-4);
  border-radius: 50%;
  border: 3px solid var(--bg-secondary);
  box-shadow: 0 0 8px var(--accent-4);
}

.profile-role {
  color: var(--accent-2);
  font-size: 0.9rem;
  margin: 4px 0;
}

.profile-location {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin: 4px 0 1rem;
}

.social-links {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.social-link {
  background: rgba(108,99,255,0.12);
  border: 1px solid rgba(108,99,255,0.3);
  color: var(--accent-1);
  padding: 5px 14px;
  border-radius: 50px;
  font-size: 0.8rem;
  text-decoration: none;
  transition: var(--transition);
}

.social-link:hover {
  background: rgba(108,99,255,0.25);
  transform: translateY(-2px);
}

.profile-contact { color: var(--text-secondary); font-size: 0.85rem; }

.profile-details { display: flex; flex-direction: column; gap: 1.5rem; }

.about-card h3, .skills-card h3, .exp-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.skills-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 1rem;
}

.skill-tag {
  background: rgba(108,99,255,0.12);
  border: 1px solid rgba(108,99,255,0.25);
  color: var(--accent-1);
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.skill-tag:hover {
  background: rgba(255,101,132,0.15);
  border-color: var(--accent-3);
  color: var(--accent-3);
}

.add-skill-row { display: flex; gap: 8px; align-items: center; }
.add-skill-row .input-field { margin-bottom: 0; flex: 1; }

.timeline { display: flex; flex-direction: column; gap: 1.5rem; margin-bottom: 1rem; }

.timeline-item {
  display: flex;
  gap: 1rem;
  position: relative;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 24px;
  bottom: -24px;
  width: 1px;
  background: var(--glass-border);
}

.timeline-item:last-child::before { display: none; }

.timeline-dot {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--accent-gradient);
  flex-shrink: 0;
  margin-top: 4px;
  box-shadow: 0 0 8px var(--accent-1);
}

.timeline-content h4 { font-size: 0.95rem; margin-bottom: 4px; }

.timeline-date {
  font-size: 0.75rem;
  color: var(--accent-2);
  display: block;
  margin-bottom: 4px;
}

.timeline-content p { font-size: 0.85rem; color: var(--text-secondary); }

/* =========================================================
   Achievements Page
   ========================================================= */
.achievements-filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.filter-btn {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  padding: 8px 18px;
  border-radius: 50px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  transition: var(--transition);
}

.filter-btn:hover, .filter-btn.active {
  background: rgba(108,99,255,0.2);
  border-color: var(--accent-1);
  color: var(--accent-1);
}

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

.achieve-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.achieve-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent-gradient);
}

.achieve-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(108,99,255,0.2);
  border-color: rgba(108,99,255,0.4);
}

.achieve-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.achieve-category {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent-2);
  margin-bottom: 0.5rem;
}
.achieve-title { font-size: 1rem; font-weight: 700; margin-bottom: 0.5rem; }
.achieve-org { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 0.5rem; }
.achieve-desc { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.6; }
.achieve-date { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.75rem; }
.achieve-delete {
  position: absolute;
  top: 12px; right: 12px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  transition: var(--transition);
  opacity: 0;
}
.achieve-card:hover .achieve-delete { opacity: 1; }
.achieve-delete:hover { color: var(--accent-3); }

/* =========================================================
   Blog Page
   ========================================================= */
.blog-search-row {
  display: flex;
  gap: 12px;
  margin-bottom: 2rem;
}

.search-input { flex: 1; margin-bottom: 0; }

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

.blog-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
  cursor: pointer;
}

.blog-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.3);
  border-color: rgba(108,99,255,0.4);
}

.blog-card-header {
  padding: 1.5rem;
  background: linear-gradient(135deg, rgba(108,99,255,0.1), rgba(0,212,255,0.05));
  border-bottom: 1px solid var(--glass-border);
}

.blog-tag {
  display: inline-block;
  background: rgba(108,99,255,0.2);
  color: var(--accent-1);
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.75rem;
}

.blog-card-title { font-size: 1.05rem; font-weight: 700; line-height: 1.4; }

.blog-card-body { padding: 1.5rem; }
.blog-card-excerpt { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.7; margin-bottom: 1rem; }
.blog-card-footer { display: flex; align-items: center; justify-content: space-between; font-size: 0.78rem; color: var(--text-muted); }

.blog-actions { display: flex; gap: 8px; }
.blog-action-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.8rem;
  padding: 4px 8px;
  border-radius: 6px;
}
.blog-action-btn:hover { color: var(--accent-3); background: rgba(255,101,132,0.1); }

/* Blog Editor */
.editor-toolbar {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  margin-bottom: -1px;
}

.editor-toolbar button {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.82rem;
  transition: var(--transition);
}

.editor-toolbar button:hover {
  background: rgba(108,99,255,0.15);
  color: var(--accent-1);
  border-color: var(--accent-1);
}

.preview-btn { margin-left: auto; }

.blog-editor { border-radius: 0 0 var(--radius-sm) var(--radius-sm) !important; font-family: 'JetBrains Mono', monospace; }

.blog-preview {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 1.5rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

.blog-preview.hidden { display: none; }

.blog-read-content {
  color: var(--text-secondary);
  line-height: 1.9;
  font-size: 0.95rem;
}

.blog-read-content h1,h2,h3 { color: var(--text-primary); margin: 1.5rem 0 0.75rem; }
.blog-read-content code {
  background: rgba(108,99,255,0.15);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent-2);
}

.blog-meta-info {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--glass-border);
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* =========================================================
   News Page
   ========================================================= */
.news-tabs { display: flex; gap: 8px; flex-wrap: wrap; }

.news-ticker {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,101,132,0.1);
  border: 1px solid rgba(255,101,132,0.2);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  margin: 1rem 0 2rem;
  overflow: hidden;
}

.ticker-label {
  background: var(--accent-3);
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
  animation: pulse 1.5s infinite;
}

.ticker-content {
  font-size: 0.85rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.news-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
}

.news-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.3);
  border-color: rgba(0,212,255,0.3);
}

.news-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
  background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-secondary));
}

.news-img-placeholder {
  width: 100%;
  height: 160px;
  background: linear-gradient(135deg, rgba(108,99,255,0.15), rgba(0,212,255,0.1));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

.news-body { padding: 1.25rem; }
.news-source {
  font-size: 0.7rem;
  color: var(--accent-2);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}
.news-title { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.5rem; line-height: 1.4; }
.news-desc { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.6; margin-bottom: 1rem; }
.news-footer { display: flex; align-items: center; justify-content: space-between; font-size: 0.75rem; color: var(--text-muted); }
.news-read-btn {
  font-size: 0.78rem;
  color: var(--accent-1);
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: var(--transition);
}
.news-read-btn:hover { color: var(--accent-2); }

/* =========================================================
   Jobs Page
   ========================================================= */
.jobs-search-row {
  display: flex;
  gap: 12px;
  margin-bottom: 1.5rem;
}

.jobs-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.job-stat-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.job-stat-num {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.job-stat-card span:last-child { font-size: 0.8rem; color: var(--text-secondary); }

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

.job-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
}

.job-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.3);
  border-color: rgba(108,99,255,0.3);
}

.job-card-top {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.company-logo {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
  font-weight: 800;
  color: white;
}

.job-title { font-size: 1rem; font-weight: 700; margin-bottom: 2px; }
.job-company { font-size: 0.85rem; color: var(--accent-2); }

.job-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 1rem; }
.job-tag {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.job-tag.remote { background: rgba(67,233,123,0.1); border-color: rgba(67,233,123,0.3); color: var(--accent-4); }
.job-tag.hot { background: rgba(255,101,132,0.1); border-color: rgba(255,101,132,0.3); color: var(--accent-3); }

.job-footer { display: flex; align-items: center; justify-content: space-between; }
.job-salary { font-size: 0.9rem; font-weight: 700; color: var(--accent-4); }
.job-date { font-size: 0.75rem; color: var(--text-muted); }

/* =========================================================
   3D Game Page
   ========================================================= */
.game-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  align-items: start;
}

.game-canvas-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  aspect-ratio: 1;
  max-width: 600px;
  position: relative;
}

#game-canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
  cursor: pointer;
}

.game-score {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--glass-border);
}

.score-box {
  flex: 1;
  text-align: center;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.03);
  border: 1px solid transparent;
  transition: var(--transition);
}

.score-box.active { border-color: var(--accent-1); background: rgba(108,99,255,0.1); }

.player-symbol { font-size: 1.8rem; font-weight: 900; line-height: 1; margin-bottom: 4px; }
.x-symbol { color: var(--accent-1); }
.o-symbol { color: var(--accent-3); }
.player-name { font-size: 0.75rem; color: var(--text-muted); }
.score-num {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.score-divider { text-align: center; flex-shrink: 0; }
.vs-text { font-size: 0.8rem; font-weight: 700; color: var(--text-muted); margin-bottom: 4px; }
.draw-count { font-size: 0.7rem; color: var(--text-muted); }

.game-status {
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: rgba(108,99,255,0.1);
  color: var(--accent-1);
  margin-bottom: 1.5rem;
  border: 1px solid rgba(108,99,255,0.2);
  transition: var(--transition);
}

.game-controls { display: flex; flex-direction: column; gap: 8px; margin-bottom: 1.5rem; }
.game-controls .btn { width: 100%; justify-content: center; }

.difficulty-selector { margin-bottom: 1.5rem; }
.difficulty-selector h4 { font-size: 0.85rem; margin-bottom: 0.75rem; color: var(--text-secondary); }
.diff-buttons { display: flex; gap: 8px; }
.diff-btn {
  flex: 1;
  padding: 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  transition: var(--transition);
}
.diff-btn.active, .diff-btn:hover {
  background: rgba(108,99,255,0.15);
  border-color: var(--accent-1);
  color: var(--accent-1);
}

.game-log h4 { font-size: 0.85rem; margin-bottom: 0.75rem; color: var(--text-secondary); }
.game-log ul { list-style: none; display: flex; flex-direction: column; gap: 6px; max-height: 200px; overflow-y: auto; }
.game-log ul li {
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 6px 10px;
  background: rgba(255,255,255,0.03);
  border-radius: 6px;
  border-left: 2px solid var(--accent-1);
}

/* =========================================================
   Modals
   ========================================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}

.modal-overlay.open { display: flex; }

.modal {
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.modal-lg { max-width: 720px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--glass-border);
}

.modal-header h3 { font-size: 1.1rem; font-weight: 700; }

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.2rem;
  transition: var(--transition);
  width: 32px; height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.modal-close:hover {
  background: rgba(255,101,132,0.15);
  color: var(--accent-3);
}

.modal-body { margin-bottom: 1.5rem; }

.modal-footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding-top: 1rem;
  border-top: 1px solid var(--glass-border);
}

/* =========================================================
   Toast
   ========================================================= */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  color: var(--text-primary);
  z-index: 9999;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4,0,0.2,1);
  box-shadow: var(--shadow);
  max-width: 300px;
}

.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-color: var(--accent-4); }
.toast.error { border-color: var(--accent-3); }

/* =========================================================
   Hamburger + Mobile
   ========================================================= */
.hamburger {
  display: none;
  position: fixed;
  top: 1.25rem;
  left: 1.25rem;
  z-index: 1100;
  flex-direction: column;
  gap: 5px;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
}

.hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: var(--transition);
}

/* =========================================================
   Theme Toggle
   ========================================================= */
.theme-toggle {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  width: 100%;
  padding: 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1.2rem;
  transition: var(--transition);
}

.theme-toggle:hover { background: rgba(108,99,255,0.15); }

/* =========================================================
   Animations
   ========================================================= */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =========================================================
   Scrollbar
   ========================================================= */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--accent-1); border-radius: 3px; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1100px) {
  .hero-section { flex-direction: column; min-height: auto; padding: 2rem 0 3rem; }
  .hero-visual { width: 280px; height: 280px; }
  .profile-grid { grid-template-columns: 1fr; }
  .profile-card { position: static; }
  .game-layout { grid-template-columns: 1fr; }
  .game-canvas-wrap { max-width: 500px; width: 100%; margin: 0 auto; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-w);
  }
  .sidebar.open { transform: translateX(0); }
  .hamburger { display: flex; }
  .main-content { margin-left: 0; }
  .page { padding: 1.5rem 1rem; padding-top: 5rem; }
  .hero-title { font-size: 2.2rem; }
  .hero-stats { gap: 1.5rem; }
  .blog-grid, .achievements-grid, .news-grid, .jobs-grid { grid-template-columns: 1fr; }
  .jobs-stats-row { grid-template-columns: repeat(3, 1fr); }
  .blog-search-row, .jobs-search-row { flex-direction: column; }
  .modal { margin: 1rem; }
  .skill-orbs { display: none; }
}

@media (max-width: 480px) {
  .hero-actions { flex-direction: column; }
  .hero-stats { gap: 1rem; }
  .jobs-stats-row { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .news-tabs { width: 100%; }
}

/* =========================================================
   TERMINAL EMULATOR
   ========================================================= */
.terminal-container {
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.05);
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  min-height: 520px;
  display: flex;
  flex-direction: column;
}

.terminal-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: #161b22;
  border-bottom: 1px solid #30363d;
  flex-shrink: 0;
}

.terminal-dots { display: flex; gap: 6px; }
.t-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  cursor: pointer;
  transition: opacity 0.2s;
  flex-shrink: 0;
}
.t-dot:hover { opacity: 0.8; }

.terminal-title {
  flex: 1;
  text-align: center;
  font-size: 0.75rem;
  color: #8b949e;
  font-family: 'JetBrains Mono', monospace;
}

.terminal-output {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  min-height: 400px;
  max-height: 60vh;
  line-height: 1.6;
  font-size: 0.85rem;
}

.terminal-input-row {
  display: flex;
  align-items: center;
  padding: 10px 16px 14px;
  border-top: 1px solid #21262d;
  gap: 0;
  background: #0d1117;
  flex-shrink: 0;
}

.terminal-prompt {
  font-size: 0.85rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.terminal-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #e6edf3;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  caret-color: #58a6ff;
  padding: 0 4px;
}

/* Terminal color classes */
.t-user     { color: #3fb950; font-weight: 700; }
.t-at       { color: #8b949e; }
.t-host     { color: #3fb950; font-weight: 700; }
.t-colon    { color: #8b949e; }
.t-path     { color: #58a6ff; font-weight: 600; }
.t-dollar   { color: #e6edf3; margin-right: 4px; }
.t-cmd-text { color: #e6edf3; }

.t-line     { margin: 1px 0; }
.t-prompt-line { display: flex; align-items: baseline; flex-wrap: wrap; }

/* Output types */
.t-success  { color: #3fb950; }
.t-error    { color: #f85149; }
.t-info     { color: #58a6ff; }
.t-muted    { color: #8b949e; }
.t-output   { color: #e6edf3; }
.t-key      { color: #79c0ff; }
.t-val      { color: #a5d6ff; }
.t-match    { background: rgba(255,215,0,0.25); color: #ffd700; padding: 0 2px; border-radius: 2px; }
.t-cmd      { color: #ffa657; font-weight: 600; }

/* LS colors */
.t-dir      { color: #58a6ff; font-weight: 700; }
.t-file     { color: #e6edf3; }
.t-hidden   { color: #8b949e; }

/* Code blocks */
.t-code {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 12px;
  font-size: 0.8rem;
  overflow-x: auto;
  color: #e6edf3;
  margin: 4px 0;
  white-space: pre-wrap;
  word-break: break-word;
}
.t-json { color: #a5d6ff; }
.t-md   { color: #e6edf3; }
.t-man  { color: #ffa657; }
.t-banner { color: #3fb950; font-size: 0.75rem; line-height: 1.3; }

/* LS grid */
.t-ls-grid { display: flex; flex-wrap: wrap; gap: 8px 24px; padding: 4px 0; }
.t-ls-long { line-height: 1.8; }

/* Tree */
.t-tree { color: #e6edf3; font-size: 0.82rem; line-height: 1.7; }

/* Neofetch */
.t-neofetch { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; }
.t-ascii-logo { line-height: 1.3; font-size: 0.7rem; white-space: pre; }
.t-nf-c1 { color: #6c63ff; } .t-nf-c2 { color: #7b72ff; }
.t-nf-c3 { color: #8a80ff; } .t-nf-c4 { color: #9a90ff; }
.t-nf-c5 { color: #a9a0ff; } .t-nf-c6 { color: #b8b0ff; }
.t-nf-info { line-height: 1.9; font-size: 0.82rem; }
.t-nf-sep  { color: #30363d; margin: 2px 0; }
.t-color-blocks { display: flex; gap: 2px; margin-top: 8px; }
.t-color-blocks span { width: 20px; height: 12px; display: inline-block; border-radius: 2px; }

/* Matrix */
.t-matrix { font-size: 0.75rem; line-height: 1.3; color: #3fb950; }
.matrix-char { display: inline; transition: color 0.1s; }
.matrix-head { color: #ffffff; font-weight: 700; }

/* Welcome */
.t-welcome { margin-bottom: 8px; }
.t-ascii { font-size: 0.55rem; line-height: 1.2; white-space: pre; color: #6c63ff; }
.t-info { color: #8b949e; font-size: 0.8rem; margin-top: 4px; }

/* Help */
.t-help { line-height: 1.8; font-size: 0.82rem; }
.t-help-title { color: #3fb950; font-size: 0.95rem; font-weight: 700; margin-bottom: 12px; border-bottom: 1px solid #30363d; padding-bottom: 8px; }
.t-help-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.t-help-section { display: flex; flex-direction: column; gap: 3px; }
.t-section-title { color: #ffa657; font-weight: 700; margin-bottom: 6px; }
.t-help-tips { margin-top: 12px; padding-top: 8px; border-top: 1px solid #30363d; color: #8b949e; font-size: 0.78rem; }

/* REPL prompts */
.t-node-prompt   { color: #3fb950; font-weight: 700; }
.t-python-prompt { color: #58a6ff; font-weight: 700; }

.t-exit { text-align: center; padding: 1rem; }

/* =========================================================
   API LOADING STATES
   ========================================================= */
.api-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  color: var(--text-muted);
  padding: 2rem 0;
}

.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--glass-border);
  border-top-color: var(--accent-1);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.api-source-badge {
  grid-column: 1 / -1;
  background: rgba(67,233,123,0.1);
  border: 1px solid rgba(67,233,123,0.25);
  color: var(--accent-4);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* =========================================================
   HELP / CONTACT WIDGET
   ========================================================= */
.help-widget {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1500;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1rem;
}

.help-fab {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-gradient);
  border: none;
  border-radius: 50px;
  padding: 12px 20px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  color: white;
  box-shadow: 0 8px 28px rgba(108,99,255,0.5);
  transition: var(--transition);
  position: relative;
}

.help-fab:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 14px 36px rgba(108,99,255,0.6);
}

.help-fab-icon { font-size: 1.1rem; }

.help-notif {
  position: absolute;
  top: -4px; right: -4px;
  width: 10px; height: 10px;
  background: var(--accent-3);
  border-radius: 50%;
  border: 2px solid var(--bg-primary);
  animation: pulse 2s infinite;
}

.help-panel {
  display: none;
  flex-direction: column;
  width: 360px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  animation: slideUpIn 0.3s cubic-bezier(0.34,1.56,0.64,1);
}

.help-panel.open { display: flex; }

@keyframes slideUpIn {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0)  scale(1); }
}

.help-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.25rem;
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
}

.help-header h3 { font-size: 1rem; font-weight: 700; }

.help-body { padding: 1.25rem; display: flex; flex-direction: column; gap: 1rem; }

.help-quick-links {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.help-ql-btn {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
}

.help-ql-btn:hover {
  background: rgba(108,99,255,0.15);
  border-color: var(--accent-1);
  color: var(--accent-1);
  transform: translateY(-2px);
}

.help-tabs {
  display: flex;
  gap: 4px;
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius-sm);
  padding: 4px;
}

.help-tab {
  flex: 1;
  padding: 7px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  transition: var(--transition);
}

.help-tab.active {
  background: var(--accent-gradient);
  color: white;
}

.help-tab-content { display: flex; flex-direction: column; gap: 8px; }
.help-tab-content.hidden { display: none; }

.help-form { display: flex; flex-direction: column; gap: 8px; }
.help-form .input-field { margin-bottom: 0; font-size: 0.85rem; padding: 10px 12px; }

/* FAQ */
.faq-list { display: flex; flex-direction: column; gap: 8px; }

.faq-item {
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.faq-q {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--glass);
  transition: var(--transition);
  user-select: none;
}

.faq-q:hover { background: rgba(108,99,255,0.08); }
.faq-q.open { color: var(--accent-1); }

.faq-a {
  padding: 0 14px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-a.open {
  max-height: 120px;
  padding: 10px 14px;
  border-top: 1px solid var(--glass-border);
}

@media (max-width: 480px) {
  .help-panel { width: calc(100vw - 3rem); }
  .help-widget { bottom: 1rem; right: 1rem; }
  .help-fab-label { display: none; }
}

/* =========================================================
   ANALYTICS PAGE
   ========================================================= */
.anl-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.anl-stat {
  text-align: center;
  padding: 1.4rem 1rem;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}
.anl-stat:hover { transform: translateY(-4px); }

.anl-stat-icon { font-size: 1.8rem; }
.anl-stat-val  { font-family: 'Space Grotesk', sans-serif; font-size: 1.5rem; font-weight: 800; color: var(--text-primary); }
.anl-stat-lbl  { font-size: 0.75rem; color: var(--text-muted); font-weight: 500; }

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

.anl-card { padding: 1.25rem; }
.anl-card-title { font-size: 0.95rem; font-weight: 700; margin-bottom: 1rem; color: var(--text-primary); }

/* Visit log rows */
.visit-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--glass-border);
}
.visit-row:last-child { border-bottom: none; }
.visit-num     { font-family: 'Space Grotesk', monospace; font-size: 0.8rem; font-weight: 700; color: var(--accent-1); min-width: 28px; }
.visit-details { flex: 1; }
.visit-time    { font-size: 0.82rem; font-weight: 600; color: var(--text-primary); }
.visit-meta    { font-size: 0.75rem; color: var(--text-secondary); margin-top: 2px; }
.visit-ref     { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; word-break: break-all; }
.visit-screen  { font-size: 0.72rem; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; flex-shrink: 0; }

/* Breakdown bars */
.bd-row   { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.bd-label { font-size: 0.82rem; font-weight: 600; min-width: 70px; color: var(--text-secondary); }
.bd-bar   { flex: 1; height: 8px; background: rgba(255,255,255,0.06); border-radius: 4px; overflow: hidden; }
.bd-fill  { height: 100%; border-radius: 4px; transition: width 0.6s cubic-bezier(0.4,0,0.2,1); }
.bd-pct   { font-size: 0.75rem; color: var(--text-muted); min-width: 36px; text-align: right; }

/* Session info */
.sess-row  { display: flex; justify-content: space-between; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--glass-border); font-size: 0.82rem; }
.sess-row:last-child { border-bottom: none; }
.sess-key  { color: var(--text-muted); font-weight: 600; flex-shrink: 0; }
.sess-val  { color: var(--text-primary); font-family: 'JetBrains Mono', monospace; font-size: 0.78rem; word-break: break-all; text-align: right; }

/* =========================================================
   TOOLS PAGE
   ========================================================= */
.tools-card {
  margin-bottom: 1.5rem;
  padding: 1.5rem;
}

.tools-card-hdr {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--glass-border);
}

.tools-card-ico {
  width: 50px; height: 50px;
  border-radius: 14px;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(108,99,255,0.35);
}

.tools-card-hdr h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 4px; }
.tools-desc { font-size: 0.82rem; color: var(--text-muted); }

.tool-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 1rem;
}
.tool-row .input-field { flex: 1; margin-bottom: 0; }

/* Image downloader preview */
.img-preview-area { min-height: 40px; }

.dl-result {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  margin-top: .5rem;
  flex-wrap: wrap;
}

.dl-preview-img {
  max-width: 200px;
  max-height: 140px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
}

.dl-info { display: flex; flex-direction: column; gap: 8px; }

.dl-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(67,233,123,0.12);
  color: var(--accent-4);
  border: 1px solid rgba(67,233,123,0.25);
}

/* GitHub card */
.gh-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-top: 0.75rem;
  animation: fadeIn 0.35s ease;
}

.gh-card-top {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.gh-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  border: 3px solid var(--accent-1);
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 0 20px rgba(108,99,255,0.4);
}

.gh-card-info { flex: 1; }
.gh-name  { font-size: 1.1rem; font-weight: 800; color: var(--text-primary); }
.gh-login { font-size: 0.85rem; color: var(--accent-1); font-family: 'JetBrains Mono', monospace; margin-top: 2px; }
.gh-bio   { font-size: 0.82rem; color: var(--text-secondary); margin-top: 6px; line-height: 1.5; }
.gh-loc   { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }

.gh-stats-row {
  display: flex;
  gap: 0;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.gh-stat {
  flex: 1;
  text-align: center;
  padding: 12px 8px;
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.gh-stat:last-child { border-right: none; }
.gh-stat strong { font-family: 'Space Grotesk', sans-serif; font-size: 1.1rem; font-weight: 800; color: var(--text-primary); }
.gh-stat small  { font-size: 0.7rem; color: var(--text-muted); }

.gh-top {
  font-size: 0.82rem;
  color: var(--text-secondary);
  padding: 8px 10px;
  background: rgba(108,99,255,0.06);
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
}
.gh-top a { color: var(--accent-1); text-decoration: none; font-weight: 600; }
.gh-top a:hover { text-decoration: underline; }

/* Social Connectors Grid */
.sc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 0.5rem;
}

.sc-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
}
.sc-card:hover {
  background: rgba(108,99,255,0.08);
  border-color: rgba(108,99,255,0.35);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(108,99,255,0.15);
}

.sc-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.sc-body  { flex: 1; min-width: 0; }
.sc-name  { font-size: 0.88rem; font-weight: 700; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-desc  { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }
.sc-btn   { font-size: 0.72rem; color: var(--accent-1); font-weight: 600; white-space: nowrap; flex-shrink: 0; }

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

@media (max-width: 768px) {
  .anl-grid       { grid-template-columns: 1fr; }
  .anl-stats-row  { grid-template-columns: repeat(2, 1fr); }
  .sc-grid        { grid-template-columns: 1fr; }
  .tool-row       { flex-direction: column; }
  .tool-row .input-field { width: 100%; }
  .tool-row .btn  { width: 100%; justify-content: center; }
}
