/* ═══════════════════════════════════════════════
   Portfolio — Custom CSS
   Supplements Tailwind with custom effects
═══════════════════════════════════════════════ */

/* ─── CSS Variables ─────────────────────────── */
:root {
  --accent: #00FFB2;
  --accent-dark: #00CC8E;
  --surface: #0A0A0F;
  --surface-card: #12121A;
  --surface-border: #1E1E2E;
  --surface-hover: #1A1A28;
  --font-display: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light theme variables */
html.light {
  --surface: #F8F9FC;
  --surface-card: #FFFFFF;
  --surface-border: #E2E8F0;
  --surface-hover: #F1F5F9;
}

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

html { scroll-behavior: smooth; }

body {
  background-color: var(--surface);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  cursor: none; /* Hide default cursor */
}

/* Restore cursor for touch devices */
@media (hover: none) {
  body { cursor: auto; }
  #cursor, #cursor-ring { display: none; }
}

/* ─── Custom Scrollbar ──────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb {
  background: #1E1E2E;
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ─── Selection ─────────────────────────────── */
::selection {
  background: rgba(0, 255, 178, 0.2);
  color: var(--accent);
}

/* ─── Custom Cursor ─────────────────────────── */
.cursor-dot {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: transform 0.1s ease, opacity 0.2s ease;
  pointer-events: none;
}

.cursor-ring {
  width: 36px;
  height: 36px;
  border: 1.5px solid rgba(0, 255, 178, 0.5);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: transform 0.12s ease, width 0.3s ease, height 0.3s ease, opacity 0.3s ease;
  pointer-events: none;
}

.cursor-dot.hovering {
  transform: translate(-50%, -50%) scale(1.5);
  background: var(--accent);
}

.cursor-ring.hovering {
  width: 56px;
  height: 56px;
  border-color: var(--accent);
  opacity: 0.7;
}

/* ─── Navbar Scroll State ───────────────────── */
#navbar.scrolled {
  background: rgba(10, 10, 15, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding-top: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--surface-border);
}

html.light #navbar.scrolled {
  background: rgba(248, 249, 252, 0.9);
}

/* ─── Background Grid ───────────────────────── */
.bg-grid-pattern {
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
}

/* ─── Skill Progress Bars ───────────────────── */
.skill-bar-track {
  height: 6px;
  background: var(--surface-border);
  border-radius: 999px;
  overflow: hidden;
}

.skill-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #80FFD9);
  border-radius: 999px;
  width: 0;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.skill-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ─── Tech Cards ─────────────────────────────── */
.tech-card {
  padding: 12px 8px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  text-align: center;
  cursor: default;
  transition: var(--transition);
}

.tech-card:hover {
  border-color: var(--accent);
  background: rgba(0, 255, 178, 0.05);
  transform: translateY(-3px);
}

.tech-card i { font-size: 1.5rem; margin-bottom: 6px; }
.tech-card span { font-size: 0.65rem; color: rgba(255,255,255,0.4); font-family: var(--font-mono); }

/* ─── Project Cards ─────────────────────────── */
.project-card {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: 20px;
  overflow: hidden;
  transition: var(--transition);
  position: relative;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.project-card:hover {
  border-color: rgba(0, 255, 178, 0.3);
  transform: translateY(-6px);
  box-shadow: 0 24px 60px rgba(0, 255, 178, 0.06);
}

.project-card:hover::before { opacity: 1; }

.project-thumbnail {
  height: 200px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.project-thumbnail-bg {
  position: absolute;
  inset: 0;
  opacity: 0.07;
}

.project-thumbnail-icon {
  font-size: 3rem;
  position: relative;
  z-index: 1;
}

/* ─── Timeline ───────────────────────────────── */
.timeline-item {
  position: relative;
  padding-left: 28px;
  padding-bottom: 32px;
}

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

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

.timeline-dot {
  position: absolute;
  left: 0;
  top: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--surface-card);
  border: 2px solid var(--accent);
  transition: var(--transition);
}

.timeline-dot::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.timeline-item:hover .timeline-dot::after { opacity: 1; }

/* ─── Form Input Focus ───────────────────────── */
.form-input {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  color: white;
  transition: var(--transition);
  font-family: var(--font-body);
}

.form-input:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(0, 255, 178, 0.08);
  background: rgba(0, 255, 178, 0.02);
}

.form-input.error {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.08);
}

.form-input.success {
  border-color: var(--accent) !important;
}

/* ─── Notification ───────────────────────────── */
.notification-success {
  background: rgba(0, 255, 178, 0.08);
  border: 1px solid rgba(0, 255, 178, 0.3);
  color: var(--accent);
}

.notification-error {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

/* ─── Filter Buttons ─────────────────────────── */
.filter-btn.active {
  background: rgba(0, 255, 178, 0.1);
  border-color: var(--accent) !important;
  color: var(--accent) !important;
}

/* ─── Project Filter Animation ───────────────── */
.project-card {
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.project-card.hidden-card {
  opacity: 0;
  transform: scale(0.95);
  pointer-events: none;
}

/* ─── Light Mode Overrides ───────────────────── */
html.light body {
  background-color: #F8F9FC;
  color: #0F172A;
}

html.light .bg-surface { background-color: #F8F9FC; }
html.light .bg-surface-card { background-color: #FFFFFF; }
html.light .text-white { color: #0F172A; }
html.light .text-white\/60 { color: rgba(15, 23, 42, 0.6); }
html.light .text-white\/50 { color: rgba(15, 23, 42, 0.5); }
html.light .text-white\/40 { color: rgba(15, 23, 42, 0.4); }
html.light .text-white\/30 { color: rgba(15, 23, 42, 0.3); }
html.light .text-white\/20 { color: rgba(15, 23, 42, 0.2); }
html.light .border-surface-border { border-color: #E2E8F0; }
html.light .bg-surface-card\/30 { background-color: rgba(226, 232, 240, 0.3); }
html.light .form-input {
  background: #FFFFFF;
  color: #0F172A;
  border-color: #E2E8F0;
}

/* ─── Particles Canvas ───────────────────────── */
#particles-canvas { z-index: 0; }

/* ─── AOS Custom Easing ──────────────────────── */
[data-aos] { pointer-events: none; }
[data-aos].aos-animate { pointer-events: all; }

/* ─── Back to Top ────────────────────────────── */
#back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Mobile Menu Active ─────────────────────── */
#mobile-menu.open {
  transform: translateX(0);
}

/* ─── Nav active state ───────────────────────── */
.nav-link.active { color: var(--accent); }

/* ─── Typing cursor ──────────────────────────── */
#typing-text::after {
  content: '|';
  color: var(--accent);
  animation: blink 0.8s step-end infinite;
}

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

/* ─── Responsive helpers ─────────────────────── */
@media (max-width: 640px) {
  .cursor-dot, .cursor-ring { display: none; }
  body { cursor: auto; }
}
