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

:root {
  /* Dark theme color palette */
  --bg-primary: #0a0a0a;
  --bg-secondary: #111111;
  --bg-card: #1a1a1a;
  --bg-card-hover: #222222;
  --bg-popup: #1f1f1f;
  --text-primary: #ffffff;
  --text-secondary: #b3b3b3;
  --text-muted: #888888;
  --accent-primary: #3b82f6;
  --accent-secondary: #8b5cf6;
  --accent-success: #10b981;
  --accent-warning: #f59e0b;
  --border-color: #333333;
  --shadow-color: rgba(0, 0, 0, 0.5);
  --gradient-primary: linear-gradient(135deg, #3b82f6, #8b5cf6);
  --gradient-card: linear-gradient(135deg, #1a1a1a, #222222);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  scroll-behavior: smooth;
  line-height: 1.7;
  font-weight: 400;
  min-height: 100vh;
}

.page-background {
  background: radial-gradient(ellipse at top, #1a1a1a 0%, #0a0a0a 100%);
  min-height: 100vh;
  padding: 20px;
}

/* Main container */
.page-wrapper {
  max-width: 1100px;
  margin: 0 auto;
  padding: 60px 40px;
  background: var(--gradient-card);
  border-radius: 24px;
  box-shadow: 
    0 20px 60px var(--shadow-color),
    0 0 0 1px var(--border-color);
  animation: fadeInUp 1s ease-out;
  position: relative;
  overflow: hidden;
  /* Remove the loading class behavior that was causing issues */
  opacity: 1;
  transform: translateY(0);
}

.page-wrapper::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--gradient-primary);
  opacity: 0.6;
}

/* Cards */
.card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 32px;
  margin-bottom: 32px;
  border: 1px solid var(--border-color);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(139, 92, 246, 0.05));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 
    0 25px 70px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.3);
}

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

/* Header */
.header-content {
  text-align: center;
  position: relative;
  z-index: 1;
}

header h1 {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

header h2 {
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

/* Sections */
section {
  text-align: center;
  position: relative;
  z-index: 1;
}

section h3 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

section p {
  font-size: clamp(1rem, 2.5vw, 1.1rem);
  color: var(--text-secondary);
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.8;
}

/* Project cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 32px;
}

.card-inner {
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 28px 24px;
  border: 1px solid var(--border-color);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.card-inner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.card-inner:hover {
  transform: translateY(-6px);
  background: var(--bg-card-hover);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
  border-color: rgba(59, 130, 246, 0.4);
}

.card-inner:hover::before {
  transform: scaleX(1);
}

.card-inner h4 {
  color: var(--text-primary);
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.card-inner a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  position: relative;
}

.card-inner a::after {
  content: '→';
  transition: transform 0.3s ease;
}

.card-inner a:hover {
  color: var(--accent-secondary);
  transform: translateX(4px);
}

.card-inner a:hover::after {
  transform: translateX(4px);
}

/* Skill tags */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 24px;
}

.tags span {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
  color: var(--accent-primary);
  padding: 10px 18px;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid rgba(59, 130, 246, 0.2);
  transition: all 0.3s ease;
  cursor: default;
}

.tags span:hover {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.2));
  border-color: rgba(59, 130, 246, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}

/* Education */
.education-item {
  background: var(--bg-secondary);
  padding: 28px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  margin-top: 20px;
}

.education-item p {
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.education-item p:last-child {
  margin-bottom: 0;
}

/* Welcome popup */
.popup {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10000;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
}

.popup-content {
  background: var(--bg-popup);
  padding: 40px 32px;
  border-radius: 20px;
  box-shadow: 
    0 25px 80px rgba(0, 0, 0, 0.8),
    0 0 0 1px var(--border-color);
  width: 90vw;
  max-width: 480px;
  position: relative;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.popup-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-primary);
  border-radius: 20px 20px 0 0;
}

.popup.visible {
  display: block;
  opacity: 1;
}

.popup p {
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: 1rem;
  margin: 0;
}

.close-btn {
  position: absolute;
  top: 16px;
  right: 20px;
  font-size: 1.8rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.3s ease;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.close-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.1);
  transform: rotate(90deg);
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.animate {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered animation delays */
.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }
.card:nth-child(4) { animation-delay: 0.4s; }
.card:nth-child(5) { animation-delay: 0.5s; }
.card:nth-child(6) { animation-delay: 0.6s; }

/* Responsive Design */
@media (max-width: 768px) {
  .page-background {
    padding: 10px;
  }
  
  .page-wrapper {
    padding: 40px 24px;
    margin: 10px 0;
  }

  .card {
    padding: 24px 20px;
    margin-bottom: 24px;
  }

  .card-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .tags {
    gap: 8px;
  }
  
  .tags span {
    padding: 8px 14px;
    font-size: 0.85rem;
  }

  .popup-content {
    padding: 32px 24px;
    width: 95vw;
    max-width: 360px;
  }
}

@media (max-width: 480px) {
  .page-wrapper {
    padding: 32px 20px;
  }
  
  .card {
    padding: 20px 16px;
  }
  
  .card-inner {
    padding: 24px 20px;
  }
  
  .popup-content {
    padding: 28px 20px;
  }
}

/* Smooth scrolling enhancement */
html {
  scroll-behavior: smooth;
}

/* Focus states for accessibility */
.card-inner a:focus,
.close-btn:focus {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}
