/* assets/css/portfolio.css */

/* CSS Variables */
:root {
  --bg-gradient-start: #38ada9;          /* Light Teal */
  --bg-gradient-end: #2c3e50;            /* Dark Blue */
  --accent-color: #1abc9c;               /* Teal */
  --primary-color: #2c3e50;              /* Dark Blue */
  --secondary-color: #f39c12;            /* Orange */
  --text-color: #34495e;                 /* Slate Gray */
  --nav-bg: #ffffff;                     /* Nav Background (White) */
  --card-bg: #ffffff;                    /* Card Background */
  --card-shadow: rgba(0, 0, 0, 0.1);
  --popup-bg: rgba(0, 0, 0, 0.7);        /* Popup Overlay Background */
  --close-btn-bg: #e74c3c;               /* Red */
  --close-btn-hover: #c0392b;            /* Darker Red */
  --radius: 8px;                         /* Border Radius */
  --transition-speed: 0.3s;              /* Transition Speed */
  --font-primary: 'Poppins', sans-serif; /* Primary Font */
  --font-secondary: 'Roboto', sans-serif; /* Secondary Font */
}

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

body {
  background: linear-gradient(
    135deg,
    var(--bg-gradient-start),
    var(--bg-gradient-end)
  );
  font-family: var(--font-primary);
  color: var(--text-color);
  min-height: 100vh;
}

/* -----------------------------------
   MINIMAL TOP NAVIGATION BAR
----------------------------------- */
.minimal-nav {
  background: var(--nav-bg);
  box-shadow: 0 2px 6px var(--card-shadow);
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 999;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-size: 1.5rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--primary-color);
}

.nav-buttons {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.back-btn {
  text-decoration: none;
  color: #fff;
  background: var(--primary-color);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  transition: background var(--transition-speed),
              transform var(--transition-speed),
              box-shadow var(--transition-speed);
}

.back-btn i {
  margin-right: 0.5rem;
}

.back-btn:hover {
  background: var(--secondary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

/* Portfolio Content Wrapper */
.portfolio-wrapper {
  margin-top: 80px; /* Space below nav */
  padding: 2rem;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  background: rgba(255, 255, 255, 0.95);
  border-radius: var(--radius);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.15);
}

/* Intro Section */
.intro-section {
  text-align: center;
  margin-bottom: 3rem;
}

.intro-section h1 {
  font-size: 2.5rem;
  font-family: var(--font-secondary);
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.intro-section p {
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--text-color);
  max-width: 700px;
  margin: 0 auto;
}

/* Projects Grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  grid-gap: 2rem;
}

/* Project Cards */
.project-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: 0 4px 8px var(--card-shadow);
  overflow: hidden;
  transition: transform var(--transition-speed), box-shadow var(--transition-speed);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.image-container {
  width: 100%;
  height: 180px;
  overflow: hidden;
}

.image-container img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* Changed from 'cover' to 'contain' */
  transition: transform var(--transition-speed);
  background-color: #f0f0f0; /* Optional: Add a background color to handle padding */
}

.project-card:hover img {
  transform: scale(1.03);
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px var(--card-shadow);
}

.project-card h3 {
  font-size: 1.4rem;
  color: var(--accent-color);
  margin: 1rem;
}

.project-card p {
  font-size: 0.95rem;
  color: var(--text-color);
  margin: 0 1rem 1rem;
  line-height: 1.4;
}

.project-button {
  margin: 0 1rem 1rem;
  align-self: flex-start;
  background: var(--accent-color);
  border: none;
  padding: 0.4rem 1rem;
  color: #fff;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.95rem;
  transition: background var(--transition-speed),
              transform var(--transition-speed),
              box-shadow var(--transition-speed);
}

.project-button:hover {
  background: var(--secondary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

/* Publications Section */
.publications-section {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1rem;
}

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

.publications-list {
  list-style-type: none;
}

.publications-list li {
  background-color: var(--card-bg);
  padding: 1rem;
  margin-bottom: 1rem;
  border-left: 5px solid var(--primary-color);
  transition: background-color var(--transition-speed);
}

.publications-list li:hover {
  background-color: #f1f1f1;
}

.publications-list a {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 500;
}

.publications-list a:hover {
  text-decoration: underline;
}

/* Project Popups */
.project-popup {
  display: none; /* Hidden by default */
  position: fixed;
  z-index: 2000;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--popup-bg);
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.popup-content {
  background: var(--card-bg);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 700px;
  position: relative;
  overflow-y: auto;
  max-height: 90vh;
  animation: fadeIn var(--transition-speed) ease-out forwards;
}

.popup-content img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

.popup-content h2 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
  font-family: var(--font-secondary);
}

.popup-content p {
  margin-bottom: 1rem;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text-color);
}

.popup-content h4 {
  margin-top: 1rem;
  color: var(--accent-color);
  font-size: 1.1rem;
}

.popup-content ul {
  list-style: disc;
  margin-left: 1.2rem;
  margin-bottom: 1.2rem;
}

.popup-link {
  color: var(--accent-color);
  text-decoration: none;
  transition: color var(--transition-speed);
  font-weight: 500;
}

.popup-link:hover {
  color: var(--secondary-color);
}

.close-popup {
  position: absolute;
  top: 15px;
  right: 15px;
  background: var(--close-btn-bg);
  color: #fff;
  border: none;
  padding: 0.5rem 0.8rem;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  transition: background var(--transition-speed);
}

.close-popup:hover {
  background: var(--close-btn-hover);
}

/* Footer Section */
.footer-section {
  background-color: var(--primary-color);
  color: #fff;
  padding: 1.5rem 0;
  text-align: center;
}

.footer-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1rem;
}

.footer-section p {
  margin-bottom: 1rem;
}

.social-links a {
  color: #fff;
  margin: 0 0.5rem;
  font-size: 1.2rem;
  transition: color var(--transition-speed);
}

.social-links a:hover {
  color: #ddd;
}

/* Animations */
@keyframes fadeIn {
  0% {
    opacity: 0;
    transform: scale(0.95);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Responsive Tweaks */
@media (max-width: 768px) {
  .nav-container {
    flex-direction: column;
    gap: 0.8rem;
    align-items: flex-start;
  }

  .back-btn {
    margin-top: 0.5rem;
  }

  .intro-section h1 {
    font-size: 2rem;
  }

  .intro-section p {
    font-size: 1rem;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .project-card h3 {
    font-size: 1.2rem;
  }

  .project-card p {
    font-size: 0.9rem;
  }
}

@media (max-width: 576px) {
  .intro-section h1 {
    font-size: 1.8rem;
  }

  .project-button {
    font-size: 0.9rem;
  }

  .popup-content {
    padding: 1.5rem;
  }

  .popup-content h2 {
    font-size: 1.5rem;
  }
}
