:root {
  --bg: linear-gradient(135deg, #0a0a0f, #1a1a1f);
  --card-bg: rgba(255,255,255,0.07);
  --text: #f1f1f1;
  --accent: #00ffcc;
  --header-bg: rgba(0,0,0,0.6);
  --modal-bg: rgba(0,0,0,0.85);
}
body {
  margin: 0;
  font-family: "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background 0.4s, color 0.4s;
}
body.light {
  --bg: linear-gradient(135deg, #f8fafc, #e2e8f0);
  --card-bg: #fff;
  --text: #222;
  --accent: #0077ff;
  --header-bg: #eaf2fb;
  --modal-bg: rgba(255,255,255,0.95);
}
header {
  padding: 1rem 2rem;
  background: var(--header-bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  flex-wrap: wrap;
}
.profile {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.profile-img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
}
.toolbar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.toolbar select,
.toolbar input,
.toolbar button {
  padding: 0.4rem 0.8rem;
  border: none;
  border-radius: 8px;
  background: rgba(255,255,255,0.1);
  color: var(--text);
  outline: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
/* Dropdown styling improvements */
.toolbar select {
  background: rgba(30,30,40,0.95);
  color: var(--text);
  border: 1px solid #222;
  border-radius: 8px;
  padding: 0.5rem 2rem 0.5rem 0.8rem;
  font-size: 1rem;
  appearance: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: border 0.2s, box-shadow 0.2s;
  position: relative;
  cursor: pointer;
}
.toolbar select:focus {
  outline: none;
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 2px var(--accent);
}
.toolbar select option {
  background: #222;
  color: #fff;
  font-size: 1rem;
  padding: 0.5rem 1rem;
}
body.light .toolbar select,
body.light .toolbar select option {
  background: #fff;
  color: #222;
}
.toolbar select::-ms-expand {
  display: none;
}
.toolbar select {
  background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' fill='none' stroke='%230077ff' stroke-width='2' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1em center;
  background-size: 1em;
}
main {
  padding: 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}
.card {
  background: var(--card-bg);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  transition: transform 0.3s, box-shadow 0.3s;
  cursor: pointer;
  outline: none;
}
.card:focus,
.card:hover {
  transform: translateY(-8px) scale(1.03);
  box-shadow: 0 8px 30px var(--accent);
}
.card img {
  width: 100%;
  height: auto; /* slightly larger for certificates */
  object-fit: contain; /* show entire certificate */
  background: #fff;
  border-radius: 8px 8px 0 0;
  margin-top: 1rem;
  margin-bottom: 0;
  display: block;
}
.card-content {
  padding: 2.2rem 1rem 2.2rem 1rem; /* Increased top and bottom padding */
}
.card-content h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--accent);
}
.card-content p {
  margin: 0.3rem 0;
  font-size: 0.9rem;
  color: var(--text);
}
#fullscreen-modal {
  position: fixed;
  inset: 0;
  background: var(--modal-bg);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
#fullscreen-modal img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 0 25px var(--accent);
  animation: zoomIn 0.3s ease;
}
@keyframes zoomIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.load-more {
  display: block;
  margin: 2rem auto;
  padding: 0.7rem 2rem;
  background: var(--accent);
  color: #222;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
}
.load-more:hover {
  background: #38e8ff;
}
.about {
  max-width: 700px;
  margin: 3rem auto 2rem auto;
  background: var(--card-bg);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  color: var(--text);
}
.about h2 {
  color: var(--accent);
  margin-top: 0;
}
body.light .toolbar input[type="text"] {
  background: #e2e8f0;
  color: #222;
  border: 1px solid #b6c2d1;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
body.light .toolbar input[type="text"]::placeholder {
  color: #555;
}
footer {
  width: 100%;
  background: var(--card-bg);
  color: var(--text);
  text-align: center;
  padding: 1.5rem 0 1rem 0;
  margin-top: 2rem;
  border-top: 1px solid #e2e8f0;
  font-size: 1rem;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.04);
}
.footer-content a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.footer-content a:hover {
  text-decoration: underline;
}
@media (max-width: 900px) {
  main {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    padding: 1rem;
    gap: 1rem;
  }
  header {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }
}
@media (max-width: 600px) {
  .profile-img {
    width: 40px;
    height: 40px;
  }
  .about {
    padding: 1rem;
  }
  main {
    grid-template-columns: 1fr;
    padding: 0.5rem;
  }
}