/* ------------------------------------------------------
   BASE STYLES & VARIABLES
------------------------------------------------------ */
:root {
  --bg-color: #f8f9fa;
  --card-bg: #ffffff;
  --text-main: #212529;
  --text-muted: #6c757d;
  --accent-color: #0366d6;
  --border-radius: 12px;
  --spacing: 2rem;
  
  /* Fonts */
  --font-body: 'Inter', sans-serif;
  --font-heading: 'Outfit', sans-serif;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  padding: 0 1rem; /* Small padding for mobile edges */
  scroll-behavior: smooth;
}

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

img {
  max-width: 100%;
  height: auto;
}

/* Apply Outfit font to headings */
h1, h2, h3 {
  font-family: var(--font-heading);
}

/* ------------------------------------------------------
   HERO SECTION
------------------------------------------------------ */
.hero {
  text-align: center;
  padding: 4rem 1rem 3rem; /* More spacing top/bottom */
}

.hero h1 {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  color: var(--text-main);
}

/* ------------------------------------------------------
   SOCIAL BUTTONS
------------------------------------------------------ */
.social-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 1.5rem 0;
  flex-wrap: wrap;
}

.social-buttons a {
  background-color: var(--card-bg);
  border: 1px solid var(--text-muted);
  color: var(--text-main);
  padding: 8px 16px;
  border-radius: 20px; /* Pill shape */
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.social-buttons a:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
}

/* ------------------------------------------------------
   PROFILE IMAGE
------------------------------------------------------ */
.rounded-image {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--card-bg);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ------------------------------------------------------
   NAVBAR
------------------------------------------------------ */
.navbar {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 15px 20px;
  width: 100%;
  box-sizing: border-box;
}

.navbar a {
  font-family: var(--font-heading);
  font-weight: 500;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 6px;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.navbar a:hover {
  color: var(--accent-color);
  background-color: rgba(3, 102, 214, 0.05);
}

/* External Blog Link Styling */
.navbar a.nav-blog {
  color: var(--accent-color);
  font-weight: 600;
}

/* ------------------------------------------------------
   MAIN LAYOUT & CARDS
------------------------------------------------------ */
.content {
  max-width: 800px;
  margin: 0 auto;
  padding-bottom: 4rem;
}

section {
  margin-bottom: 4rem;
}

h2 {
  font-size: 2rem;
  border-bottom: 2px solid #e0e0e0;
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
  color: var(--text-main);
  opacity: 0.9;
}

.about-card, 
.events-item, 
.portfolio-item {
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  padding: 25px;
  margin-bottom: 1.5rem;
}

/* ------------------------------------------------------
   PUBLICATIONS
------------------------------------------------------ */
#publications ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

#publications li {
  position: relative;
  padding: 20px 25px 20px 20px;
  margin-bottom: 15px;
  background: var(--card-bg);
  border-left: 4px solid var(--accent-color);
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease;
}

#publications li:hover {
  transform: translateY(-2px);
}

#publications li strong {
  color: var(--text-main);
}

/* ------------------------------------------------------
   EVENTS & PORTFOLIO GRIDS
------------------------------------------------------ */
.events-grid,
.portfolio-grid {
  display: grid;
  grid-template-columns: 1fr; /* Default to single column */
  gap: 1.5rem;
}

.portfolio-item, .events-item {
  padding: 0; /* Reset padding to handle inner content */
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-left: none; /* Removed the side border for a cleaner card look */
}

.portfolio-gif img {
    width: 100%;
    display: block;
    border-bottom: 1px solid #eee;
}

.events-details,
.portfolio-details {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.portfolio-title, 
.events-details h3 {
  font-size: 1.25rem;
  margin: 0;
  color: var(--text-main);
}

.portfolio-description, .events-details p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Tech Tags */
.portfolio-tech,
.events-tech {
  font-size: 0.85rem;
  background: #f1f8ff;
  border-radius: 4px;
  padding: 0.4rem 0.6rem;
  color: var(--accent-color);
  width: fit-content;
}

.tech-label {
  font-weight: 600;
  margin-right: 0.3rem;
}

.portfolio-link {
    font-weight: 600;
    color: var(--accent-color);
    margin-top: 0.5rem;
    display: inline-block;
}

/* ------------------------------------------------------
   BOOKS SECTION
------------------------------------------------------ */
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.book-item img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s;
}

.book-item img:hover {
    transform: scale(1.05);
}

/* ------------------------------------------------------
   SCROLL-TO-TOP BUTTON (New SVG Style)
------------------------------------------------------ */
.scroll-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    z-index: 1000;
}

.scroll-top-btn:hover {
    transform: translateY(-3px);
    opacity: 1;
    background-color: var(--accent-color); /* Maintain color */
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

.scroll-top-btn svg {
    width: 32px;
    height: 32px;
    stroke-width: 3;
}

/* ------------------------------------------------------
   RESPONSIVE DESIGN
------------------------------------------------------ */
@media (max-width: 600px) {
  .hero h1 {
    font-size: 2.5rem;
  }
  
  .navbar {
    gap: 5px;
  }
  
  .navbar a {
      font-size: 0.9rem;
      padding: 5px 8px;
  }

  .content {
    padding-bottom: 2rem;
  }

  .book-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); /* Smaller columns for mobile */
    gap: 10px;
  }

  .book-item img {
    height: auto;       /* Let height scale naturally */
    min-height: 140px;  /* Minimum height for consistency */
    object-fit: contain; /* Ensure the whole book is visible */
    box-shadow: none;    /* Optional: cleaner look on mobile */
  }
}
