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

html {
  scroll-behavior: smooth;
}

:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f9f9f9;
  --text-primary: #222;
  --text-secondary: #555;
  --accent-color: #e91e63;
  --card-bg: #fff;
  --header-bg: #fff;
  --hero-gradient: linear-gradient(to right, #ffe3ec, #fceabb);
  --shadow-color: rgba(0, 0, 0, 0.05);
  --animation-duration: 0.6s;
}

[data-theme="dark"] {
  --bg-primary: #121212;
  --bg-secondary: #1e1e1e;
  --text-primary: #ffffff;
  --text-secondary: #b3b3b3;
  --card-bg: #242424;
  --header-bg: #1a1a1a;
  --hero-gradient: linear-gradient(to right, #2c1e26, #2b2516);
  --shadow-color: rgba(0, 0, 0, 0.2);
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Header */
header {
  background: var(--header-bg);
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.3s ease;
}

.about,
.experience,
.projects,
.contact,
.socials {
  font-family: "Caveat", cursive;
}

/* Navigation */
nav {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 2rem;
}

nav a {
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  transition: color 0.3s;
}

nav a:hover {
  color: #e91e63;
}

/* Hero Section */
.hero {
  padding-top: 120px;
  padding-bottom: 80px;
  text-align: center;
  background: var(--hero-gradient);
  transition: background 0.3s ease;
}

.hero img {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 20px;
  border: 4px solid #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.hero p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

/* Section Styling */
section {
  padding: 80px 20px;
  max-width: 1000px;
  margin: auto;
}

section h2 {
  font-size: 2rem;
  text-align: center;
  margin-bottom: 2rem;
  color: var(--text-primary);
}

/* Cards */
.card {
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: 0 4px 16px var(--shadow-color);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: transform 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
}

.card h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.card small {
  color: var(--text-secondary);
}

.card p {
  margin-top: 0.5rem;
}

/* Project container for image and text side by side */
.project-container {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

.project-image-container {
  flex-shrink: 0;
  width: 6.25%; /* 1/16 of the original container width (25% ÷ 4) */
  min-width: 1cm; /* Adding a fixed minimum width of 1cm */
}

.certification-image-container {
  flex-shrink: 0;
  width: 18.75%; /* 3x larger than project images */
  min-width: 3cm; /* 3x larger than project images */
}

.project-content {
  flex-grow: 1;
}

.project-image-small {
  width: 100%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.project-image {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  border-radius: 8px;
  margin-top: 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

/* Footer */
footer {
  text-align: center;
  padding: 40px 0;
  color: #999;
  font-size: 0.9rem;
}

/* Social Section */
#socials {
  padding: 60px 20px;
  text-align: center;
}

#socials h2 {
  font-size: 2rem;
  margin-bottom: 2rem;
  color: #111;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 25px;
  flex-wrap: wrap;
}

.social-links a img {
  width: 40px;
  height: 40px;
  transition: transform 0.3s ease, opacity 0.3s ease;
  border-radius: 8px;
}

social-links a:hover img {
  transform: scale(1.1);
  opacity: 0.8;
}

/* Contact */
#contact {
  padding: 80px 20px;
  background: #f9f9f9;
  text-align: center;
}

#contact h2 {
  font-size: 2rem;
  margin-bottom: 2rem;
  color: #111;
}

.contact-form {
  max-width: 600px;
  margin: auto;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.contact-form input,
.contact-form textarea {
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid #ddd;
  font-size: 1rem;
  font-family: "Inter", sans-serif;
  background: #fff;
  transition: border-color 0.3s, box-shadow 0.3s;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: #e91e63;
  box-shadow: 0 0 0 3px rgba(233, 30, 99, 0.1);
}

.contact-form button {
  background: #e91e63;
  color: white;
  border: none;
  padding: 1rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
  box-shadow: 0 4px 12px rgba(233, 30, 99, 0.2);
}

.contact-form button:hover {
  background: #d81b60;
  transform: translateY(-2px);
}

/* Tech Stack */
#techstack {
  padding: 80px 20px;
  background: #ffffff;
  text-align: center;
}

#techstack h2 {
  font-size: 2rem;
  margin-bottom: 2.5rem;
  color: #111;
}

.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 30px;
  max-width: 900px;
  margin: 0 auto;
  align-items: center;
}

.tech-item {
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease;
}

.tech-item:hover {
  transform: translateY(-5px);
}

.tech-item img {
  width: 50px;
  height: 50px;
  margin-bottom: 10px;
}

.tech-item span {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
}

/* Gallery */
#gallery {
  padding: 80px 20px;
  background-color: #fafafa;
  text-align: center;
}

