/* ══════════════════════════════════════════════════
   style.css — Angetic Dev Solutions
   IDE-themed dark website stylesheet
   ══════════════════════════════════════════════════ */

/* ─── CSS Custom Properties ─────────────────────── */
:root {
  --bg:           #0d1117;
  --bg-panel:     #161b22;
  --bg-sidebar:   #010409;
  --bg-active:    #1f2937;
  --border:       #30363d;
  --border-light: #21262d;

  --cyan:   #38bdf8;
  --green:  #4ade80;
  --purple: #a78bfa;
  --orange: #fb923c;
  --red:    #f87171;
  --yellow: #fbbf24;

  --comment: #6e7681;
  --string:  #a5d6ff;
  --keyword: #ff7b72;
  --fn:      #d2a8ff;
  --var:     #ffa657;
  --num:     #79c0ff;
  --op:      #e6edf3;

  --sidebar-w: 52px;
  --console-h: 160px;
}

/* ─── Reset & Base ───────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--op);
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
}

/* ─── Scrollbars ─────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #484f58; }
.scrollbar-hide::-webkit-scrollbar { display: none; }

/* ═══════════════════════════════════════════════════
   LOADER
   ═══════════════════════════════════════════════════ */
#loader {
  background: var(--bg);
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
#loader.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.loader-bar { background: var(--border); }
#loader-text {
  font-size: 11px;
  color: var(--comment);
  letter-spacing: 0.05em;
  min-height: 1.2em;
}

/* ═══════════════════════════════════════════════════
   TOPBAR TABS
   ═══════════════════════════════════════════════════ */
#topbar { transition: opacity 0.5s ease; }

.tab-item {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 16px;
  font-size: 12px;
  color: var(--comment);
  border-right: 1px solid var(--border);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s, background 0.2s;
  position: relative;
}
.tab-item:hover { color: var(--op); background: rgba(255,255,255,0.03); }
.tab-item.active {
  color: var(--op);
  background: var(--bg);
  border-bottom: 1px solid var(--bg); /* hides bottom border to merge with editor */
}
.tab-item.active::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: var(--cyan);
}
.tab-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--comment);
  flex-shrink: 0;
  transition: background 0.2s;
}
.tab-item.active .tab-dot { background: var(--cyan); }

/* ═══════════════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  transition: transform 0.25s cubic-bezier(0.4,0,0.2,1);
}

/* Mobile: slide in/out */
@media (max-width: 639px) {
  .sidebar {
    position: fixed;
    top: 36px; /* below topbar */
    left: 0;
    bottom: 0;
    width: 200px;
    z-index: 25;
    transform: translateX(-100%);
    border-right: 1px solid var(--border);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  /* Show labels on mobile expanded sidebar */
  .sidebar.open .nav-label {
    display: block;
  }
  .sidebar.open {
    width: 200px;
  }
  .sidebar.open .nav-btn {
    flex-direction: row;
    width: 100%;
    justify-content: flex-start;
    padding: 10px 16px;
    gap: 12px;
    border-radius: 0;
  }
}

/* Nav buttons */
.nav-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--comment);
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
  outline: none;
}
.nav-btn:hover {
  color: var(--op);
  background: rgba(255,255,255,0.06);
}
.nav-btn.active {
  color: var(--cyan);
}
/* Active indicator bar on left */
.nav-btn.active::before {
  content: '';
  position: absolute;
  left: -2px;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 20px;
  background: var(--cyan);
  border-radius: 1px;
}
/* Tooltip on desktop */
.nav-btn[title]:not(.open):hover::after {
  content: attr(title);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  color: var(--op);
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  z-index: 100;
  pointer-events: none;
}
.nav-label {
  display: none;
  font-size: 12px;
  margin-top: 2px;
}

/* ═══════════════════════════════════════════════════
   LINE NUMBERS
   ═══════════════════════════════════════════════════ */
.line-numbers {
  width: 52px;
  background: var(--bg);
  user-select: none;
  font-size: 12px;
  line-height: 1.5rem; /* 24px matches code-line */
  padding-top: 1rem;
  padding-bottom: 1rem;
  color: var(--comment);
  border-right: 1px solid var(--border-light);
}

