/* ===== CUSTOM SCROLLBAR ===== */
html {
  scrollbar-width: thin;
  scrollbar-color: #ff9f00 rgba(255, 255, 255, 0.05);
}

html::-webkit-scrollbar {
  width: 10px;
}

html::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

html::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #ff9f00, #ff6b6b);
  border-radius: 10px;
}

html::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #ffb733, #ff8585);
}

body.light-mode {
  scrollbar-color: #ff9f00 rgba(0, 0, 0, 0.08);
}

.modal-box {
  scrollbar-width: thin;
  scrollbar-color: #ff9f00 rgba(255, 255, 255, 0.05);
}

.modal-box::-webkit-scrollbar {
  width: 8px;
}

.modal-box::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
}

.modal-box::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #ff9f00, #ff6b6b);
  border-radius: 8px;
}

.modal-box::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #ffb733, #ff8585);
}

body.light-mode .modal-box {
  scrollbar-color: #ff9f00 rgba(0, 0, 0, 0.06);
}

body.light-mode .modal-box::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.06);
}

/* ===== PARTICLE CANVAS ===== */
#page-particle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* ---- PROJECT SHOWCASE ---- */
.project-showcase {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 2rem;
  text-align: center;
  position: relative;
  z-index: 1;
}

.project-showcase h1 {
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  font-weight: 800;
  margin-bottom: 10px;
  background: linear-gradient(135deg, #ff9f00, #ff6b6b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 30px rgba(255, 159, 0, 0.25));
  animation: projectReveal 1s ease-out;
}

.showcase-intro {
  color: #aaa;
  font-size: 1.05rem;
  max-width: 600px;
  margin: 0 auto 8px;
  line-height: 1.6;
  animation: projectReveal 1s ease-out 0.2s backwards;
}

.project-showcase-divider {
  width: 120px;
  height: 3px;
  margin: 0 auto 2rem;
  border-radius: 3px;
  background: linear-gradient(90deg, #ff9f00, #ff6b6b, #ff9f00);
  background-size: 200% 100%;
  animation: gradientShift 3s ease infinite, projectReveal 1s ease-out 0.4s backwards;
}

@keyframes projectReveal {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

body.light-mode .showcase-intro {
  color: #666;
}

/* ===== PROJECT STATS BANNER ===== */
.project-stats-banner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
  animation: projectReveal 1s ease-out 0.5s backwards;
}

.project-stat-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 1.2rem 0.5rem;
  backdrop-filter: blur(10px);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(255, 159, 0, 0.12);
}

.project-stat-card i {
  font-size: 1.4rem;
  background: linear-gradient(135deg, #ff9f00, #ff6b6b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.4rem;
  display: block;
}

.project-stat-number {
  font-size: 1.8rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}

.project-stat-label {
  font-size: 0.8rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

body.light-mode .project-stat-card {
  background: rgba(255, 159, 0, 0.06);
  border-color: rgba(255, 159, 0, 0.15);
}

body.light-mode .project-stat-number {
  color: #222;
}

body.light-mode .project-stat-label {
  color: #666;
}

/* ===== SEARCH BAR ===== */
.project-search-wrap {
  max-width: 420px;
  margin: 0 auto 1.5rem;
  position: relative;
}

.project-search-wrap i.fa-search {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #888;
  font-size: 0.9rem;
  pointer-events: none;
  transition: color 0.3s ease;
}

.project-search {
  width: 100%;
  padding: 12px 40px 12px 42px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-size: 0.95rem;
  outline: none;
  backdrop-filter: blur(10px);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  box-sizing: border-box;
}

.project-search::placeholder {
  color: #777;
}

.project-search:focus {
  border-color: #ff9f00;
  box-shadow: 0 0 16px rgba(255, 159, 0, 0.2);
}

.project-search:focus ~ i.fa-search {
  color: #ff9f00;
}

.search-clear {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #888;
  font-size: 1rem;
  cursor: pointer;
  display: none;
  padding: 4px;
  line-height: 1;
}

.search-clear.visible {
  display: block;
}

body.light-mode .project-search {
  background: rgba(0, 0, 0, 0.04);
  border-color: #ddd;
  color: #222;
}

body.light-mode .project-search::placeholder {
  color: #999;
}

body.light-mode .project-search:focus {
  border-color: #ff9f00;
  box-shadow: 0 0 16px rgba(255, 159, 0, 0.15);
}

/* ===== FILTER ROW (tabs + view toggle) ===== */
.filter-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

/* Filter Tabs */
.filter-tabs {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0;
}

.filter-btn {
  padding: 8px 18px;
  border: 2px solid #ff9f00;
  background: transparent;
  color: #ff9f00;
  border-radius: 25px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.filter-btn.active,
.filter-btn:hover {
  background: #ff9f00;
  color: #fff;
}

/* ===== VIEW TOGGLE ===== */
.view-toggle {
  display: flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.view-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: #888;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.view-btn.active {
  background: linear-gradient(135deg, #ff9f00, #ff6b6b);
  color: #fff;
}

.view-btn:hover:not(.active) {
  color: #ff9f00;
}

body.light-mode .view-toggle {
  background: rgba(0, 0, 0, 0.04);
  border-color: #ddd;
}

/* ===== NO RESULTS ===== */
.no-results {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 3rem 1rem;
  color: #666;
  font-size: 1.05rem;
}

.no-results.visible {
  display: flex;
}

.no-results i {
  font-size: 2.5rem;
  background: linear-gradient(135deg, #ff9f00, #ff6b6b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  opacity: 0.5;
}

/* ===== PROJECT GRID ===== */
.project-grid {
  display: grid !important;
  gap: 2rem;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  margin-top: 2rem;
  perspective: 1000px;
}

/* ===== LIST VIEW ===== */
.project-grid.list-view {
  grid-template-columns: 1fr;
}

.project-grid.list-view .project-card {
  display: grid;
  grid-template-columns: 260px 1fr;
  grid-template-rows: 1fr auto;
}

.project-grid.list-view .project-card img {
  height: 100%;
  min-height: 200px;
  grid-row: 1 / -1;
  border-radius: 15px 0 0 15px;
}

.project-grid.list-view .project-content {
  padding: 1.2rem 1.5rem;
}

.project-grid.list-view .project-footer {
  grid-column: 2;
  padding: 0 1.5rem 1rem;
}

/* ===== CARD STAGGERED ENTRANCE ===== */
.project-card {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 15px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: transform .3s ease, box-shadow .3s ease;
  will-change: transform;
  position: relative;
  opacity: 0;
}

.project-card.card-visible {
  animation: cardSlideUp 0.5s ease-out forwards;
}

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

/* ===== CARD SHINE SWEEP ===== */
.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    120deg,
    transparent 0%,
    rgba(255, 255, 255, 0.08) 40%,
    rgba(255, 255, 255, 0.15) 50%,
    rgba(255, 255, 255, 0.08) 60%,
    transparent 100%
  );
  z-index: 2;
  pointer-events: none;
  transition: none;
}

.project-card:hover::before {
  left: 150%;
  transition: left 0.6s ease;
}

body.light-mode .project-card::before {
  background: linear-gradient(
    120deg,
    transparent 0%,
    rgba(255, 159, 0, 0.06) 40%,
    rgba(255, 159, 0, 0.12) 50%,
    rgba(255, 159, 0, 0.06) 60%,
    transparent 100%
  );
}

/* ===== RADIAL GLOW (existing) ===== */
.project-card::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.3s ease;
  background: radial-gradient(600px circle at var(--glow-x, 50%) var(--glow-y, 50%), rgba(255, 159, 0, 0.08), transparent 40%);
  pointer-events: none;
  z-index: 1;
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(255, 159, 0, 0.15);
}

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

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

.project-content {
  padding: 1rem;
  text-align: left;
}

.project-stats,
.project-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.project-tags span {
  background: rgba(255, 159, 0, 0.2);
  padding: 4px 8px;
  border-radius: 8px;
  color: #ff9f00;
  font-size: 0.8rem;
}

.project-footer {
  padding: 1rem;
}

.project-link {
  background: #ff9f00;
  color: #fff;
  padding: 8px 14px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  cursor: pointer;
}

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

/* ---- RESEARCH ---- */
.research-section {
  max-width: 800px;
  margin: 3rem auto;
  padding: 2rem;
  text-align: center;
}

/* ===== TECH STACK PILLS ===== */
.tech-pills-section {
  max-width: 1200px;
  margin: 0 auto 2rem;
  padding: 0 2rem;
  text-align: center;
}

.tech-pills-section h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 1.2rem;
  background: linear-gradient(135deg, #ff9f00, #ff6b6b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tech-pills-wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.tech-pill {
  padding: 8px 16px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #e6e6e6;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  position: relative;
  animation: floatBob 4s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.25s);
  transition: all 0.35s ease;
  backdrop-filter: blur(8px);
  user-select: none;
}

.tech-pill:hover {
  border-color: #ff9f00;
  color: #ff9f00;
  box-shadow: 0 0 14px rgba(255, 159, 0, 0.15);
  transform: scale(1.08);
}

.tech-pill.active {
  background: linear-gradient(135deg, #ff9f00, #ff6b6b);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(255, 159, 0, 0.3);
  transform: scale(1.1);
}

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

body.light-mode .tech-pill {
  background: rgba(255, 159, 0, 0.06);
  border-color: rgba(255, 159, 0, 0.2);
  color: #555;
}

body.light-mode .tech-pill:hover {
  color: #ff9f00;
  background: rgba(255, 159, 0, 0.1);
}

body.light-mode .tech-pill.active {
  color: #fff;
  background: linear-gradient(135deg, #ff9f00, #ff6b6b);
}

/* ---- DARK/LIGHT SUPPORT ---- */
body.light-mode .project-card {
  background: #fff;
  border-color: #ddd;
}

body.dark-mode .project-card {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}

/* ===== MODAL BACKDROP ===== */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  justify-content: center;
  align-items: center;
  z-index: 2000;
  padding: 20px;
  overflow: hidden;
}

/* ===== MODAL BOX ===== */
.modal-box {
  background: #1f1f1f;
  border-radius: 14px;
  padding: 24px;
  max-width: 760px;
  width: 100%;
  color: #fff;
  position: relative;
  animation: fadeIn .28s ease-out;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: 90vh;
  box-sizing: border-box;
}

body.light-mode .modal-box {
  background: #fff;
  color: #111;
}

/* ===== MODAL IMAGE ===== */
.modal-box img {
  width: 100%;
  height: auto;
  max-height: 240px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 1rem;
}

/* ===== CLOSE BUTTON ===== */
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #ff3b3b;
  color: #fff;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  border: 2px solid #fff;
  z-index: 50;
}

/* ===== SECTIONS ===== */
.modal-section {
  margin: 0.75rem 0;
  text-align: left;
  white-space: normal;
}

.modal-section h4 {
  margin-bottom: 0.3rem;
  color: #ff9f00;
  font-weight: 600;
}

/* ===== TAGS ===== */
.modal-tags span {
  background: #ff9f00;
  color: #fff;
  padding: 5px 8px;
  margin-right: 5px;
  border-radius: 6px;
  font-size: 0.8rem;
  display: inline-block;
  margin-bottom: 5px;
}

/* ===== MODAL ACTION BUTTONS ===== */
.modal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.modal-github-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #24292e;
  color: #fff;
  padding: 8px 14px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.9rem;
  white-space: nowrap;
}

.modal-demo-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #ff9f00, #ff6b6b);
  color: #fff;
  padding: 8px 14px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.9rem;
  white-space: nowrap;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.modal-demo-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 159, 0, 0.3);
}

