/* ===== DARK THEME COLOR TOKENS ===== */
:root {
  --bg-base:    #0d1117;
  --bg-surface: #161b22;
  --bg-card:    #1c2128;
  --bg-input:   #21262d;
  --border:     rgba(255, 255, 255, 0.08);
  --text-primary: #e6edf3;
  --text-muted:   #8b949e;
  --accent:     #818cf8;
  --accent-sky: #38bdf8;
  --accent-green: #34d399;
  --cat-frontend: #818cf8;
  --cat-data:     #34d399;
  --cat-backend:  #fbbf24;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
}

body {
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
}

/* Prevent scroll AND horizontal overflow while loading screen is active */
body.loading {
  overflow: hidden;
}

.skill-label {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ===== LOADING SCREEN ===== */

#loading-screen {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: 100vw;
  height: 100vh;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: #000;
  overflow: hidden;
  transition: opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1), transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

#loading-screen.fade-out {
  opacity: 0;
  transform: scale(1.08);
  pointer-events: none;
}

/* HTML5 Starfield Canvas */
#space-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  background: radial-gradient(circle at center, #08111e 0%, #000205 100%);
  transition: opacity 1s ease;
}

/* Star Wars Intro Text style */
.sw-intro-text {
  position: absolute;
  z-index: 10;
  color: #4bd5ee;
  font-family: 'Inter', sans-serif;
  font-size: clamp(1.1rem, 3.5vw, 1.8rem);
  font-weight: 500;
  text-align: left;
  line-height: 1.6;
  max-width: 85%;
  letter-spacing: 0.5px;
  opacity: 0;
  transform: scale(0.95);
  pointer-events: none;
  text-shadow: 0 0 10px rgba(75, 213, 238, 0.4);
  transition: opacity 1s ease-in-out, transform 1s ease-in-out, filter 1s ease-in-out;
  filter: blur(2px);
}

.sw-intro-text.active {
  opacity: 1;
  transform: scale(1);
  filter: blur(0);
}

.sw-intro-text.fade-away {
  opacity: 0;
  transform: scale(1.05);
  filter: blur(4px);
}

