/* style.css */

/* Custom Properties for Theming */
:root {
  /* Light Mode Colors */
  --bg-color-light: #f4f7f6;
  --text-color-light: #333;
  --card-bg-light: #ffffff;
  --navbar-bg-light: #e0e0e0;
  --button-bg-light: #007bff;
  --button-text-light: #fff;
  --link-color-light: #007bff;
  --border-color-light: #e0e0e0;
  --shadow-light: rgba(0, 0, 0, 0.1);

  /* Dark Mode Colors */
  --bg-color-dark: #2c3e50;
  --text-color-dark: #ecf0f1;
  --card-bg-dark: #34495e;
  --navbar-bg-dark: #2c3e50;
  --button-bg-dark: #66bb6a;
  --button-text-dark: #fff;
  --link-color-dark: #66bb6a;
  --border-color-dark: #4a627a;
  --shadow-dark: rgba(0, 0, 0, 0.4);

  /* Fonts */
  --heading-font: "Poppins", sans-serif;
  --body-font: "Roboto", sans-serif;
}

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

body {
  font-family: var(--body-font);
  line-height: 1.6;
  background-color: var(--bg-color-light);
  color: var(--text-color-light);
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
  min-height: 100vh; /* Ensure body takes full height */
  display: flex;
  flex-direction: column; /* For sticky footer */
}

/* Dark Mode Specific Styles */
body.dark-mode {
  background-color: var(--bg-color-dark);
  color: var(--text-color-dark);
}

body.dark-mode .navbar {
  background-color: var(--navbar-bg-dark);
  border-bottom: 1px solid var(--border-color-dark);
}

body.dark-mode .navbar-title,
body.dark-mode .projects-section h2,
body.dark-mode .project-card h3 {
  color: var(--text-color-dark);
}

body.dark-mode .project-card {
  background-color: var(--card-bg-dark);
  box-shadow: 0 4px 15px var(--shadow-dark);
  border: 1px solid var(--border-color-dark);
}

body.dark-mode .theme-toggle-button {
  background-color: var(--button-bg-dark);
  color: var(--button-text-dark);
}

body.dark-mode .theme-toggle-button:hover {
  background-color: #5cb85c; /* A slightly darker green */
}

body.dark-mode .project-card a.demo-link {
  background-color: var(--button-bg-dark);
  color: var(--button-text-dark);
}

body.dark-mode .project-card a.demo-link:hover {
  background-color: #5cb85c;
}

body.dark-mode .footer {
  background-color: var(--navbar-bg-dark);
  border-top: 1px solid var(--border-color-dark);
  color: var(--text-color-dark);
}

/* Navigation Bar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background-color: var(--navbar-bg-light);
  border-bottom: 1px solid var(--border-color-light);
  box-shadow: 0 2px 5px var(--shadow-light);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar-title {
  font-family: var(--heading-font);
  font-size: 1.8rem;
  color: var(--text-color-light);
  transition: color 0.3s ease;
}

.theme-toggle-button {
  background-color: var(--button-bg-light);
  color: var(--button-text-light);
  border: none;
  padding: 0.75rem 1.25rem;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1rem;
  font-family: var(--body-font);
  transition: background-color 0.3s ease;
}

.theme-toggle-button:hover {
  background-color: #0056b3;
}

/* Main Content Container */
.container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
  flex-grow: 1; /* Allows main content to take available space */
}

.projects-section h2 {
  font-family: var(--heading-font);
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 2rem;
  color: var(--text-color-light);
  transition: color 0.3s ease;
}

/* Project Grid */
.project-grid {
  display: grid;
  /* Responsive grid: auto-fit creates as many columns as fit, minmax ensures minimum width */
  /* grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); */
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2rem; /* Spacing between cards */
}

/* Project Card */
.project-card {
  background-color: var(--card-bg-light);
  border-radius: 8px;
  box-shadow: 0 2px 10px var(--shadow-light);
  overflow: hidden;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.3s ease,
    border-color 0.3s ease;
  border: 1px solid var(--border-color-light);
  display: flex;
  flex-direction: column; /* Ensure content stacks vertically */
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.project-card-image-container {
  width: 100%;
  height: 200px; /* Fixed height for image container to keep cards uniform */
  overflow: hidden;
  background-color: #eee; /* Placeholder background */
  display: flex;
  justify-content: center;
  align-items: center;
}

.project-card img {
  width: 100%; /* Make image fill container width */
  height: 100%; /* Make image fill container height */
  object-fit: cover; /* Cover ensures image fills without distortion, cropping if needed */
  display: block;
  transition: transform 0.3s ease;
}

.project-card:hover img {
  transform: scale(1.05); /* Slight zoom on hover */
}

.project-card-content {
  padding: 1.5rem;
  flex-grow: 1; /* Allow content area to expand and push link to bottom */
  display: flex;
  flex-direction: column;
}

.project-card h3 {
  font-family: var(--heading-font);
  font-size: 1.5rem;
  margin-bottom: 0.8rem;
  color: var(--text-color-light);
  transition: color 0.3s ease;
}

.project-card p {
  font-size: 0.95rem;
  margin-bottom: 1rem;
  flex-grow: 1; /* Allow description to take up available space */
}

.project-card a.demo-link {
  display: inline-block;
  background-color: var(--button-bg-light);
  color: var(--button-text-light);
  text-decoration: none;
  padding: 0.6rem 1rem;
  border-radius: 5px;
  transition: background-color 0.3s ease;
  align-self: flex-start; /* Align link to the left within the card content */
  margin-top: auto; /* Pushes the link to the bottom if description is short */
}
.project-card a.git-link {
  display: inline-block;
  background-color: black;
  color: var(--button-text-light);
  text-decoration: none;
  padding: 0.6rem 1rem;
  border-radius: 5px;
  transition: background-color 0.3s ease;
  align-self: flex-start; /* Align link to the left within the card content */
  margin-top: auto; /* Pushes the link to the bottom if description is short */
}

.project-card-content .card-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}


.project-card a.demo-link:hover {
  background-color: #0056b3;
}

/* Footer */
.footer {
  text-align: center;
  padding: 2rem 1rem;
  margin-top: 3rem;
  background-color: var(--navbar-bg-light);
  border-top: 1px solid var(--border-color-light);
  color: var(--text-color-light);
  font-size: 0.9rem;
  transition:
    background-color 0.3s ease,
    color 0.3s ease,
    border-color 0.3s ease;
}

/* Media Queries for Responsiveness */
@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }

  .navbar-title {
    font-size: 1.5rem;
  }

  .theme-toggle-button {
    width: 100%;
    text-align: center;
    padding: 0.6rem 1rem;
  }

  .container {
    margin: 1rem auto;
    padding: 0 0.5rem;
  }

  .projects-section h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
  }

  .project-grid {
    grid-template-columns: 1fr; /* Single column on smaller screens */
    gap: 1.5rem;
  }

  .project-card-content {
    padding: 1rem;
  }
  .project-card h3 {
    font-size: 1.3rem;
  }
  .project-card p {
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .navbar {
    padding: 0.8rem;
  }
  .navbar-title {
    font-size: 1.3rem;
  }
  .theme-toggle-button {
    font-size: 0.9rem;
  }
  .projects-section h2 {
    font-size: 1.8rem;
  }
}
