/* --- Imports --- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

/* --- Reset & Global --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: #1a0f3d;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #7c3aed 0%, #b794f6 50%, #ff6ec7 100%);
  border-radius: 6px;
  border: 2px solid #1a0f3d;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #8b5cf6 0%, #c4b5fd 50%, #ff8fd6 100%);
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: #b794f6 #1a0f3d;
}

body {
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  background: linear-gradient(180deg, #251853 0%, #1a0f3d 50%, #0f0828 100%);
  min-height: 100vh;
  color: #fff;
  padding: 2rem;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  height: 100%;
  max-height: calc(100vh + 12rem);
  background: radial-gradient(ellipse at bottom, rgba(139, 92, 246, 0.35) 0%, rgba(109, 40, 217, 0.2) 40%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  filter: blur(60px);
}

/* Home Button */
.home-btn {
  position: absolute;
  top: 2rem;
  left: 2rem;
  padding: 0.75rem 1.5rem;
  background: rgba(183, 148, 246, 0.15);
  border: 1px solid rgba(183, 148, 246, 0.3);
  border-radius: 8px;
  color: #b794f6;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s;
  font-size: 0.95rem;
  z-index: 100;
}

.home-btn:hover {
  background: rgba(183, 148, 246, 0.25);
  border-color: #b794f6;
  transform: translateY(-2px);
}

/* Container */
.container {
  max-width: 1600px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 3rem;
  padding-top: 2rem;
}

.header h1 {
  font-size: 3rem;
  font-weight: 800;
  background: linear-gradient(135deg, #ff6ec7 0%, #b794f6 50%, #7c3aed 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
  font-family: 'Poppins', sans-serif;
}

.header p {
  font-size: 1.2rem;
  color: rgba(183, 148, 246, 0.8);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Projects Grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* Ensure only 3 cards per row */
  gap: 2rem;
  margin-bottom: 2rem;
}

.project-card {
  background: rgba(30, 20, 60, 0.4);
  border: 1px solid rgba(183, 148, 246, 0.2);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.1s ease, border-color 0.3s ease;
  transform-style: preserve-3d;
  will-change: transform;
  position: relative;
  --mouse-x: 50%;
  --mouse-y: 50%;
}

/* Holographic foil effect */
.project-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    250px circle at var(--mouse-x) var(--mouse-y),
    rgba(255, 255, 255, 0.015) 0%,
    rgba(255, 110, 199, 0.033) 2%,
    rgba(255, 110, 199, 0.032) 4%,
    rgba(255, 110, 199, 0.031) 6%,
    rgba(255, 110, 199, 0.03) 8%,
    rgba(255, 110, 199, 0.029) 10%,
    rgba(255, 110, 199, 0.028) 12%,
    rgba(183, 148, 246, 0.027) 14%,
    rgba(183, 148, 246, 0.0265) 16%,
    rgba(183, 148, 246, 0.026) 18%,
    rgba(183, 148, 246, 0.0255) 20%,
    rgba(183, 148, 246, 0.025) 22%,
    rgba(183, 148, 246, 0.024) 24%,
    rgba(183, 148, 246, 0.023) 26%,
    rgba(124, 58, 237, 0.022) 28%,
    rgba(124, 58, 237, 0.021) 30%,
    rgba(124, 58, 237, 0.02) 32%,
    rgba(124, 58, 237, 0.019) 34%,
    rgba(124, 58, 237, 0.018) 36%,
    rgba(124, 58, 237, 0.017) 38%,
    rgba(124, 58, 237, 0.016) 40%,
    rgba(124, 58, 237, 0.015) 42%,
    rgba(124, 58, 237, 0.014) 44%,
    rgba(124, 58, 237, 0.013) 46%,
    rgba(124, 58, 237, 0.012) 48%,
    rgba(124, 58, 237, 0.011) 50%,
    rgba(124, 58, 237, 0.010) 52%,
    rgba(124, 58, 237, 0.009) 54%,
    rgba(124, 58, 237, 0.008) 56%,
    rgba(124, 58, 237, 0.007) 58%,
    rgba(124, 58, 237, 0.006) 60%,
    rgba(124, 58, 237, 0.005) 62%,
    rgba(124, 58, 237, 0.0045) 64%,
    rgba(124, 58, 237, 0.004) 66%,
    rgba(124, 58, 237, 0.0035) 68%,
    rgba(124, 58, 237, 0.003) 70%,
    rgba(124, 58, 237, 0.0025) 72%,
    rgba(124, 58, 237, 0.002) 74%,
    rgba(124, 58, 237, 0.0015) 76%,
    rgba(124, 58, 237, 0.0012) 78%,
    rgba(124, 58, 237, 0.001) 80%,
    rgba(124, 58, 237, 0.0008) 82%,
    rgba(124, 58, 237, 0.0006) 84%,
    rgba(124, 58, 237, 0.0005) 86%,
    rgba(124, 58, 237, 0.0004) 88%,
    rgba(124, 58, 237, 0.0003) 90%,
    rgba(124, 58, 237, 0.00025) 92%,
    rgba(124, 58, 237, 0.0002) 94%,
    rgba(124, 58, 237, 0.00015) 96%,
    rgba(124, 58, 237, 0.0001) 98%,
    rgba(124, 58, 237, 0.00005) 99%,
    transparent 100%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 0;
  mix-blend-mode: color-dodge;
  filter: blur(35px);
}

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

