/* ===== Variables ===== */
:root {
  --accent: #6c5ce7;
  --accent-hover: #5a4bd1;
  --accent-subtle: rgba(108, 92, 231, 0.12);
  --bg: #0f0f14;
  --bg-subtle: #16161d;
  --card-bg: #1c1c26;
  --card-border: rgba(255, 255, 255, 0.06);
  --text: #e8e8ed;
  --text-secondary: #9a9aab;
  --code-bg: #1a1a2e;
  --font: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", monospace;
}

[data-bs-theme="light"] {
  --bg: #f8f9fc;
  --bg-subtle: #eef0f5;
  --card-bg: #ffffff;
  --card-border: rgba(0, 0, 0, 0.08);
  --text: #1a1a2e;
  --text-secondary: #6b6b80;
  --code-bg: #f1f3f8;
}

/* ===== Base ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font);
  background-color: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

::selection {
  background: var(--accent);
  color: #fff;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--accent-hover);
}

/* ===== Navbar ===== */
.glass-nav {
  background: rgba(15, 15, 20, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--card-border);
  padding: 0.75rem 0;
  transition: background 0.3s;
}

[data-bs-theme="light"] .glass-nav {
  background: rgba(248, 249, 252, 0.85);
}

.navbar-brand {
  font-size: 1.5rem;
  letter-spacing: -0.5px;
}

.nav-link {
  color: var(--text-secondary) !important;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.5rem 1rem !important;
  border-radius: 8px;
  transition: all 0.2s;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text) !important;
  background: var(--accent-subtle);
}

.theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--text);
  transition: all 0.2s;
}

.theme-toggle:hover {
  background: var(--accent-subtle);
  color: var(--accent);
}

/* ===== Accent Utilities ===== */
.text-accent {
  color: var(--accent) !important;
}

.bg-accent-subtle {
  background-color: var(--accent-subtle) !important;
}

.bg-subtle {
  background-color: var(--bg-subtle);
}

.btn-accent {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-accent:hover {
  background: var(--accent-hover);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(108, 92, 231, 0.3);
}

.btn-outline-secondary {
  border-radius: 12px;
  font-weight: 600;
  border-color: var(--card-border);
  color: var(--text);
}

.btn-outline-secondary:hover {
  background: var(--card-bg);
  border-color: var(--accent);
  color: var(--accent);
}

/* ===== Section ===== */
.py-section {
  padding: 100px 0;
}

.section-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--accent);
  text-transform: uppercase;
}

/* ===== Hero ===== */
.hero-section {
  min-height: 100vh;
  padding-top: 100px;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: "";
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(108, 92, 231, 0.15), transparent 70%);
  top: -100px;
  right: -200px;
  pointer-events: none;
}

.fw-800 {
  font-weight: 800;
}

.text-gradient {
  background: linear-gradient(135deg, var(--accent), #a29bfe, #fd79a8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.pulse {
  font-size: 0.5rem;
  animation: pulse 2s ease-in-out infinite;
}

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

/* ===== Code Block ===== */
.code-block {
  background: var(--code-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  overflow: hidden;
  text-align: left;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.code-header {
  padding: 12px 16px;
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--card-border);
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dot.red { background: #ff5f57; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #28c840; }

.code-block pre {
  margin: 0;
  padding: 24px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.7;
}

.code-keyword { color: #c792ea; }
.code-var { color: #82aaff; }
.code-prop { color: #f78c6c; }
.code-str { color: #c3e88d; }
.code-num { color: #f78c6c; }
.code-func { color: #82aaff; }

/* ===== Stats ===== */
.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  transition: all 0.3s;
}

.stat-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
  box-shadow: 0 10px 30px rgba(108, 92, 231, 0.15);
}

.stat-icon {
  font-size: 2rem;
  color: var(--accent);
}

/* ===== Profile Cards ===== */
.profile-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  overflow: hidden;
  transition: all 0.3s;
}

.profile-card:hover {
  border-color: var(--accent);
  box-shadow: 0 15px 50px rgba(108, 92, 231, 0.1);
  transform: translateY(-4px);
}

.avatar-wrapper {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--accent);
  padding: 4px;
  background: var(--accent-subtle);
}

.avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.social-links a {
  color: var(--text-secondary);
  font-size: 1.2rem;
  transition: color 0.2s;
}

.social-links a:hover {
  color: var(--accent);
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tech-tag {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  background: var(--accent-subtle);
  color: var(--accent);
  border: 1px solid transparent;
  transition: all 0.2s;
}

.tech-tag:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* ===== Mini Tech Tags ===== */
.tech-tags-mini {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tech-tag-mini {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 500;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--card-border);
  transition: all 0.2s;
}

.tech-tag-mini:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ===== Timeline ===== */
.timeline {
  position: relative;
  padding-left: 24px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--card-border);
}

.timeline-item {
  position: relative;
  padding-bottom: 24px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -21px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--card-bg);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

.timeline-content {
  background: var(--bg-subtle);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 16px;
  transition: all 0.2s;
}

.timeline-content:hover {
  border-color: var(--accent);
}

/* ===== Skills Grid ===== */
.skill-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  transition: all 0.3s;
}

.skill-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
  box-shadow: 0 8px 25px rgba(108, 92, 231, 0.12);
}

.skill-card img {
  transition: transform 0.3s;
}

.skill-card:hover img {
  transform: scale(1.15);
}

[data-bs-theme="dark"] .icon-invert {
  filter: invert(1);
}

/* ===== Contact Form ===== */
.contact-form .form-control {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  color: var(--text);
  padding: 0.75rem 1rem;
  transition: all 0.2s;
}

.contact-form .form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
  background: var(--card-bg);
  color: var(--text);
}

.contact-form .form-control::placeholder {
  color: var(--text-secondary);
  opacity: 0.6;
}

.form-label {
  color: var(--text-secondary);
}

/* ===== Product Cards ===== */
.product-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  transition: all 0.3s;
  color: var(--text);
}

.product-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(108, 92, 231, 0.15);
  color: var(--text);
}

.product-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: var(--accent-subtle);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

/* ===== Location Cards ===== */
.location-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  transition: all 0.3s;
}

.location-card:hover {
  border-color: var(--accent);
}

/* ===== Work Info ===== */
.work-info {
  padding: 12px 16px;
  background: var(--bg-subtle);
  border-radius: 12px;
  border: 1px solid var(--card-border);
}

/* ===== Footer ===== */
footer {
  border-color: var(--card-border) !important;
}

footer a:hover {
  color: var(--accent) !important;
}

/* ===== Animations ===== */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-hover);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .hero-section {
    text-align: center;
    min-height: auto;
    padding: 120px 0 80px;
  }

  .hero-section .d-flex {
    justify-content: center;
  }

  .display-3 {
    font-size: 2.2rem;
  }

  .display-5 {
    font-size: 1.8rem;
  }

  .py-section {
    padding: 60px 0;
  }

  .avatar-wrapper {
    width: 120px;
    height: 120px;
  }

  .profile-card .row {
    text-align: center;
  }

  .tech-tags {
    justify-content: center;
  }

  .tech-tags-mini {
    justify-content: center;
  }

  .timeline-content .d-flex {
    flex-direction: column;
  }

  .profile-card .col-md-8 {
    text-align: left !important;
  }
}
