/* Import Google Fonts - Poppins is modern and clean */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

/* ---------- Base Styles & Variables ---------- */
:root {
  --bg-color: #ffffff;
  --text-color: #222222;
  --accent-color: #007bff; /* Vibrant Blue */
  --accent-hover: #0056b3;
  --card-bg: #f5f8ff; /* Very light subtle background */
  --btn-text: #ffffff;
  --shadow-light: 0 4px 15px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 8px 20px rgba(0, 0, 0, 0.15);
  --transition: 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94); /* Smooth transition curve */
}

body.dark {
  --bg-color: #1a1a2e; /* Deep dark blue */
  --text-color: #e4e4f0;
  --accent-color: #64ffda; /* Neon Green/Cyan for contrast */
  --accent-hover: #37c7a5;
  --card-bg: #272740;
  --btn-text: #1a1a2e; /* Dark text on neon button */
  --shadow-light: 0 4px 15px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 8px 20px rgba(0, 0, 0, 0.5);
  --secondary-btn-bg: #444466; /* New: for secondary button background in dark mode */
}

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}

body {
  background: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  transition: background var(--transition), color var(--transition);
}

a {
  text-decoration: none;
  color: var(--accent-color);
}

/* Scrollbar styling for modern feel */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-thumb {
  background: var(--accent-color);
  border-radius: 4px;
}
::-webkit-scrollbar-track {
  background: var(--card-bg);
}

/* ---------- Preloader (New) ---------- */
.preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg-color);
  color: var(--text-color);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 3rem;
  font-weight: 700;
  z-index: 1000;
  opacity: 1;
  transition: 0.3s ease-out, visibility 0.3s ease-out;
}

.preloader.hidden {
  opacity: 0;
  visibility: hidden;
}

.preloader-text span {
  color: var(--accent-color);
  display: block; /* Ensures span is full width for animation focus */
  margin-top: 10px;
}

/* Prevents scroll while preloader is active */
body.loading {
  overflow: hidden;
}

/* ---------- Header & Navigation ---------- */
.header {
  background: var(--bg-color);
  box-shadow: var(--shadow-light);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header .container {
  max-width: 1200px;
  margin: auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo a {
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--accent-color);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.navbar ul {
  list-style: none;
  display: flex;
  gap: 2rem;
}

.navbar a {
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
  padding: 0.25rem 0;
  position: relative;
  transition: color var(--transition);
}

.navbar a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -5px;
  width: 0;
  height: 2px;
  background-color: var(--accent-color);
  transition: width var(--transition);
}

.navbar a:hover::after,
.navbar a.active::after {
  width: 100%;
}

/* Menu Toggle Button (Mobile) */
.menu-btn {
  width: 30px;
  height: 20px;
  display: none; /* Hidden on desktop */
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  z-index: 60;
}

.menu-btn .bar {
  height: 3px;
  width: 100%;
  background-color: var(--text-color);
  border-radius: 10px;
  transition: all 0.3s ease-in-out;
}

/* Active menu state (hamburger to X) */
.menu-btn.active .bar:nth-child(2) {
  opacity: 0;
}
.menu-btn.active .bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.menu-btn.active .bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Theme toggle */
.theme-btn {
  background: none;
  border: 2px solid var(--accent-color);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--text-color);
  transition: all var(--transition);
}

.theme-btn:hover {
  background: var(--accent-color);
  color: var(--btn-text);
  transform: scale(1.1);
}

/* ---------- Sections & Utility ---------- */
.section {
  padding: 6rem 2rem; /* Increased padding */
}

.container {
  max-width: 1200px;
  margin: auto;
}

.section-title {
  text-align: center;
  margin-bottom: 3rem;
  font-size: 2.5rem;
  color: var(--text-color);
  position: relative;
  /* Underline effect */
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background-color: var(--accent-color);
    border-radius: 2px;
}


/* Buttons */
.btn {
  display: inline-block;
  font-weight: 600;
  border: 2px solid transparent;
  padding: 0.8rem 2rem;
  border-radius: 8px;
  text-decoration: none;
  margin-right: 1rem;
  transition: all var(--transition);
  cursor: pointer;
}

.primary-btn {
  background: var(--accent-color);
  color: var(--btn-text);
  border-color: var(--accent-color);
}

.primary-btn:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0, 123, 255, 0.3);
}

.secondary-btn {
  background: transparent;
  color: var(--accent-color);
  border-color: var(--accent-color);
}

body.dark .secondary-btn {
  color: var(--text-color);
  background: var(--secondary-btn-bg);
  border-color: var(--secondary-btn-bg);
}

.secondary-btn:hover {
  background: var(--accent-color);
  color: var(--btn-text);
  transform: translateY(-3px);
}

.btn-small {
  font-size: 0.85rem;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  margin-right: 0.5rem;
}

/* ---------- Hero ---------- */
.hero {
  /* Aligned to top, not center, for modern look */
  padding-top: 8rem;
  min-height: 80vh;
}

.hero-layout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4rem;
}

.hero-content {
  max-width: 600px;
}

.hero .greeting {
  font-size: 1.2rem;
  color: var(--accent-color);
  margin-bottom: 0.5rem;
}

.hero h2 {
  font-size: 3.5rem;
  line-height: 1.1;
  margin-bottom: 0.5rem;
  text-align: left;
}

.hero h2 span {
  color: var(--accent-color);
}

.hero h3 {
  font-size: 1.3rem;
  font-weight: 400;
  margin-bottom: 2rem;
  opacity: 0.8;
}