#gallery h2 {
  font-size: 2rem;
  margin-bottom: 2.5rem;
  color: #111;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* Changed to exactly 4 columns */
  gap: 20px;
  padding: 20px;
  background: var(--bg-secondary);
  border-radius: 12px;
  margin: 0 auto;
  max-width: 1400px; /* Increased max-width to accommodate 4 columns */
}

.gallery-grid img {
  width: 100%;
  aspect-ratio: 1; /* Makes images square */
  object-fit: cover;
  border-radius: 12px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Add responsive design for smaller screens */
@media (max-width: 1200px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
}

/* Custom Cursor */
.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: 10000;
  transform: translate(0, 0);
}

.cursor-dot {
  width: 6px;
  height: 6px;
  background: #00f0ff;
  mix-blend-mode: difference;
}

.cursor-ring {
  width: 36px;
  height: 36px;
  border: 2px solid #00f0ff;
  transition: transform 0.15s ease-out, border 0.25s ease-out;
}

/* Hide cursor on small screens */
@media (max-width: 768px) {
  .cursor-dot,
  .cursor-ring {
    display: none;
  }
}

/* Light grid overlay */
body::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: linear-gradient(transparent 95%, rgba(255, 255, 255, 0.02)),
    linear-gradient(90deg, transparent 95%, rgba(255, 255, 255, 0.02));
  background-size: 40px 40px;
  z-index: 0;
}

/* Intro Text */
.intro-text {
  font-family: "Caveat", cursive;
  font-weight: 700;
  font-style: italic;
  font-size: 2.5rem;
  color: #e91e63 !important;
  text-align: center;
  margin-top: 2rem;
  letter-spacing: 1px;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
  display: block;
  opacity: 1;
}

#theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  font-size: 1.2rem;
  border-radius: 50%;
  transition: background-color 0.3s;
}

#theme-toggle:hover {
  background-color: var(--bg-secondary);
}

/* Download Resume Button */
.download-resume {
  background: var(--accent-color, #e91e63);
  color: white !important;
  padding: 8px 16px;
  border-radius: 6px;
  transition: all 0.3s ease;
  text-decoration: none;
}

.download-resume:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(233, 30, 99, 0.2);
  color: white !important;
}

/* Responsive Styles */
@media (max-width: 768px) {
  /* Header & Navigation */
  header {
    padding: 1rem;
  }

  nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--header-bg);
    padding: 1rem;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
    justify-content: center;
    gap: 1rem;
    z-index: 1000;
  }

  nav a {
    font-size: 0.9rem;
  }

  .download-resume span {
    display: none;
  }

  /* Hero Section */
  .hero {
    padding-top: 100px;
    padding-bottom: 60px;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 1rem;
    padding: 0 1rem;
  }

  /* Sections */
  section {
    padding: 60px 15px;
  }

  section h2 {
    font-size: 1.8rem;
  }

  /* Cards */
  .card {
    padding: 1rem;
  }

  /* Project container responsive */
  .project-container {
    flex-direction: column;
  }

  .project-image-container {
    width: 12.5%; /* 1/8 of the original size on mobile */
    min-width: 1cm; /* Original minimum width */
    margin-bottom: 15px;
  }

  .certification-image-container {
    width: 37.5%; /* 3x larger than project images on mobile */
    min-width: 3cm; /* 3x larger than project images */
    margin-bottom: 15px;
  }

  /* Tech Stack */
  .tech-grid {
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 15px;
  }

  .tech-item {
    padding: 15px;
  }

  .tech-item img {
    width: 40px;
    height: 40px;
  }

  /* Social Links */
  .social-links {
    gap: 15px;
  }

  .social-links a img {
    width: 35px;
    height: 35px;
  }

  /* Contact Form */
  .contact-form {
    padding: 0 1rem;
  }

  /* Footer */
  footer {
    padding-bottom: 80px; /* Space for bottom navigation */
  }
}

/* Small phones */
@media (max-width: 480px) {
  nav {
    gap: 0.5rem;
  }

  nav a {
    font-size: 0.8rem;
    padding: 8px;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .card h3 {
    font-size: 1.1rem;
  }
}

/* Landscape mode */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    padding-top: 80px;
    padding-bottom: 40px;
  }

  .hero img {
    width: 100px;
    height: 100px;
  }
}

/* Animation Classes */
.animate-slide-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity var(--animation-duration) ease-out,
    transform var(--animation-duration) ease-out;
}

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

/* Add initial invisible state for text elements that will be animated */
h1,
h2,
h3,
p {
  will-change: transform, opacity; /* Optimize animations */
}

/* Add subtle scaling to images on hover */
.project-image-small:hover,
.gallery-grid img:hover {
  transform: scale(1.03);
  transition: transform 0.3s ease;
}

/* Enhanced hover effects for cards */
.card {
  transform-origin: center bottom;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275),
    box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-5px) scale(1.01);
  box-shadow: 0 8px 24px var(--shadow-color);
}