.project-card:hover {
  border-color: rgba(183, 148, 246, 0.5);
  box-shadow: 0 8px 30px rgba(183, 148, 246, 0.2);
}

.project-image {
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: rgba(20, 15, 40, 0.6);
  position: relative;
  z-index: 1;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-info {
  padding: 1.5rem;
  /* leave extra space at the bottom so absolutely-positioned buttons don't overlap content */
  padding-bottom: 3.75rem;
  position: relative;
  z-index: 1;
}

.project-info h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.5rem;
  font-family: 'Poppins', sans-serif;
}

.project-date {
  font-size: 0.9rem;
  color: rgba(183, 148, 246, 0.8);
  margin-bottom: 1rem;
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tech-tag {
  padding: 0.35rem 0.9rem;
  border: none;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  background: rgba(183, 148, 246, 0.3); /* Default fallback */
}

/* Language-specific colors based on data attributes */
.tech-tag[data-tech="html"] {
  background: linear-gradient(135deg, #e34c26 0%, #f06529 100%);
}

.tech-tag[data-tech="css"] {
  background: linear-gradient(135deg, #1572b6 0%, #33a9dc 100%);
}

.tech-tag[data-tech="js"] {
  background: linear-gradient(135deg, #f7df1e 0%, #f0db4f 100%);
  color: #000000;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
}

.tech-tag[data-tech="python"] {
  background: linear-gradient(135deg, #3776ab 0%, #ffd43b 100%);
}

.project-description {
  font-size: 1rem;
  line-height: 1.7;
  color: #d4d4d8;
  margin-bottom: 1.5rem;
}

/* Positioning class for buttons placed directly in project-card */
.project-card .btn-positioned {
  position: absolute !important;
  bottom: 1.25rem !important;
  right: 1.25rem !important;
  z-index: 10 !important;
  margin: 0 !important;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, #ff6ec7 0%, #b794f6 50%, #7c3aed 100%);
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.project-card .btn-positioned:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(183, 148, 246, 0.4);
}

.project-card .btn-positioned.disabled {
  background: rgba(100, 100, 100, 0.3);
  cursor: not-allowed;
  opacity: 0.5;
}

.project-card .btn-positioned.disabled:hover {
  transform: none;
  box-shadow: none;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  body {
    padding: 1rem;
  }
  
  .home-btn {
    top: 1rem;
    left: 1rem;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }
  
  .header {
    padding-top: 1rem;
    margin-bottom: 2rem;
  }
  
  .header h1 {
    font-size: 2.5rem;
  }
  
  .header p {
    font-size: 1.1rem;
  }
  
  .projects-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* Very small screens */
@media (max-width: 480px) {
  .header h1 {
    font-size: 2rem;
  }
  
  .header p {
    font-size: 1rem;
  }
  
  .project-card .btn-positioned {
    position: static !important;
    display: block;
    width: 100%;
    margin-top: 1rem !important;
    text-align: center;
    right: auto !important;
    bottom: auto !important;
  }
  
  .project-info {
    padding-bottom: 1.5rem;
  }
}