/* Modern, clean styling */
:root {
  --primary-color: #2c3e50;
  --secondary-color: #3498db;
  --background-color: #f8f9fa;
  --text-color: #2c3e50;
  --section-spacing: 2rem;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--background-color);
}

/* Header Styling */
header {
  text-align: center;
  padding: 2rem 1rem;
  background-color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.banner-image {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  margin-bottom: 1rem;
}

h1 {
  color: var(--primary-color);
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

p {
  margin-bottom: 0.5rem;
}

.subtitle {
  font-size: 1.5rem;
  color: var(--secondary-color);
  margin-bottom: 1rem;
}

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

.nav-title {
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

.student-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.student-links a {
  color: var(--secondary-color);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border: 1px solid var(--secondary-color);
  border-radius: 20px;
  transition: all 0.3s ease;
}

.student-links a:hover {
  background-color: var(--secondary-color);
  color: white;
}

/* Main Content */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.intro {
  max-width: 800px;
  margin: 0 auto var(--section-spacing) auto;
  padding: 1rem;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Gallery Grid */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
  gap: 2rem;
  padding: 1rem;
}

.student-section {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.student-section h2 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--secondary-color);
}

.section-title {
  font-size: 1.3rem;
  color: var(--secondary-color);
  font-weight: 600;
  letter-spacing: 0.05em;
  margin: 1.5rem 0 0.5rem 0;
}

/* Products Section */
.products {
  display: grid;
  gap: 1rem;
  max-width: 600px; /* Add this to constrain width */
  margin: 0 auto; /* Add this to center it */
}

.product-item {
  width: 100%;
  max-width: 400px; /* Add this to limit individual item width */
  margin: 0 auto; /* Add this to center each item */
}

.product-item img {
  width: 100%;
  height: auto;
  border-radius: 4px;
}

.product-item audio,
.product-item video {
  width: 100%;
}

.product-item a {
  display: block;
  text-decoration: none;
  position: relative;
  transition: transform 0.2s ease;
}

.product-item a::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(52, 152, 219, 0); /* Using your secondary color */
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.product-item a:hover {
  transform: translateY(-2px);
}

.product-item a:hover::after {
  background-color: rgba(52, 152, 219, 0.1);
}

/* Optional: Add link icon for external links */
.product-item a[href^="http"]::before {
  content: "↗";
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.product-item a[href^="http"]:hover::before {
  opacity: 1;
}

/* AI Gallery */
.ai-gallery {
  margin-top: var(--section-spacing);
  padding: 2rem 0;
  background: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  width: 100vw;
  margin-left: 50%;
  transform: translateX(-50%);
  position: relative;
}

.ai-images {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  padding: 0 1rem;
}

.ai-images figure {
  aspect-ratio: 1;
  overflow: visible; /* Changed from hidden to show caption */
  position: relative;
  border-radius: 4px;
  background-color: #f0f0f0;
  margin: 0 0 1.5rem 0; /* Added bottom margin for caption space */
}

.ai-images img {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 4px;
  transition: transform 0.3s ease;
}

.ai-images figure:hover img {
  transform: scale(1.05);
}

.ai-images .image-link {
  position: absolute;
  width: 100%;
  height: 100%;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  border-radius: 4px;
}

.ai-images figcaption {
  position: absolute;
  bottom: -1.5rem; /* Position below the image */
  left: 0;
  text-align: left;
  font-size: 0.75rem;
  color: #666;
  line-height: 1;
  padding: 0.5rem 2px;
  width: 100%;
}

@media (max-width: 1200px) {
  .ai-images {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .ai-images {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .ai-images {
    grid-template-columns: 1fr;
  }
}

/* Video thumbnails */
.video-thumbnail {
  position: relative;
  display: inline-block;
  width: 100%;
}

.video-thumbnail img {
  width: 100%;
  height: auto;
  border-radius: 4px;
}

.video-thumbnail::before {
  content: "▶";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border-radius: 50%;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 1;
}

.video-thumbnail .file-info {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
}

.video-thumbnail:hover::after {
  background: rgba(0, 0, 0, 0.85);
}

@media (max-width: 768px) {
  .gallery {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 2rem;
  }

  .subtitle {
    font-size: 1.2rem;
  }
}