/* Space Loader Interface (Header & Lightsaber) */
.loader-content-wrap {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 500px;
  padding: 20px;
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: opacity 0.8s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.loader-content-wrap.hidden {
  opacity: 0;
  transform: translateY(30px) scale(0.92);
  pointer-events: none;
}

/* Star Wars Header */
.sw-header {
  text-align: center;
  margin-bottom: 45px;
  animation: swHeaderAppear 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

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

.sw-title {
  font-family: 'Inter', sans-serif;
  font-weight: 900;
  font-size: clamp(1.8rem, 5.5vw, 3rem);
  letter-spacing: 5px;
  margin: 0;
  line-height: 1;
  background: linear-gradient(135deg, #ffffff 40%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.4));
}

.sw-subtitle {
  font-family: 'Fira Code', monospace;
  font-size: clamp(0.7rem, 2vw, 0.85rem);
  letter-spacing: 5px;
  color: #38bdf8;
  margin-top: 10px;
  font-weight: 600;
  text-transform: uppercase;
  opacity: 0.85;
}

/* Lightsaber Progress Assembly */
.lightsaber-assembly {
  width: 90%;
  max-width: 400px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 25px;
}

.lightsaber-container {
  display: flex;
  align-items: center;
  position: relative;
  width: 100%;
}

/* Sleek CSS Lightsaber Hilt */
.lightsaber-hilt {
  display: flex;
  align-items: center;
  height: 22px;
  position: relative;
  z-index: 10;
  flex-shrink: 0;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.6));
}

.hilt-part {
  height: 100%;
  background: linear-gradient(to bottom, #e2e8f0 0%, #94a3b8 50%, #475569 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), inset 0 -1px 1px rgba(0, 0, 0, 0.4);
}

.hilt-part.emitter {
  width: 9px;
  height: 24px;
  border-radius: 3px 0 0 3px;
  border-right: 2px solid #1e293b;
  background: linear-gradient(to bottom, #cbd5e1 0%, #64748b 50%, #0f172a 100%);
}

.hilt-part.emitter-ring {
  width: 3px;
  height: 26px;
  background: #0f172a;
}

.hilt-part.metal-neck {
  width: 12px;
  height: 16px;
  background: linear-gradient(to bottom, #f1f5f9 0%, #cbd5e1 50%, #64748b 100%);
}

.hilt-part.black-grip {
  width: 35px;
  height: 20px;
  background: #0f172a;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0 1px;
  border-left: 1px solid #475569;
  border-right: 1px solid #475569;
}

.hilt-part.black-grip .ridge {
  width: 3px;
  height: 85%;
  background: linear-gradient(to bottom, #94a3b8 0%, #0f172a 100%);
  border-radius: 1px;
}

.hilt-part.control-box {
  width: 10px;
  height: 22px;
  position: relative;
  background: linear-gradient(to bottom, #f1f5f9 0%, #94a3b8 50%, #475569 100%);
}

.hilt-part.control-box .button-blue {
  position: absolute;
  width: 4px;
  height: 4px;
  background: #38bdf8;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  box-shadow: 0 0 4px #38bdf8;
}

.hilt-part.pommel {
  width: 7px;
  height: 23px;
  border-radius: 0 5px 5px 0;
  background: linear-gradient(to bottom, #cbd5e1 0%, #64748b 50%, #0f172a 100%);
}

/* Lightsaber Blade Container & Glowing Blade */
.lightsaber-blade-container {
  height: 10px;
  flex-grow: 1;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 0 100px 100px 0;
  position: relative;
  left: -2px; /* overlap with emitter to prevent gap */
  overflow: visible;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
}

.lightsaber-blade {
  height: 8px;
  width: 0%; /* animated dynamically by JS */
  background: #ffffff;
  border-radius: 0 100px 100px 0;
  position: relative;
  box-shadow: 
    0 0 6px #ffffff,
    0 0 12px #38bdf8,
    0 0 24px #0284c7,
    0 0 40px rgba(3, 105, 161, 0.6);
  transition: width 0.12s linear;
}

/* Sparkle hum effect on the tip of the blade */
.lightsaber-blade::after {
  content: "";
  position: absolute;
  right: -3px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 10px #38bdf8, 0 0 20px #0284c7;
  animation: bladePulse 0.1s infinite alternate;
}

@keyframes bladePulse {
  0% { transform: translateY(-50%) scale(0.85); opacity: 0.8; }
  100% { transform: translateY(-50%) scale(1.2); opacity: 1; }
}

/* Loader Progress Typography */
.loader-progress-wrap {
  width: 90%;
  max-width: 400px;
  margin-top: 5px;
}

.loader-progress-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Fira Code', monospace;
  font-size: clamp(0.7rem, 2vw, 0.8rem);
  color: var(--text-muted);
}

#loader-status {
  color: rgba(226, 232, 240, 0.85);
  font-weight: 500;
  letter-spacing: 0.5px;
}

#loader-pct {
  color: #38bdf8;
  font-weight: 700;
  text-shadow: 0 0 8px rgba(56, 189, 248, 0.4);
}


/* ===== SCROLL ANIMATIONS ===== */

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-60px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(60px); }
  to   { opacity: 1; transform: translateX(0); }
}

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

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes bounceIn {
  0%   { opacity: 0; transform: scale(0.8); }
  50%  { opacity: 1; }
  100% { opacity: 1; transform: scale(1); }
}

.scroll-fade        { opacity: 0; }
.scroll-slide-left  { opacity: 0; transform: translateX(-60px); }
.scroll-slide-right { opacity: 0; transform: translateX(60px); }
.scroll-slide-up    { opacity: 0; transform: translateY(40px); }
.scroll-scale       { opacity: 0; transform: scale(0.9); }
.scroll-bounce      { opacity: 0; transform: scale(0.8); }

.scroll-stagger-1 { animation-delay: 0.1s; }
.scroll-stagger-2 { animation-delay: 0.2s; }
.scroll-stagger-3 { animation-delay: 0.3s; }
.scroll-stagger-4 { animation-delay: 0.4s; }
.scroll-stagger-5 { animation-delay: 0.5s; }
.scroll-stagger-6 { animation-delay: 0.6s; }


/* ===== NAVBAR ===== */

.blur-nav {
  background: rgba(22, 27, 34, 0.75) !important;
  border: 1px solid var(--border) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: transform 0.4s ease-in-out, opacity 0.4s ease-in-out;
  box-shadow: 0 4px 24px rgba(0,0,0,0.4) !important;
}

.navbar-brand {
  color: var(--text-primary) !important;
  background: linear-gradient(90deg, var(--accent), var(--accent-sky));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-link-dark {
  color: var(--text-muted) !important;
  transition: color 0.25s ease;
}

.nav-link-dark:hover {
  color: var(--text-primary) !important;
}

.navbar-hidden {
  transform: translateY(-150%);
  opacity: 0;
  pointer-events: none;
}

/* Mobile toggler icon → white */
.navbar-toggler {
  border-color: var(--border) !important;
}
.navbar-toggler-icon {
  filter: invert(1);
}

#home {
  margin-top: -90px;
}

/* Gradient accent line (divider under section titles) */
.accent-line {
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-sky));
  border-radius: 5px;
  margin: 0 auto;
}

