/* --- Base Styles & Reset --- */
body {
  font-family: 'Segoe UI', Arial, sans-serif; /* Prefer Segoe UI, fallback to Arial */
  margin: 0;
  padding: 0;
  background: #f7f9fc; /* Light background color */
  color: #333; /* Darker text color */
  box-sizing: border-box; /* Include padding and border in the element's total width and height */
}

/* Ensure images don't overflow their containers */
img {
  max-width: 100%;
  height: auto;
  display: block; /* Removes extra space below images */
}

.container {
  max-width: 960px; /* Max width for content */
  margin: 0 auto; /* Center the container */
  padding: 20px;
}

/* --- Header and Navigation --- */
header {
  background-color: #004080; /* Darker blue for header */
  color: white;
  padding: 20px 0; /* Vertical padding, full width */
  text-align: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2); /* Subtle shadow */
}

header h1 {
  margin: 0;
  padding-bottom: 10px; /* Space below title */
}

nav ul {
  list-style: none;
  padding: 0;
  display: flex;
  justify-content: center;
  margin: 0; /* Remove default margin */
}

nav ul li {
  margin: 0 15px;
}

nav ul li a {
  text-decoration: none;
  color: white;
  font-weight: bold;
  padding: 5px 0;
  transition: color 0.3s ease; /* Smooth hover effect */
}

nav ul li a:hover {
  color: #a0d3ff; /* Lighter blue on hover */
}

/* --- Section Styling (for scrolling functionality) --- */
.section {
  padding: 40px 20px;
  text-align: center;
  background-color: #fff;
  margin-bottom: 20px; /* Space between sections when all are displayed */
  box-shadow: 0 4px 10px rgba(0,0,0,0.1); /* More prominent shadow */
  border-radius: 8px; /* Rounded corners for sections */

  /* Properties to hide sections when not active (visually, but still in DOM) */
  width: 100%;
  
  scroll-margin-top: 70px; /* Space from top when scrolling to a section (adjust if header height changes) */
}

.section h2 {
  color: #004080; /* Match header blue */
  margin-bottom: 25px;
  font-size: 2em;
}

/* --- Beranda Section --- */
#beranda img {
  border-radius: 50%; /* Circular image */
  margin-top: 20px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* --- Tentang Kami Section --- */
#tentang ul {
  list-style: none; /* Remove bullet points */
  padding: 0;
  text-align: left; /* Align text left */
  max-width: 700px;
  margin: 20px auto;
}

#tentang ul li {
  margin-bottom: 10px;
  line-height: 1.6;
}

#tentang strong {
  color: #0056b3; /* Slightly different blue for strong text */
}

/* --- Kegiatan Eskul (Menu Container) --- */
.menu-container {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 30px;
}

.menu-card {
  width: 200px; /* Slightly wider cards */
  padding: 25px;
  border-radius: 15px;
  color: white; /* Text color for cards */
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 5px 15px rgba(0,0,0,0.15); /* More pronounced shadow */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  text-align: center;
}

.menu-card:hover {
  transform: translateY(-8px) scale(1.03); /* Lift and slightly enlarge */
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.menu-card h2 {
  font-size: 1.8em;
  margin-top: 0;
  margin-bottom: 10px;
  color: white; /* Ensure heading color is white on cards */
}

.menu-card p {
  font-size: 1.1em;
  opacity: 0.9;
}

/* Specific card colors */
.card-blue { background-color: #2980b9; } /* Programming */
.card-green { background-color: #27ae60; } /* Desain Grafis */
.card-pink { background-color: #e91e63; } /* Robotik */

/* --- Detail Sections (Programming, Desain, Robotik) --- */
.detail-section .container {
  max-width: 100%; /* Wider container for detail content */
  text-align: left;
}

.detail-content img {
  border-radius: 10px;
  margin-bottom: 20px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.back-btn {
  background-color: #555; /* Darker gray for back button */
  color: white;
  padding: 12px 25px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.05em;
  margin-top: 30px;
  transition: background-color 0.2s ease;
}

.back-btn:hover {
  background-color: #333;
}

/* --- Galeri Section --- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Responsive grid */
  gap: 20px;
  margin-top: 30px;
  justify-items: center; /* Center items in the grid */
}

.gallery-grid img {
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  transition: transform 0.2s ease-in-out;
}

.gallery-grid img:hover {
  transform: scale(1.05); /* Slightly enlarge on hover */
}

/* --- Kontak Section --- */
#kontak ul {
  list-style: none;
  padding: 0;
  margin-top: 20px;
}

#kontak ul li {
  margin-bottom: 10px;
  font-size: 1.1em;
}

#kontak ul li a {
  color: #0056b3;
  text-decoration: none;
}

#kontak ul li a:hover {
  text-decoration: underline;
}

/* --- Footer --- */
footer {
  text-align: center;
  padding: 20px 0;
  background-color: #004080;
  color: white;
  margin-top: 40px; /* Space above footer */
}

/* --- Popup Layer Styling --- */
.popup {
  display: flex; /* Use flexbox to easily center content */
  align-items: center; /* Center vertically */
  justify-content: center; /* Center horizontally */
  position: fixed;
  z-index: 1000; /* Higher z-index to be on top */
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.7); /* Darker overlay */
  visibility: hidden; /* Hidden by default */
  opacity: 0;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.popup.active { /* Use 'active' class for popup visibility */
  visibility: visible;
  opacity: 1;
}

.popup-content {
  background-color: #fff;
  padding: 30px;
  width: 90%;
  max-width: 550px;
  border-radius: 10px;
  position: relative;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  transform: scale(0.9); /* Start slightly smaller */
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.popup.active .popup-content {
  transform: scale(1); /* Scale to normal size */
}

.popup-content h3 {
  color: #004080;
  margin-bottom: 20px;
  font-size: 1.8em;
}

.popup-content ul {
  list-style-type: disc;
  padding-left: 25px;
  text-align: left;
}

.popup-content ul li {
  margin-bottom: 8px;
  line-height: 1.5;
}

.close {
  color: #aaa;
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 30px; /* Larger close button */
  font-weight: bold;
  cursor: pointer;
  transition: color 0.2s ease;
}

.close:hover {
  color: #ff4d4d; /* Redder on hover */
}

/* Button for viewing materials */
.view-materials-btn {
  background-color: #28a745; /* Green button */
  color: white;
  padding: 12px 25px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.1em;
  margin-top: 30px;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.view-materials-btn:hover {
  background-color: #218838;
  transform: translateY(-2px); /* Slight lift on hover */
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  header h1 {
    font-size: 1.8em;
  }

  nav ul {
    flex-direction: column; /* Stack navigation items on small screens */
    gap: 10px;
  }

  .menu-container {
    flex-direction: column;
    align-items: center;
  }

  .menu-card {
    width: 90%; /* Wider cards on smaller screens */
  }

  .gallery-grid {
    grid-template-columns: 1fr; /* Single column for gallery */
  }

  .popup-content {
    width: 90%;
    margin: 5% auto; /* Adjust margin for smaller screens */
  }
}
#menu-container {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 30px;
}
#beranda img {
  display: block;
  margin: 20px auto 0; /* Atas 20px, kiri-kanan auto */
  border-radius: 50%;
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}