/* Base Layout */
body {
  font-family: 'Poppins', sans-serif;
  margin: 0;
  padding: 0;
  background: #fafafa;
  color: #222;
  line-height: 1.6;
}

/* Header */
header {
  background-color: #0a2342;
  color: white;
  padding: 20px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1000;
}

header h1 {
  margin: 0;
  font-weight: 600;
  font-size: 28px;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 20px;
  margin: 0;
  padding: 0;
}

nav a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
}

nav a:hover {
  color: #ffcc00;
}

/* Sections */
section {
  padding: 60px 20px;
  max-width: 1000px;
  margin: auto;
}

h2 {
  text-align: center;
  margin-bottom: 40px;
  font-weight: 600;
}

/* Project Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.tile {
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  text-align: center;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.6s forwards;
}

.tile:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.tile img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

/* Animations */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

.tile:nth-child(1) { animation-delay: 0.1s; }
.tile:nth-child(2) { animation-delay: 0.2s; }
.tile:nth-child(3) { animation-delay: 0.3s; }

.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  justify-content: center;
  align-items: center;
  overflow: auto; /* allow modal to scroll if content is too tall */
}

.modal.show {
  display: flex;
}

/* Centered modal content with rounded corners */
.modal-content {
  background: white;
  border-radius: 12px;
  max-width: 800px;
  width: 90%;
  max-height: 90%; /* will allow scrolling */
  margin: auto;    /* keeps modal vertically centered */
  padding: 20px;
  box-sizing: border-box;
  position: relative;
  overflow: auto;  /* scroll inside the modal */
}


.modal.show .modal-content {
  transform: translateY(0);
  opacity: 1;
}

.modal-content img,
.modal-content .video-container,
.modal-content .pdf-container {
  width: 100%;
  max-height: 600px;      /* limit height */
  object-fit: contain;     /* prevents stretching */
  border-radius: 12px;     /* same as modal corners */
}

/* Make iframe inside pdf-container or video-container inherit border radius */
.pdf-container iframe,
.video-container iframe {
  border-radius: 12px;
}

/* Wrap all modal media in a container with rounded corners */
.modal-content > .carousel > img,
.modal-content > .carousel > .video-container,
.modal-content > .carousel > .pdf-container {
  border-radius: 12px;
  overflow: hidden;
  display: block;
  max-width: 100%;
  margin: 0 auto 20px; /* spacing below each media item */
}

/* Ensure iframe inherits border-radius */
.video-container iframe,
.pdf-container iframe {
  border-radius: 12px;
  width: 100%;
  height: 100%;
}


.close {
  position: absolute;
  top: 10px; right: 20px;
  font-size: 30px;
  cursor: pointer;
  color: #333;
}

/* Carousel */
.carousel {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  margin: 20px 0;
}

/* Only show active element */
.carousel img,
.carousel .video-container,
.carousel .pdf-container {
  display: none;
}

.carousel img.active,
.carousel .video-container.active,
.carousel .pdf-container.active {
  display: block;
  animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Carousel arrow buttons */
.carousel .arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  font-size: 24px;
  width: 40px;
  height: 40px;
  line-height: 40px;
  text-align: center;
  cursor: pointer;
  border-radius: 50%;
  z-index: 10;
}

.carousel .arrow.left { left: 10px; }
.carousel .arrow.right { right: 10px; }

/* YouTube video in carousel */
.video-container {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 ratio */
  height: 0;
  overflow: hidden;
  max-width: 100%;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.video-container iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: 0;
  border-radius: 10px;
}

/* PDF inside carousel */
.pdf-container {
  width: 100%;
  height: 400px;
  border: none;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.pdf-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* About Section */
.about-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  max-width: 1000px;
  margin: 50px auto;
  padding: 20px;
}

.about-image img {
  width: 250px;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.about-text {
  flex: 1;
}

.about-text h2 {
  margin-bottom: 15px;
  font-size: 2rem;
  font-weight: 600;
}

.about-text p {
  line-height: 1.6;
  font-size: 1rem;
}

/* Responsive layout for tablets/phones */
@media (max-width: 768px) {
  .about-container {
    flex-direction: column;
    text-align: center;
    gap: 20px;
  }

  .about-image img {
    width: 180px;
  }

  .about-text {
    flex: unset;
  }
}

/* Centered and minimal links */
#resume, #contact {
  text-align: center;
  padding: 40px 20px;
}

.simple-link {
  display: block;          
  font-size: 2rem;         /* large, heading-like size */
  font-weight: 600;
  color: #0a2342;          
  text-decoration: none;
  margin: 10px 0;
  transition: color 0.3s;
}

.simple-link:hover {
  color: #ffcc00;          
}