/* Modal Animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .project-showcase {
    padding: 1.5rem 1rem;
  }

  .modal-box {
    padding: 16px;
    border-radius: 12px;
  }

  .modal-backdrop {
    padding: 12px;
  }

  .project-stats-banner {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .project-stat-number {
    font-size: 1.5rem;
  }

  .project-grid.list-view {
    grid-template-columns: 1fr;
  }

  .project-grid.list-view .project-card {
    display: block;
  }

  .project-grid.list-view .project-card img {
    height: 200px;
    border-radius: 15px 15px 0 0;
  }

  .project-grid.list-view .project-footer {
    grid-column: auto;
  }

  .filter-row {
    gap: 0.75rem;
  }

  .tech-pills-section {
    padding: 0 1rem;
  }
}

@media (max-width: 480px) {
  .filter-btn {
    padding: 10px 16px;
    font-size: 0.85rem;
    min-height: 44px;
  }

  .project-showcase h1 {
    font-size: 1.8rem;
  }

  .modal-box img {
    max-height: 180px;
  }

  .project-stats-banner {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }

  .project-stat-card {
    padding: 0.9rem 0.4rem;
  }

  .project-stat-number {
    font-size: 1.3rem;
  }

  .project-stat-label {
    font-size: 0.7rem;
  }

  .project-search {
    font-size: 0.9rem;
    padding: 10px 36px 10px 38px;
  }

  .view-toggle {
    display: none;
  }
}