/* ═══════════════════════════════════════════════════
   CODE LINES
   ═══════════════════════════════════════════════════ */
.code-line {
  line-height: 1.5rem;
  font-size: 13px;
  min-height: 1.5rem;
  padding: 0 4px;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ─── Syntax Colors ──────────────────────────────── */
.text-editor-comment { color: var(--comment); }
.text-editor-string  { color: var(--string); }
.text-editor-keyword { color: var(--keyword); }
.text-editor-fn      { color: var(--fn); }
.text-editor-var     { color: var(--var); }
.text-editor-num     { color: var(--num); }
.text-editor-op      { color: var(--op); }

/* ─── Cursor Blink ───────────────────────────────── */
.cursor-blink {
  display: inline-block;
  width: 2px;
  color: var(--cyan);
  animation: blink 1s step-end infinite;
  font-weight: 100;
  margin-left: 1px;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ═══════════════════════════════════════════════════
   SECTIONS
   ═══════════════════════════════════════════════════ */
.section { display: none; }
.section.active { display: block; }

/* Section transition */
.section.fade-in {
  animation: fadeSlide 0.3s ease forwards;
}
@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════
   HERO CARD
   ═══════════════════════════════════════════════════ */
.hero-card {
  background: linear-gradient(135deg, var(--bg-panel) 0%, rgba(56,189,248,0.04) 100%);
  box-shadow: 0 0 0 1px var(--border), 0 8px 40px rgba(0,0,0,0.4);
  transition: box-shadow 0.3s;
}
.hero-card:hover {
  box-shadow: 0 0 0 1px rgba(56,189,248,0.3), 0 12px 50px rgba(56,189,248,0.08);
}
.hero-grid {
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 32px 32px;
}

/* ═══════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  background: var(--cyan);
  color: #0d1117;
  border: none;
  border-radius: 8px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 0 0 0 rgba(56,189,248,0.4);
  letter-spacing: 0.02em;
}
.btn-primary:hover {
  background: #7dd3fc;
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(56,189,248,0.3);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  background: transparent;
  color: var(--op);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}
.btn-secondary:hover {
  border-color: var(--cyan);
  background: rgba(56,189,248,0.06);
  transform: translateY(-1px);
}

/* ═══════════════════════════════════════════════════
   STAT CARDS
   ═══════════════════════════════════════════════════ */
.stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-align: center;
  transition: border-color 0.2s, transform 0.2s;
}
.stat-card:hover {
  border-color: var(--cyan);
  transform: translateY(-2px);
}
.stat-num {
  font-family: "Rajdhani", sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--cyan);
  line-height: 1;
  margin-bottom: 4px;
}
.stat-label {
  font-size: 10px;
  color: var(--comment);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ═══════════════════════════════════════════════════
   SERVICE CARDS
   ═══════════════════════════════════════════════════ */
.service-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
  position: relative;
  overflow: hidden;
}
.service-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent, var(--cyan));
  opacity: 0;
  transition: opacity 0.3s;
}
.service-card:hover {
  border-color: var(--accent, var(--cyan));
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}
.service-card:hover::before { opacity: 1; }
.service-icon {
  width: 48px; height: 48px;
  background: var(--bg-active);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}

/* Tech badges */
.tech-badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  transition: background 0.2s;
}
.tech-badge:hover { background: rgba(255,255,255,0.1); }

/* ═══════════════════════════════════════════════════
   PROJECT CARDS
   ═══════════════════════════════════════════════════ */
.project-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}
.project-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 35px rgba(0,0,0,0.4);
  border-color: rgba(56,189,248,0.3);
}
.project-header {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  background: var(--bg-active);
  border-bottom: 1px solid var(--border);
}
.project-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-right: 5px;
  opacity: 0.8;
}
.project-body { padding: 16px; }

/* Tags */
.tag {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(56,189,248,0.08);
  border: 1px solid rgba(56,189,248,0.15);
  color: var(--cyan);
}

