/* =========================================================
   AMIR DEV LAB — Main Stylesheet
   Learning Project: HTML + CSS + JS + Node.js + SQL Server
   ========================================================= */

/* ── CSS Variables (Design Tokens) ── */
:root {
  --bg-base:      #080b14;
  --bg-surface:   #0e1528;
  --bg-card:      rgba(255, 255, 255, 0.04);
  --border:       rgba(255, 255, 255, 0.08);
  --border-glow:  rgba(99, 179, 237, 0.3);

  --text-primary:   #f0f4ff;
  --text-secondary: #8b9cc8;
  --text-muted:     #4a5580;

  --accent-blue:  #63b3ed;
  --accent-cyan:  #4fd1c5;
  --accent-purple: #a78bfa;
  --accent-pink:  #f472b6;

  --green:  #68d391;
  --red:    #fc8181;
  --yellow: #f6e05e;

  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  20px;
  --radius-xl:  28px;

  --shadow-card: 0 4px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 40px rgba(99, 179, 237, 0.15);

  --font-body: 'Inter', system-ui, sans-serif;
  --font-code: 'JetBrains Mono', 'Fira Code', monospace;

  --nav-h: 64px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: #2d3a5c; border-radius: 99px; }

/* ── Selection ── */
::selection { background: rgba(99, 179, 237, 0.3); color: var(--text-primary); }

/* ── Container ── */
.container {
  width: min(1120px, 92%);
  margin-inline: auto;
}

/* ==========================================================
   NAVBAR
   ========================================================== */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 1000;
  background: rgba(8, 11, 20, 0.75);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

.navbar.scrolled {
  background: rgba(8, 11, 20, 0.95);
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
}

.nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.logo-bracket {
  color: var(--accent-blue);
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color var(--transition);
}

.nav-links a:hover { color: var(--text-primary); }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 24px; height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: var(--transition);
}

@media (max-width: 640px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    padding: 1.5rem;
    gap: 1.25rem;
  }
}

/* ==========================================================
   HERO
   ========================================================== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding-block: calc(var(--nav-h) + 60px) 80px;
}

/* Dot-grid background */
.hero-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 40%, rgba(99, 179, 237, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 60%, rgba(167, 139, 250, 0.06) 0%, transparent 50%),
    radial-gradient(var(--border) 1px, transparent 1px);
  background-size: auto, auto, 32px 32px;
  pointer-events: none;
}

.hero-content {
  position: relative;
  max-width: 780px;
}

.hero-eyebrow {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent-blue);
  margin-bottom: 1rem;
}

.hero-title {
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -2px;
  margin-bottom: 1.25rem;
}

/* Animated gradient text */
.gradient-text {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan), var(--accent-purple));
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradShift 4s ease infinite;
}

@keyframes gradShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 580px;
  margin-bottom: 2rem;
}

.hero-sub strong { color: var(--accent-blue); }

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ==========================================================
   BUTTONS
   ========================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.5rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-body);
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-blue), #4299e1);
  color: #fff;
  box-shadow: 0 4px 20px rgba(99, 179, 237, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(99, 179, 237, 0.5);
}

.btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  background: rgba(99, 179, 237, 0.06);
}

.btn-sm { padding: 0.45rem 1rem; font-size: 0.82rem; }
.btn-full { width: 100%; }

/* ==========================================================
   BADGES
   ========================================================== */
.badge {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

/* ==========================================================
   SECTIONS
   ========================================================== */
.section {
  padding-block: 100px;
}

.section-alt {
  background: linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-base) 100%);
}

.section-title {
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-sub {
  color: var(--text-secondary);
  max-width: 560px;
  margin-bottom: 2.5rem;
  font-size: 0.95rem;
}

/* HTTP Method Tags */
.tag {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 700;
  font-family: var(--font-code);
  letter-spacing: 1px;
  background: rgba(99, 179, 237, 0.15);
  color: var(--accent-blue);
  border: 1px solid rgba(99, 179, 237, 0.25);
}

.tag-post {
  background: rgba(79, 209, 197, 0.15);
  color: var(--accent-cyan);
  border-color: rgba(79, 209, 197, 0.25);
}

/* ==========================================================
   CARDS
   ========================================================== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.card {
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  border: 1px solid var(--border);
}

.glass {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-card);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.glass:hover {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-card), var(--shadow-glow);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.card-sub {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

/* ── Status Dot ── */
.dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}

.dot-pulse.online {
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(104, 211, 145, 0.7);
  animation: pulse 2s infinite;
}

.dot-pulse.error { background: var(--red); }

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(104, 211, 145, 0.7); }
  70%  { box-shadow: 0 0 0 8px rgba(104, 211, 145, 0); }
  100% { box-shadow: 0 0 0 0 rgba(104, 211, 145, 0); }
}

/* ── JSON Output ── */
.json-output {
  font-family: var(--font-code);
  font-size: 0.78rem;
  line-height: 1.6;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  overflow-x: auto;
  color: var(--accent-cyan);
  white-space: pre;
  margin-bottom: 1rem;
  min-height: 80px;
}

/* ── Learn List ── */
.learn-list {
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.learn-list li::marker { color: var(--accent-blue); }

.learn-list code, .section-sub code {
  font-family: var(--font-code);
  font-size: 0.82em;
  background: rgba(99, 179, 237, 0.12);
  color: var(--accent-blue);
  padding: 0.1em 0.4em;
  border-radius: 4px;
}

/* ==========================================================
   MESSAGES LIST
   ========================================================== */
.messages-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.msg-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.4rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  transition: border-color var(--transition);
  animation: fadeSlide 0.35s ease forwards;
}

.msg-item:hover { border-color: var(--border-glow); }

@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.msg-body { flex: 1; }

.msg-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--accent-blue);
  margin-bottom: 0.25rem;
}

.msg-text {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.msg-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-code);
  white-space: nowrap;
}

/* ── Skeleton Loader ── */
.skeleton-loader {
  height: 72px;
  background: linear-gradient(90deg, var(--bg-card) 25%, rgba(255,255,255,0.06) 50%, var(--bg-card) 75%);
  background-size: 400% 100%;
  border-radius: var(--radius-md);
  animation: skeleton 1.8s ease infinite;
}

@keyframes skeleton {
  0%   { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.messages-footer {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
}

/* ==========================================================
   FORM
   ========================================================== */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.45rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.7rem 1rem;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: var(--font-body);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(99, 179, 237, 0.15);
}

.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-muted); }

.form-feedback {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  min-height: 1.2em;
  text-align: center;
}

.form-feedback.success { color: var(--green); }
.form-feedback.error   { color: var(--red); }

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin-block: 1.25rem;
}

/* ==========================================================
   FOOTER
   ========================================================== */
.footer {
  border-top: 1px solid var(--border);
  padding-block: 2rem;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  text-align: center;
}

.footer p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer strong { color: var(--accent-blue); }

.footer-stack { font-size: 0.75rem !important; }

/* ==========================================================
   UTILITY
   ========================================================== */
code {
  font-family: var(--font-code);
  font-size: 0.82em;
  background: rgba(99, 179, 237, 0.12);
  color: var(--accent-blue);
  padding: 0.1em 0.4em;
  border-radius: 4px;
}

/* Scroll reveal utility */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