.hero-image {
  position: relative;
  flex-shrink: 0;
  width: 500px;
  height: 600px;
  background: var(--card-bg);
  border-radius: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-light);
  overflow: hidden;
  transition: transform 0.8s ease, box-shadow 0.8s ease;
  animation: float 5s ease-in-out infinite;
  perspective: 1000px;
}

/* Floating animation */
@keyframes float {
  0% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(0.5deg);
  }
  100% {
    transform: translateY(0px) rotate(0deg);
  }
}

/* Glowing border animation */
.hero-image::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 100px;
  padding: 2px;
  background: linear-gradient(45deg, #ff00cc, #3333ff, #00ffcc, #ff6600);
  background-size: 400%;
  animation: glow 8s linear infinite;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  -webkit-mask-composite: destination-out;
  pointer-events: none;
}

@keyframes glow {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Image inside hero container */
.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.5s ease, filter 0.5s ease;
  filter: brightness(0.95) contrast(1.1);
}

/* Hover effects */
.hero-image:hover {
  transform: scale(1.05) rotate3d(1, 1, 0, 6deg);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25), 0 0 50px rgba(255, 0, 150, 0.3);
}

.hero-image:hover img {
  transform: scale(1.15) rotate(1deg);
  filter: brightness(1.05) contrast(1.2);
}


/* .hero-image  {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
} */


/* ---------- About ---------- */
.about-content {
  max-width: 800px;
  margin: auto;
  text-align: center;
  font-size: 1.1rem;
}

.about-content p {
  margin-bottom: 1.5rem;
}

/* ---------- Skills (Segmented) ---------- */
.skills-categories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.skill-category {
  background: var(--card-bg);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: var(--shadow-light);
  transition: box-shadow var(--transition);
}

.skill-category:hover {
    box-shadow: var(--shadow-hover);
}

.skill-category h3 {
  text-align: center;
  margin-bottom: 1.5rem;
  color: var(--accent-color);
  font-size: 1.4rem;
}

.skills-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.skill-card {
  background: var(--bg-color);
  padding: 0.6rem 1.2rem;
  border-radius: 20px;
  font-weight: 500;
  font-size: 0.95rem;
  border: 1px solid var(--accent-color);
  color: var(--text-color);
  transition: all var(--transition);
}

.skill-card:hover {
  transform: scale(1.05);
  background: var(--accent-color);
  color: var(--btn-text);
  box-shadow: 0 4px 10px rgba(0, 123, 255, 0.3);
}

/* ---------- Projects ---------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.project-card {
  background: var(--card-bg);
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: var(--shadow-light);
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.project-image-placeholder {
    width: 100%;
    height: 200px;
    background: #e0e0e0;
    margin-bottom: 1rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    overflow: hidden;
}

.project-image-placeholder ,
.project-image-placeholder ,
.project-image-placeholder ,
.project-image-placeholder  {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-card h3 {
  color: var(--accent-color);
  margin-bottom: 0.75rem;
}

.project-card p {
  flex-grow: 1; /* Pushes links to the bottom */
  margin-bottom: 1.5rem;
  opacity: 0.9;
}

.project-links {
    margin-top: auto;
}

.all-projects-link {
    text-align: center;
    margin-top: 3rem;
}

/* ---------- Contact ---------- */
.contact p {
  text-align: center;
  margin-bottom: 2.5rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.contact-actions {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.large-btn {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    border-radius: 50px; /* Pill shape for modern look */
}

/* ---------- Footer ---------- */
.footer {
  text-align: center;
  padding: 2rem;
  background: var(--card-bg);
  font-size: 0.9rem;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.footer .container p {
    margin: 0.5rem 0;
}


/* ---------- Responsive Adjustments ---------- */
@media (max-width: 1024px) {
    .hero-layout {
        flex-direction: column-reverse; /* Image above text on medium screens */
        text-align: center;
    }

    .hero-content h2, .hero-content h3 {
        text-align: center;
    }
    
    .hero-content .greeting {
        text-align: center;
    }

    .hero-image {
        width: 300px;
        height: 300px;
        margin-bottom: 2rem;
    }
    
    .hero-content .primary-btn, .hero-content .secondary-btn {
        margin-left: 0;
        margin-right: 1rem;
    }
}

@media (max-width: 768px) {
  .section {
    padding: 4rem 1rem;
  }

  /* Mobile Navigation */
  .navbar {
    position: fixed;
    top: 0;
    right: 0;
    width: 70%;
    height: 100%;
    background: var(--card-bg); /* Use card background for contrast */
    transform: translateX(100%);
    transition: transform 0.4s ease-in-out;
    padding-top: 5rem;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.2);
    z-index: 55;
  }

  .navbar.active {
    transform: translateX(0);
  }

  .navbar ul {
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    width: 100%;
  }

  .navbar a {
    font-size: 1.2rem;
    padding: 0.5rem 0;
    width: 100%;
    text-align: center;
  }

  .menu-btn {
    display: flex; /* Show hamburger menu */
  }

  .hero h2 {
    font-size: 2.5rem;
  }
  
  .hero h3 {
    font-size: 1.1rem;
  }
  
  .contact-actions {
      flex-direction: column;
      gap: 1rem;
  }
  
  .large-btn {
      width: 100%;
  }
}

@media (max-width: 480px) {
    .header .container {
        padding: 0.8rem 1rem;
    }

    .logo a {
        font-size: 1.4rem;
    }

    .preloader-text {
        font-size: 2rem;
    }
    
    .hero-content .btn {
        display: block;
        margin: 1rem 0 0;
    }
    
    .hero-image {
        width: 250px;
        height: 250px;
    }
    
    .section-title {
        font-size: 2rem;
    }
}