/* ═══════════════════════════════════════════════════
   ABOUT SECTION
   ═══════════════════════════════════════════════════ */
.value-card {
  padding: 20px;
  background: var(--bg-active);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color 0.2s;
}
.value-card:hover { border-color: var(--cyan); }

.stack-item {
  font-size: 11px;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.03);
  color: var(--c, var(--cyan));
  border-color: var(--c, var(--cyan));
  opacity: 0.8;
  transition: opacity 0.2s, transform 0.2s;
}
.stack-item:hover { opacity: 1; transform: scale(1.05); }

/* ═══════════════════════════════════════════════════
   TERMINAL / CONTACT FORM
   ═══════════════════════════════════════════════════ */
.terminal-wrap {
  box-shadow: 0 0 0 1px var(--border), 0 20px 60px rgba(0,0,0,0.5);
}

.terminal-prompt {
  color: var(--comment);
  font-size: 11px;
  margin-bottom: 6px;
}
.terminal-prompt::before {
  content: '> ';
  color: var(--green);
}

.terminal-input {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--op);
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  outline: none;
  width: 100%;
  padding: 6px 0;
  transition: border-color 0.2s;
  appearance: none;
}
.terminal-input::placeholder { color: var(--comment); opacity: 0.6; }
.terminal-input:focus { border-color: var(--cyan); }
.terminal-input option { background: var(--bg-panel); }

/* ─── Social links ───────────────────────────────── */
.social-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 0.2s, transform 0.2s;
}
.social-link:hover { opacity: 1; transform: translateX(3px); }

/* ═══════════════════════════════════════════════════
   CONSOLE PANEL
   ═══════════════════════════════════════════════════ */
.console-panel {
  height: var(--console-h);
  transition: height 0.25s ease;
  overflow: hidden;
}
.console-panel.collapsed { height: 32px; }

.console-output {
  height: calc(var(--console-h) - 32px);
  overflow-y: auto;
  padding: 6px 10px;
}
.console-panel.collapsed .console-output { display: none; }

.console-tab {
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color 0.2s;
  font-family: "JetBrains Mono", monospace;
  letter-spacing: 0.08em;
  padding: 0 10px;
  height: 100%;
}
.console-tab.active-tab { color: var(--op); border-bottom: 1px solid var(--cyan); }

/* Console message lines */
.console-line {
  line-height: 1.6;
  font-size: 11px;
  display: flex;
  gap: 8px;
}
.console-time { color: var(--comment); flex-shrink: 0; }
.console-info { color: var(--cyan); }
.console-success { color: var(--green); }
.console-warn  { color: var(--yellow); }
.console-error { color: var(--red); }

/* ═══════════════════════════════════════════════════
   STATUS BAR
   ═══════════════════════════════════════════════════ */
#statusbar {
  transition: opacity 0.5s ease;
  font-size: 11px;
}

/* ═══════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════ */
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}

/* Submit button loading state */
.btn-primary.loading {
  background: linear-gradient(90deg, var(--cyan), var(--purple), var(--cyan));
  background-size: 200% auto;
  animation: shimmer 1.5s linear infinite;
}

/* Fade-in for UI after loader */
.fade-in-ui {
  animation: fadeUI 0.5s ease forwards;
}
@keyframes fadeUI {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE TWEAKS
   ═══════════════════════════════════════════════════ */
@media (max-width: 639px) {
  :root {
    --sidebar-w: 0px;
    --console-h: 120px;
  }

  .console-output {
    height: calc(var(--console-h) - 32px);
  }

  .hero-card { margin: 0; }

  .code-line { font-size: 12px; }
}

/* ─── Main layout without sidebar on mobile ──────── */
@media (max-width: 639px) {
  #main-layout {
    /* sidebar is position:fixed so it doesn't affect flow */
  }
  .line-numbers { width: 36px; font-size: 10px; }
}

/* ─── Larger screens ─────────────────────────────── */
@media (min-width: 1280px) {
  #editor-content { padding: 24px 32px; }
  .code-line { font-size: 13.5px; }
}
