/* -------------------------------------------------
   GLOBAL STYLING
------------------------------------------------- */
:root {
  --bg: #f4f7fb;
  --text: #222;
  --card-bg: #ffffff;
  --accent:#2c3e50;
  --shadow: rgba(0, 0, 0, 0.12);
}

body.dark {
  --bg: #0d1117;
  --text: #e4e4e4;
  --card-bg: #161b22;
  --accent: #2c3e50;
  --shadow: rgba(255, 255, 255, 0.07);
}

body {
  margin: 0;
  font-family: "Poppins", sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background 0.3s, color 0.3s;
}

/* -------------------------------------------------
   HEADER
------------------------------------------------- */
.header-wrapper {
  background: var(--accent);
  padding: 35px 10px;
  color: white;
  text-align: center;
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 20px;
  box-shadow: 0 4px 15px var(--shadow);
}

h1 {
  font-size: 2.3rem;
  font-weight: 600;
}

/* -------------------------------------------------
   SEARCH BAR
------------------------------------------------- */
.search-box {
  width: 50%;
  margin: 30px auto;
  display: block;
  padding: 12px 18px;
  font-size: 17px;
  border-radius: 50px;
  border: 2px solid #ccc;
  outline: none;
  transition: 0.3s;
}

.search-box:focus {
  border-color: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

body.dark .search-box {
  background: #1e2734;
  border-color: #333;
}

/* -------------------------------------------------
   GRID LAYOUT
------------------------------------------------- */
.certificates-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 25px;
  padding: 30px;
}

@media (max-width: 1200px) {
  .certificates-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .certificates-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .certificates-grid { grid-template-columns: 1fr; }
}

/* -------------------------------------------------
   CARD DESIGN
------------------------------------------------- */
.certificate-card {
  background: var(--card-bg);
  padding: 15px;
  border-radius: 15px;
  box-shadow: 0 4px 18px var(--shadow);
  transition: 0.3s;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.7s forwards;
}

.certificate-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 6px 20px var(--shadow);
}

/* Fade animation */
@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* -------------------------------------------------
   IMAGE
------------------------------------------------- */
.thumbnail {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.3s;
}

.thumbnail:hover {
  transform: scale(1.05);
  filter: brightness(1.05);
}

/* MULTIPLE IMAGES */
.multiple-images {
  display: flex;
  gap: 10px;
}

.multiple-images img {
  width: 50%;
  height: 180px;
  object-fit: cover;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.3s;
}

.multiple-images img:hover {
  transform: scale(1.06);
}

/* -------------------------------------------------
   TEXT
------------------------------------------------- */
.certificate-info h3 {
  margin: 10px 0 5px;
  font-weight: 600;
}
.certificate-info p {
  margin: 0;
  opacity: 0.7;
}

/* -------------------------------------------------
   DARK MODE BUTTON
------------------------------------------------- */
.theme-toggle {
  position: fixed;
  right: 25px;
  top: 25px;
  padding: 12px 15px;
  border-radius: 50%;
  font-size: 20px;
  border: none;
  background: var(--card-bg);
  box-shadow: 0 4px 12px var(--shadow);
  cursor: pointer;
  transition: 0.3s;
  z-index: 2000;
}

.theme-toggle:hover {
  transform: scale(1.1);
}

/* -------------------------------------------------
   LIGHTBOX (INTERACTIVE FULLSCREEN VIEW)
------------------------------------------------- */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backdrop-filter: blur(7px);
  background: rgba(0,0,0,0.6);
  justify-content: center;
  align-items: center;
  z-index: 3000;
  animation: fadeIn 0.3s;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

#lightbox-img {
  max-width: 85%;
  max-height: 85%;
  border-radius: 18px;
  animation: zoomIn 0.4s;
}

@keyframes zoomIn {
  from { transform: scale(0.7); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.close {
  position: absolute;
  top: 20px;
  right: 40px;
  font-size: 45px;
  color: white;
  cursor: pointer;
  transition: 0.2s;
}

.close:hover {
  transform: scale(1.2);
}

/* Lightbox navigation */
.nav {
  position: absolute;
  top: 50%;
  font-size: 35px;
  padding: 15px 18px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.3);
  color: white;
  cursor: pointer;
  transition: 0.3s;
}

.nav:hover {
  background: rgba(255,255,255,0.5);
  transform: scale(1.15);
}

.nav.prev { left: 40px; }
.nav.next { right: 40px; }
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(6px);
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.lightbox-img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 12px;
  animation: zoomIn 0.35s;
}

@keyframes zoomIn {
  from { transform: scale(0.7); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
