body {
  margin: 0;
  font-family: sans-serif;
  background: #fff;
  color: #000;
  transition: background 0.3s, color 0.3s;
}

body.dark {
  background: #111;
  color: #fff;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #111;
  color: #fff;
  padding: 10px 20px;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo {
  height: 32px;
}

.search-bar {
  padding: 5px 10px;
  font-size: 16px;
  border-radius: 4px;
  border: none;
}

.nav-right button {
  margin-left: 10px;
  font-size: 18px;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
}

.icon-btn {
  width: 66px;
  height: 66px;
  vertical-align: middle;
}

/* Grid Layouts */
main.grid-1,
main.grid-2,
main.grid-4,
main.grid-8,
main.grid-16 {
  display: grid;
  gap: 10px;
  padding: 20px;
}

main.grid-1 { grid-template-columns: 1fr; }
main.grid-2 { grid-template-columns: repeat(2, 1fr); }
main.grid-4 { grid-template-columns: repeat(4, 1fr); }
main.grid-8 { grid-template-columns: repeat(4, 1fr); }
main.grid-16 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: #eee;
  padding: 20px;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.card:hover {
  transform: scale(1.02);
}

/* Lightbox */
#lightbox {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 200;
}

#lightbox.hidden {
  display: none;
}

.lightbox-content {
  background: #fff;
  color: #000;
  padding: 30px;
  border-radius: 10px;
  max-width: 600px;
  width: 80%;
  position: relative;
}

#lightboxClose {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 24px;
  cursor: pointer;
}

/* Popup Windows */
.popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  color: #000;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 0 15px rgba(0,0,0,0.2);
  z-index: 300;
  display: none;
}

.popup-content {
  max-height: 70vh;
  overflow-y: auto;
}

.popup button {
  margin-top: 10px;
  margin-right: 10px;
}

/* Tooltip */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip .tooltiptext {
  visibility: hidden;
  background-color: #222;
  color: #fff;
  text-align: center;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  position: absolute;
  top: 130%; /* appear below */
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 10;
}

.tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}