/* Subtle label above section titles */
.section-label {
  letter-spacing: 3px;
  font-size: 0.78rem;
  color: var(--accent);
  text-transform: uppercase;
  font-weight: 700;
}


/* ===== ABOUT SECTION ===== */
#about {
  background-color: var(--bg-surface) !important;
}


/* ===== BOOTSTRAP TEXT UTILITY OVERRIDES FOR DARK THEME ===== */

/* Override Bootstrap's text-muted and text-secondary so they stay readable */
.text-muted {
  color: var(--text-muted) !important;
}

.text-secondary {
  color: var(--accent-sky) !important;
}

/* ===== EXPERIENCE SECTION ===== */
#experience {
  background-color: var(--bg-base);
}

/* Section headings (Education / Experience / Organization) */
#experience h4 {
  color: var(--text-primary);
}

/* Job / degree titles */
#experience h5 {
  color: var(--text-primary);
}

/* Company / institution names — use sky accent so they stand out */
#experience h6 {
  color: var(--accent-sky) !important;
}

/* Bullet points */
#experience ul {
  color: var(--text-muted);
}

/* Paragraph text inside experience */
#experience p {
  color: var(--text-muted);
}

.timeline-item {
  position: relative;
  padding-left: 2rem;
  border-left: 2px solid rgba(129, 140, 248, 0.25);
  padding-bottom: 2.5rem;
}

.timeline-item::before {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-sky));
  border-radius: 50%;
  left: -7px;
  top: 6px;
  box-shadow: 0 0 10px rgba(129, 140, 248, 0.5);
}

.border-left-transparent {
  border-left-color: transparent !important;
}

/* Badges in experience section */
.badge-dark-custom {
  background: rgba(129, 140, 248, 0.15) !important;
  color: var(--accent) !important;
  border: 1px solid rgba(129, 140, 248, 0.25);
  font-weight: 500;
}


/* ===== SKILLS SECTION ===== */
#skills {
  background-color: var(--bg-surface);
  position: relative;
}

/* Skill Group Card */
.skill-group {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.04) 0%,
    rgba(255, 255, 255, 0.01) 100%
  );
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  padding: 2rem 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  position: relative;
  transition: border-color 0.4s ease;
  width: 100%;
  max-width: 750px;
}



/* Category accent bar */
.skill-group[data-category="frontend"] { border-left: 3px solid var(--cat-frontend); }
.skill-group[data-category="data"]     { border-left: 3px solid var(--cat-data); }
.skill-group[data-category="backend"]  { border-left: 3px solid var(--cat-backend); }

.skill-group-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 0.3rem 1rem;
  border-radius: 100px;
}

.skill-group[data-category="frontend"] .skill-group-tag {
  background: rgba(129, 140, 248, 0.12);
  color: var(--cat-frontend);
  border: 1px solid rgba(129, 140, 248, 0.2);
}

.skill-group[data-category="data"] .skill-group-tag {
  background: rgba(52, 211, 153, 0.12);
  color: var(--cat-data);
  border: 1px solid rgba(52, 211, 153, 0.2);
}

.skill-group[data-category="backend"] .skill-group-tag {
  background: rgba(251, 191, 36, 0.12);
  color: var(--cat-backend);
  border: 1px solid rgba(251, 191, 36, 0.2);
}

/* Skill Pill */
.skill-pill {
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 100px;
  padding: 0.5rem 1.1rem 0.5rem 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: all 0.3s ease;
  cursor: default;
}

.skill-group[data-category="frontend"] .skill-pill:hover {
  border-color: rgba(129, 140, 248, 0.4);
  background: rgba(129, 140, 248, 0.06);
  box-shadow: 0 4px 16px rgba(129, 140, 248, 0.12);
  transform: translateY(-2px);
}

.skill-group[data-category="data"] .skill-pill:hover {
  border-color: rgba(52, 211, 153, 0.4);
  background: rgba(52, 211, 153, 0.06);
  box-shadow: 0 4px 16px rgba(52, 211, 153, 0.12);
  transform: translateY(-2px);
}

.skill-group[data-category="backend"] .skill-pill:hover {
  border-color: rgba(251, 191, 36, 0.4);
  background: rgba(251, 191, 36, 0.06);
  box-shadow: 0 4px 16px rgba(251, 191, 36, 0.12);
  transform: translateY(-2px);
}

.skill-pill-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex-shrink: 0;
}

.skill-pill-icon-invert {
  filter: brightness(0) invert(1);
}

.skill-pill-label {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1;
}


