/* ============================================
   ADNAN ALI PORTFOLIO - Master Stylesheet
   ============================================ */

:root {
  --color-primary: #cafd00;
  --color-primary-dim: #beee00;
  --color-surface: #0e0e0f;
  --color-on-surface: #ffffff;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--color-surface);
  color: var(--color-on-surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Lenis smooth scroll */
html.lenis { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

/* Selection */
::selection {
  background: var(--color-primary);
  color: #000;
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #0e0e0f; }
::-webkit-scrollbar-thumb { background: #262627; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-primary-dim); }

/* ============================================
   MARQUEE
   ============================================ */
@keyframes marquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.animate-marquee {
  animation: marquee 40s linear infinite;
  will-change: transform;
}

/* ============================================
   TERMINAL BOOT
   ============================================ */
#boot-overlay.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.terminal-line {
  opacity: 0;
  animation: termFadeIn 0.4s forwards;
}
@keyframes termFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.terminal-prompt  { color: #cafd00; }
.terminal-output  { color: #adaaab; }
.terminal-success { color: #cafd00; }
.terminal-error   { color: #ff7351; }

.terminal-cursor {
  display: inline-block;
  width: 8px;
  height: 14px;
  background: #cafd00;
  margin-left: 2px;
  vertical-align: middle;
  animation: blink 1s steps(2) infinite;
}
@keyframes blink {
  50% { opacity: 0; }
}

/* ============================================
   REVEAL / SCROLL ANIMATIONS
   ============================================ */
.reveal-text,
.reveal-line {
  opacity: 0;
  transform: translateY(20px);
}

.service-card {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s var(--ease-out-expo), background 0.5s ease;
}
.service-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Counter */
[data-counter] {
  font-variant-numeric: tabular-nums;
}

/* Hero particles canvas */
#hero-particles {
  opacity: 0.6;
  transition: opacity 1s ease;
}

/* Material icons baseline */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* ============================================
   ABOUT SECTION
   ============================================ */
.about-block {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.about-block.is-visible {
  opacity: 1;
  transform: translateY(0);
}

[data-animate="line"].is-visible {
  transform: scaleX(1);
  transition: transform 1.2s var(--ease-out-expo);
}

/* ============================================
   PROJECT CARDS
   ============================================ */
.project-card {
  transform: translateY(40px);
  opacity: 0;
  transition: opacity 0.8s ease, transform 0.8s var(--ease-out-expo), background 0.5s ease;
  text-decoration: none;
  color: inherit;
}
.project-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.project-card:hover .project-title {
  text-shadow: 0 0 40px rgba(202, 253, 0, 0.4);
}

.scanline-overlay {
  background: linear-gradient(
    180deg,
    transparent 0%,
    transparent 48%,
    rgba(202, 253, 0, 0.08) 50%,
    transparent 52%,
    transparent 100%
  );
  background-size: 100% 8px;
  animation: scan 3s linear infinite;
}
@keyframes scan {
  0%   { background-position-y: 0; }
  100% { background-position-y: 100px; }
}

.project-shatter canvas {
  width: 100%;
  height: 100%;
}

/* ============================================
   TECH STACK ORBIT
   ============================================ */
#stack-orbit {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
}
#stack-orbit:active {
  cursor: grabbing;
}

/* ============================================
   TESTIMONIALS
   ============================================ */
.testimonial-card {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s var(--ease-out-expo);
}
.testimonial-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   CONTACT FORM
   ============================================ */
#contact-form input,
#contact-form select,
#contact-form textarea {
  font-family: 'Inter', sans-serif;
}

#contact-form select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23cafd00'%3e%3cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z' clip-rule='evenodd'/%3e%3c/svg%3e");
  background-position: right 12px center;
  background-repeat: no-repeat;
  background-size: 18px;
  padding-right: 40px;
}

#contact-form select option {
  background: #1a191b;
  color: #ffffff;
}

.form-field {
  position: relative;
}

@keyframes successPulse {
  0%   { box-shadow: 0 0 0 0 rgba(202, 253, 0, 0.4); }
  100% { box-shadow: 0 0 0 8px rgba(202, 253, 0, 0); }
}
.form-field.is-success input,
.form-field.is-success textarea,
.form-field.is-success select {
  border-color: #cafd00;
  animation: successPulse 0.6s ease;
}

/* ============================================
   UTILITIES
   ============================================ */
.no-scroll { overflow: hidden; }

.text-gradient-primary {
  background: linear-gradient(135deg, #cafd00 0%, #f3ffca 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.glow-primary {
  box-shadow: 0 0 40px -10px rgba(202, 253, 0, 0.3);
}

/* ============================================
   INNER PAGES (project detail, blog, admin)
   ============================================ */
.prose-custom {
  color: #adaaab;
  line-height: 1.8;
  font-size: 1.0625rem;
}
.prose-custom h2 {
  color: #ffffff;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 2rem;
  margin-top: 3rem;
  margin-bottom: 1rem;
  line-height: 1.2;
}
.prose-custom h3 {
  color: #ffffff;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 1.5rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}
.prose-custom p { margin-bottom: 1.25rem; }
.prose-custom a {
  color: #cafd00;
  text-decoration: underline;
  text-decoration-color: rgba(202, 253, 0, 0.4);
  text-underline-offset: 4px;
  transition: text-decoration-color 0.3s ease;
}
.prose-custom a:hover {
  text-decoration-color: #cafd00;
}
.prose-custom code {
  font-family: 'JetBrains Mono', monospace;
  background: #201f21;
  color: #cafd00;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}
.prose-custom pre {
  background: #131314;
  border: 1px solid #262627;
  border-radius: 8px;
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}
.prose-custom pre code {
  background: none;
  color: inherit;
  padding: 0;
}
.prose-custom ul, .prose-custom ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}
.prose-custom li {
  margin-bottom: 0.5rem;
}
.prose-custom blockquote {
  border-left: 3px solid #cafd00;
  padding-left: 1.25rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: #ffffff;
}

/* ============================================
   ADMIN PANEL
   ============================================ */
.admin-body {
  background: #0e0e0f;
}

.admin-sidebar {
  width: 240px;
  min-height: 100vh;
  background: #131314;
  border-right: 1px solid rgba(72, 72, 73, 0.3);
}

.admin-nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: rgba(255, 255, 255, 0.6);
  border-radius: 0.5rem;
  transition: all 0.2s;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
}
.admin-nav-link:hover {
  background: rgba(202, 253, 0, 0.05);
  color: #ffffff;
}
.admin-nav-link.is-active {
  background: rgba(202, 253, 0, 0.1);
  color: #cafd00;
}

.admin-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background: #cafd00;
  color: #0e0e0f;
  border-radius: 0.5rem;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
}
.admin-btn:hover { background: #beee00; transform: translateY(-1px); }
.admin-btn.is-secondary {
  background: transparent;
  color: #ffffff;
  border: 1px solid rgba(72, 72, 73, 0.5);
}
.admin-btn.is-secondary:hover {
  background: #201f21;
  border-color: #cafd00;
}
.admin-btn.is-danger {
  background: transparent;
  color: #ff7351;
  border: 1px solid rgba(255, 115, 81, 0.3);
}
.admin-btn.is-danger:hover {
  background: rgba(255, 115, 81, 0.1);
}

.admin-input {
  width: 100%;
  background: #0e0e0f;
  border: 1px solid rgba(72, 72, 73, 0.5);
  border-radius: 0.5rem;
  padding: 0.625rem 0.875rem;
  color: #ffffff;
  font-family: 'Inter', sans-serif;
  font-size: 0.9375rem;
  transition: border-color 0.2s;
}
.admin-input:focus {
  outline: none;
  border-color: #cafd00;
  box-shadow: 0 0 0 3px rgba(202, 253, 0, 0.1);
}

.admin-label {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 0.375rem;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}
.admin-table th {
  text-align: left;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.5);
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(72, 72, 73, 0.3);
}
.admin-table td {
  padding: 1rem;
  border-bottom: 1px solid rgba(72, 72, 73, 0.2);
  color: #ffffff;
  font-size: 0.9375rem;
}
.admin-table tr:hover td {
  background: rgba(202, 253, 0, 0.03);
}

.status-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.status-new        { background: rgba(202, 253, 0, 0.15); color: #cafd00; }
.status-read       { background: rgba(173, 170, 171, 0.15); color: #adaaab; }
.status-replied    { background: rgba(97, 218, 251, 0.15); color: #61DAFB; }
.status-converted  { background: rgba(149, 191, 71, 0.15); color: #95BF47; }
.status-archived   { background: rgba(72, 72, 73, 0.3); color: rgba(255,255,255,0.4); }
.status-draft      { background: rgba(252, 224, 71, 0.15); color: #fce047; }
.status-published  { background: rgba(202, 253, 0, 0.15); color: #cafd00; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}


/* ============================================
   ADMIN FORM INPUT FIX
   Override Tailwind forms plugin white bg
   ============================================ */
.admin-input,
input.admin-input,
select.admin-input,
textarea.admin-input {
  background-color: #0e0e0f !important;
  color: #ffffff !important;
  border: 1px solid rgba(72, 72, 73, 0.5) !important;
}

.admin-input:focus,
input.admin-input:focus,
select.admin-input:focus,
textarea.admin-input:focus {
  background-color: #0e0e0f !important;
  color: #ffffff !important;
  border-color: #cafd00 !important;
  box-shadow: 0 0 0 3px rgba(202, 253, 0, 0.1) !important;
  outline: none !important;
}

.admin-input::placeholder {
  color: rgba(173, 170, 171, 0.4) !important;
}

/* Autofill fix (Chrome/Safari) */
.admin-input:-webkit-autofill,
.admin-input:-webkit-autofill:hover,
.admin-input:-webkit-autofill:focus {
  -webkit-text-fill-color: #ffffff !important;
  -webkit-box-shadow: 0 0 0 1000px #0e0e0f inset !important;
  caret-color: #ffffff !important;
}

/* Admin table inputs (checkboxes) */
.admin-body input[type="checkbox"] {
  background-color: #0e0e0f;
  border-color: rgba(72, 72, 73, 0.5);
  accent-color: #cafd00;
}