/*=============================================
  GLOBAL RESET & VARIABLES
=============================================*/
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #6c63ff;
  --secondary: #ff4ecd;
  --bg-light: #f9f9f9;
  --bg-dark: #121212;
  --text-light: #333;
  --text-dark: #f1f1f1;
  --card-light: rgba(255, 255, 255, 0.75);
  --card-dark: rgba(30, 30, 30, 0.75);
  --shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  --transition: all 0.4s ease;
}

/*=============================================
  BODY & GENERAL STYLES
=============================================*/
body {
  font-family: "Poppins", sans-serif;
  line-height: 1.6;
  background: var(--bg-light);
  color: var(--text-light);
  transition: var(--transition);
}

body.dark {
  background: var(--bg-dark);
  color: var(--text-dark);
}

.container {
  width: 90%;
  max-width: 1100px;
  margin: auto;
}

h1, h2, h3 {
  font-weight: 700;
}

/*=============================================
  NAVBAR
=============================================*/
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-light);
  box-shadow: var(--shadow);
  transition: var(--transition);
}

body.dark header {
  background: var(--bg-dark);
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  flex-wrap: wrap;
}

.logo {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary);
}

.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.nav-links a {
  text-decoration: none;
  color: inherit;
  font-weight: 500;
  position: relative;
  transition: var(--transition);
  padding: 0.5rem 1rem;
  border-radius: 30px;
}

.nav-links a:not(.btn):hover {
  background-color: rgba(108, 99, 255, 0.1);
}

.btn {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff !important;
  padding: 0.7rem 1.4rem;
  border-radius: 30px;
  font-weight: 600;
  box-shadow: var(--shadow);
  transition: var(--transition);
  display: inline-block;
  text-align: center;
  text-decoration: none;
  background-size: 200% auto
}

.btn:hover {
  transform: translateY(-4px) scale(1.05);
  transform: translateY(-4px) scale(1.05);
  background-position: right center; /* Adds a subtle gradient shift */
}

#theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.3rem;
  margin-left: 1rem;
  transition: var(--transition);
  color: inherit;
}

/*=============================================
  HERO SECTION
=============================================*/
.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5rem 0 4rem;
  flex-wrap: wrap;
  gap: 2rem;
}

.hero-text {
  flex: 1;
  max-width: 60%;
  padding-right: 2rem;
}

.hero h1 {
  font-size: 2.6rem;
  margin-bottom: 1rem;
}

.hero .lead {
  margin-bottom: 1.5rem;
}

.hero .highlight {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-img img {
  width: 280px;  /* Set the width */
  height: 380px; /* Make the height EQUAL to the width */
  object-fit: cover;
  object-position: center;
  border-radius: 50%;
  box-shadow: var(--shadow);
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-15px); }
}

/*=============================================
  GENERAL SECTION & GRID STYLES
=============================================*/
.section {
  padding: 4rem 0;
}

.section-title {
  font-size: 2rem;
  margin-bottom: 2.5rem;
  text-align: center;
}

.grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  
}
/* Remove default link styling from certification cards */
#certifications .grid a {
  text-decoration: none; /* Removes the underline */
  color: inherit;       /* Makes the text use the card's original color */
}

/*=============================================
  UNIFIED CARD & TIMELINE STYLES
=============================================*/
.card,
.timeline-item {
  background: var(--card-light);
  padding: 1.5rem;
  border-radius: 1rem;
  box-shadow: var(--shadow);
  transition: var(--transition);
  border: 2px solid transparent;
  backdrop-filter: blur(12px);
}

body.dark .card,
body.dark .timeline-item {
  background: var(--card-dark);
}

.card:hover,
.timeline-item:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
  border-color: var(--primary);
}

/* Specific item adjustments */
.timeline-item h3 {
  color: var(--primary);
  margin-bottom: 0.4rem;
}

#projects .card h3 {
  color: var(--primary);
  margin-bottom: 0.5rem;
}

#projects .grid a {
  text-decoration: none;
  color: inherit;
}

/*=============================================
  CONTACT & CONNECT SECTIONS
=============================================*/
#contact .card {
  max-width: 600px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 1.2rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 500;
}

form input, 
form textarea {
  width: 100%;
  padding: 0.9rem;
  border: 1px solid #ccc;
  border-radius: 0.5rem;
  outline: none;
  transition: var(--transition);
  background-color: #fff;
}

body.dark form input, 
body.dark form textarea {
  background-color: #2a2a2a;
  border-color: #444;
  color: var(--text-dark);
}

form input:focus, 
form textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(108, 99, 255, 0.25);
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

/*=============================================
  FOOTER
=============================================*/
.footer {
  text-align: center;
  padding: 1.5rem;
  font-size: 0.9rem;
  background: var(--bg-light);
  transition: var(--transition);
}

body.dark .footer {
  background: var(--bg-dark);
}

/*=============================================
  ANIMATIONS & UTILITIES
=============================================*/
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: var(--transition);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/*=============================================
  RESPONSIVE MEDIA QUERIES
=============================================*/
@media (max-width: 992px) {
  .nav {
    flex-direction: column;
    justify-content: center;
    gap: 1rem;
  }
}

@media (max-width: 768px) {
  .hero {
    flex-direction: column;
    text-align: center;
    padding: 3rem 0;
  }

  .hero-text {
    max-width: 100%;
    padding-right: 0;
  }

  .hero-img img {
    margin-top: 1rem;
  }
}

/* Layout for the vertical timeline container */
.timeline {
  display: grid;
  gap: 2rem; /* This adds space between each item */
}

/*=============================================
  PROJECT CASE STUDY PAGE STYLES
=============================================*/
.project-header {
  padding: 1rem 0;
  background: var(--bg-light);
  box-shadow: var(--shadow);
  transition: var(--transition);
}

body.dark .project-header {
  background: var(--bg-dark);
}

.project-page {
  padding: 4rem 0;
  text-align: center;
}

.project-title {
  font-size: 2.5rem;
  margin-bottom: 2rem;
}

.project-image {
  width: 100%;
  max-width: 800px;
  border-radius: 1rem;
  box-shadow: var(--shadow);
  margin-bottom: 3rem;
}

.project-details {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  text-align: left;
  max-width: 900px;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .project-details {
    grid-template-columns: 1fr 1fr;
  }
}

.project-info h2 {
  color: var(--primary);
  margin-bottom: 1rem;
}

.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.tech-stack span {
  background-color: rgba(108, 99, 255, 0.1);
  color: var(--primary);
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
}

.project-links {
  margin-top: 2rem;
  display: flex;
  gap: 1rem;
}

#back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: none; /* Hidden by default */
  padding: 0.5rem 1rem;
  z-index: 1000;
}