.certificates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.certificate-card {
  background: #fff;
  border-radius: 5px;
  padding: 25px;
  /* extra space for bottom buttons */
  padding-bottom: 60px;
  text-align: center;
  overflow: hidden;
  position: relative;
  border: 2px solid #009bb6;
  /* prominent border */
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.certificate-card:hover {
  transform: translateY(-3px) scale(1.02);
  border-color: #0291aa;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}

.certificate-card h4 {
  font-size: 18px;

  margin: 0;
  margin: 15px 0 8px;
  color: #222;
  font-weight: 600;
}

.certificate-card p {
  font-size: 14px;
  color: #666;
  margin-bottom: 15px;
}

.cert-icon {
  position: absolute;
  top: 12px;
  left: 12px;
  font-size: 28px;
  color: #f39c12;
}

/* Buttons fixed at bottom */
.cert-actions {
  position: absolute;
  bottom: 15px;
  left: 0;
  right: 0;
  bottom: 0px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #eee;
  padding: 8px;
  background: #fafafa;
}

.cert-actions .btn {
  padding: 7px 14px;
  border-radius: 3px;
  border: none;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.3s;
}

.cert-actions .btn i {
  margin-left: 6px;
}

.cert-actions .btn.view {
  background: #0291aa;
  color: #fff;
}

.cert-actions .btn.view:hover {
  background: #027a8e;
}

.cert-actions .btn.download {
  background: #28a745;
  color: #fff;
}

.cert-actions .btn.download:hover {
  background: #1e7e34;
}

/* Empty placeholder */
.certificate-card.empty {
  border: 2px dashed #aaa;
  color: #777;
  font-size: 15px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 180px;
}

.certificate-card.empty i {
  font-size: 36px;
  margin-bottom: 8px;
  color: #bbb;
}

.highlight {
  font-weight: 600;
  color: #0291aa;
  text-transform: uppercase;
  font-size: 13px;
  background-color: #e0f7fa;
  padding: 2px 6px;
  border-radius: 3px;
}

/* Pop-up model styles */
.view-pop-model {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.pop-model {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  position: relative;
}

.cert-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.cert-header h2 {
  margin: 0;
  font-size: 18px;
}

.close-pop-model {
  font-size: 24px;
  cursor: pointer;
}

.cert-body img {
  width: 416px;
  height: 265px;
  border-radius: 15px;
  border: 3px solid #336699;
}

.cert-footer {
  text-align: right;
  margin-top: 15px;
}

.cert-footer .btn {
  background-color: #32bbed;
  color: #fff;
  border: none;
  padding: 10px 15px;
  border-radius: 4px;
  cursor: pointer;
}

.cert-footer .btn:hover {
  background-color: #006e74;
}

@media (max-width: 480px) {
  .cert-body img {
    width: 100%;
    height: auto;
  }
  .cert-footer .btn {
    width: 100%;
    box-sizing: border-box;
  }
}