/* ===== PROJECTS SECTION ===== */
#projects {
  background-color: var(--bg-base) !important;
  overflow-x: hidden;
}

.project-card {
  background-color: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  cursor: pointer;
  border-radius: 15px !important;
  overflow: hidden;
}

.project-card .card-img-top {
  width: 100%;
  height: 280px;
  object-fit: cover;
}

.project-card:hover {
  transform: translateY(-6px);
  border-color: rgba(129, 140, 248, 0.35) !important;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5), 0 0 30px rgba(129,140,248,0.1) !important;
}

.project-card .card-title {
  color: var(--text-primary) !important;
}

.project-card .card-text {
  color: var(--text-muted) !important;
}

/* ===== FILTER BUTTONS ===== */
.filter-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text-muted);
  padding: 0.5rem 1.25rem;
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.3s ease;
  cursor: pointer;
}

.filter-btn:hover {
  border-color: rgba(129, 140, 248, 0.4);
  color: var(--text-primary);
  background: rgba(129, 140, 248, 0.08);
}

.filter-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-sky));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 15px rgba(129, 140, 248, 0.35);
}

/* ===== PROJECT ITEM TRANSITIONS ===== */
.project-item {
  transition: all 0.4s ease;
}

.project-item.hidden {
  display: none;
}

.project-item.filtering {
  opacity: 0;
  transform: scale(0.85);
  pointer-events: none;
}

.project-btn {
  width: 42px;
  height: 42px;
  border-radius: 50% !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  background-color: rgba(255,255,255,0.05);
  transition: all 0.3s ease;
  display: flex !important;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.project-btn:hover {
  background-color: rgba(129, 140, 248, 0.15);
  border-color: rgba(129, 140, 248, 0.5) !important;
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(129,140,248,0.2);
}

/* GitHub icon in project btn — invert to white on dark bg */
.project-btn img {
  filter: invert(1);
  opacity: 0.75;
  transition: opacity 0.3s ease;
}

.project-btn:hover img { opacity: 1; }

/* SVG link icon */
.project-btn svg { color: rgba(255,255,255,0.75); transition: color 0.3s ease; }
.project-btn:hover svg { color: var(--accent); }


/* ===== CONTACT SECTION ===== */
#contact {
  background-color: var(--bg-surface);
}

.contact-form-card {
  background-color: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  border-radius: 20px !important;
}

.form-label-dark { color: var(--text-muted) !important; font-weight: 600; }

.form-control-dark {
  background-color: var(--bg-input) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-primary) !important;
  border-radius: 10px !important;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.form-control-dark::placeholder { color: rgba(139,148,158,0.6); }

.form-control-dark:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(129,140,248,0.15) !important;
  outline: none;
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-sky));
  color: #fff;
  border: none;
  font-weight: 700;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.btn-accent:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  color: #fff;
}

/* Outline Accent Button (for Download CV) */
.btn-outline-accent {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  font-weight: 700;
  transition: all 0.3s ease;
}

.btn-outline-accent:hover {
  background: rgba(129, 140, 248, 0.12);
  color: #fff;
  border-color: var(--accent-sky);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(129, 140, 248, 0.2);
}

.contact-card {
  background-color: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  border-radius: 15px !important;
}

.contact-card:hover {
  transform: translateY(-8px);
  border-color: rgba(129, 140, 248, 0.4) !important;
  box-shadow: 0 15px 40px rgba(0,0,0,0.4) !important;
}

.contact-card-label { color: var(--text-primary) !important; }

.social-icon-wrap {
  background: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  transition: border-color 0.25s ease;
}

.social-link:hover .social-icon-wrap {
  border-color: rgba(129,140,248,0.5) !important;
}

.social-link .social-text {
  color: var(--text-muted) !important;
  transition: color 0.3s ease;
}

.social-link:hover .social-text {
  color: var(--accent) !important;
}

/* GitHub social icon → white */
.social-gh-icon { filter: invert(1); opacity: 0.8; }


/* ===== FOOTER ===== */
footer {
  background-color: var(--bg-surface) !important;
  border-top: 1px solid var(--border);
  color: var(--text-muted) !important;
}

footer p { color: var(--text-muted) !important; }


/* ===== BACK TO TOP ===== */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--accent), var(--accent-sky));
  border-radius: 50%;
  z-index: 99;
  transition: all 0.3s ease;
  opacity: 0.85;
  box-shadow: 0 4px 20px rgba(129,140,248,0.35);
}

.back-to-top:hover {
  opacity: 1;
  transform: translateY(-5px);
  box-shadow: 0 8px 28px rgba(129,140,248,0.5) !important;
}
