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

body {
  font-family: 'Inter', sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  color: #222;
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

a {
  text-decoration: none;
  color: inherit;
}

/* Header Styles */
.ml-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #ffffff;
  padding: 4rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  z-index: 10;
}

.ml-header::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  animation: float 20s ease-in-out infinite;
  opacity: 0.3;
}

@keyframes float {
  0%, 100% { transform: translateX(0) translateY(0) rotate(0deg); }
  25% { transform: translateX(-20px) translateY(-20px) rotate(90deg); }
  50% { transform: translateX(20px) translateY(-10px) rotate(180deg); }
  75% { transform: translateX(-10px) translateY(20px) rotate(270deg); }
}

.header-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
}

.ml-header h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  margin-bottom: 1rem;
  text-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.ml-header p {
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  font-weight: 400;
  opacity: 0.9;
  margin-bottom: 2rem;
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #6a11cb, #2575fc);
  color: #fff;
  padding: 0.75rem 1.75rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
  font-size: 0.95rem;
  z-index: 10;
}

.back-button:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  background: linear-gradient(135deg, #8e2de2, #4a00e0);
  color: #fff !important;
}

/* Main Content */
.ml-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.projects-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
}

/* Project Cards */
.project-card {
  background: linear-gradient(145deg, #ffffff, #f0f0f0);
  border-radius: 20px;
  padding: 2rem;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: auto;
  z-index: 1;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
  transition: left 0.6s;
}

.project-card:hover::before {
  left: 100%;
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(102, 126, 234, 0.15);
  background: linear-gradient(145deg, #fff, #f8f9ff);
}

.project-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 15px;
  margin-bottom: 1.5rem;
  transition: all 0.3s ease;
}

.project-icon i {
  font-size: 1.5rem;
  color: #fff;
}

.project-card:hover .project-icon {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.project-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.project-content h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: #333;
  font-weight: 700;
}

.project-content p {
  font-size: 1rem;
  color: #666;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  flex: 1;
}

/* Tech Stack Tags */
.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.tech-tag {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  padding: 0.25rem 0.75rem;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

/* View Code Button */
.view-code-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border-radius: 10px;
  font-weight: 600;
  transition: all 0.3s ease;
  align-self: flex-start;
  position: relative;
  overflow: hidden;
}

.view-code-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.view-code-btn:hover::before {
  left: 100%;
}

.view-code-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
  background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

.view-code-btn i {
  font-size: 1rem;
}

/* Animations */
.fade-in {
  animation: fadeIn 0.8s ease-out forwards;
}

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

/* Responsive Design */
@media (max-width: 768px) {
  .ml-header {
    padding: 3rem 1rem;
  }

  .ml-main {
    padding: 2rem 1rem;
  }

  .projects-container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .project-card {
    padding: 1.5rem;
  }

  .project-content h3 {
    font-size: 1.3rem;
  }

  .project-content p {
    font-size: 0.95rem;
  }
}

@media (max-width: 480px) {
  .ml-header {
    padding: 2rem 1rem;
  }

  .ml-main {
    padding: 1.5rem 1rem;
  }

  .project-card {
    padding: 1rem;
  }

  .project-icon {
    width: 50px;
    height: 50px;
    margin-bottom: 1rem;
  }

  .project-icon i {
    font-size: 1.2rem;
  }

  .project-content h3 {
    font-size: 1.2rem;
  }

  .tech-tag {
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
  }

  .view-code-btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
  }
}