/* ============================================= */
/* CERTIFICATIONS PAGE STYLES                    */
/* ============================================= */

/* ============================================= */
/* CERTIFICATIONS TYPOGRAPHY SYSTEM              */
/* ============================================= */

/* Ensure all text elements use correct fonts */
.filter-controls,
.filter-header h3,
.filter-subtitle,
.filter-label,
.filter-btn,
.issuer-tag,
.search-input,
.search-count,
.active-filter-tag,
.certification-card,
.certification-title,
.certification-description,
.issuer-badge,
.certification-btn,
.no-results h3,
.no-results p,
.clear-filters-btn {
  font-family: var(--font-body);
}

/* Headings use Orbitron */
.filter-header h3,
.no-results h3,
.certification-title {
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* Filter Controls */
.filter-controls {
  padding: 32px;
  margin-bottom: 20px;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.filter-header {
  margin-bottom: 28px;
}

.filter-header h3 {
  font-family: var(--font-heading);
  font-size: 20px;
  color: var(--accent-cyan);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.filter-header h3 i {
  font-size: 22px;
}

.filter-subtitle {
  font-size: 14px;
  color: var(--text-muted);
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 32px;
  margin-bottom: 24px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.filter-label {
  font-size: 13px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

/* Issuer Filter - Enhanced Chip Style */
.issuer-filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-btn {
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.filter-btn::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(0, 212, 255, 0.1);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.filter-btn:hover {
  color: var(--accent-cyan);
  border-color: rgba(0, 212, 255, 0.3);
  background: rgba(0, 212, 255, 0.05);
  transform: translateY(-2px);
}

.filter-btn:hover::before {
  width: 300px;
  height: 300px;
}

.filter-btn.active {
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
  background: rgba(0, 212, 255, 0.08);
  box-shadow: 0 0 20px var(--glow-cyan);
  transform: translateY(-2px);
}

.filter-btn.active::after {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: 12px;
  background: linear-gradient(
    45deg,
    rgba(0, 212, 255, 0.3),
    rgba(124, 58, 237, 0.3),
    rgba(0, 212, 255, 0.3)
  );
  z-index: -1;
  animation: chipGlow 2s ease-in-out infinite alternate;
}

@keyframes chipGlow {
  0% {
    opacity: 0.5;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
  }
  100% {
    opacity: 1;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.8);
  }
}

/* Search */
.search-group {
  grid-column: span 2;
}

@media (max-width: 900px) {
  .search-group {
    grid-column: span 1;
  }
}

.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-wrapper i {
  position: absolute;
  left: 18px;
  color: var(--text-muted);
  font-size: 18px;
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 16px 20px 16px 52px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  outline: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 30px rgba(0, 212, 255, 0.1);
  background: rgba(0, 212, 255, 0.02);
}

.search-count {
  position: absolute;
  right: 18px;
  font-size: 13px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--glass-border);
}

/* Active Filters */
.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 20px;
  border-top: 1px solid var(--glass-border);
  min-height: 48px;
}

.active-filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: 8px;
  color: var(--accent-cyan);
  font-size: 13px;
  font-weight: 500;
}

.active-filter-tag button {
  background: none;
  border: none;
  color: var(--accent-cyan);
  font-size: 16px;
  cursor: pointer;
  padding: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.2s;
}

.active-filter-tag button:hover {
  background: rgba(0, 212, 255, 0.2);
}

/* Certifications Grid */
.certifications-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  margin-top: 0;
  margin-bottom: 40px;
}

/* Filter section spacing fix */
#filter-section.section {
  padding-bottom: 20px; /* Reduced from 100px */
}

/* Certifications grid section spacing */
#certifications-grid-section.section {
  padding-top: 20px; /* Reduced from 100px */
}

/* Certification Card with Enhanced Animations */
.certification-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 28px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: visible;
  display: flex;
  flex-direction: column;
  gap: 16px;
  opacity: 0;
  transform: translateY(20px);
  animation: cardReveal 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  font-family: var(--font-body);
  min-height: 280px;
}

@keyframes cardReveal {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Staggered animation for grid items */
.certifications-grid .certification-card:nth-child(1) {
  animation-delay: 0.1s;
}
.certifications-grid .certification-card:nth-child(2) {
  animation-delay: 0.2s;
}
.certifications-grid .certification-card:nth-child(3) {
  animation-delay: 0.3s;
}
.certifications-grid .certification-card:nth-child(4) {
  animation-delay: 0.4s;
}
.certifications-grid .certification-card:nth-child(5) {
  animation-delay: 0.5s;
}
.certifications-grid .certification-card:nth-child(6) {
  animation-delay: 0.6s;
}
.certifications-grid .certification-card:nth-child(7) {
  animation-delay: 0.7s;
}
.certifications-grid .certification-card:nth-child(8) {
  animation-delay: 0.8s;
}

.certification-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(0, 212, 255, 0.3),
    transparent
  );
  opacity: 0;
  transition: opacity 0.4s;
}

.certification-card:hover::before {
  opacity: 1;
}

.certification-card:hover {
  border-color: var(--glass-border-hover);
  box-shadow: 0 8px 40px rgba(0, 212, 255, 0.08);
  transform: translateY(-4px);
}

.certification-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 4px;
}

.certification-title {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  margin: 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

.issuer-badge {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0.3px;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.5;
  background: rgba(124, 58, 237, 0.1);
  color: var(--accent-violet);
  border: 1px solid rgba(124, 58, 237, 0.2);
  text-align: center;
  min-width: 0;
  flex-shrink: 0;
  hyphens: auto;
  max-width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  align-self: flex-start;
  margin-top: 4px;
}

.issuer-badge:hover {
  background: rgba(124, 58, 237, 0.15);
  border-color: rgba(124, 58, 237, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.1);
}

/* Date Display */
.certification-date-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
}

.certification-date-item {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.certification-date-item::before {
  content: "📅";
  font-size: 11px;
}

.certification-date-label {
  font-weight: 500;
  color: var(--text-secondary);
}

.certification-date-value {
  color: var(--text-muted);
}

.certification-description {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  flex-grow: 1;
  margin-top: 8px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.certification-actions {
  display: flex;
  gap: 12px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--glass-border);
}

.certification-btn {
  flex: 1;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

.certification-btn:hover {
  color: var(--accent-cyan);
  border-color: rgba(0, 212, 255, 0.3);
  background: rgba(0, 212, 255, 0.05);
}

.certification-btn.view-credential {
  background: rgba(0, 212, 255, 0.08);
  color: var(--accent-cyan);
  border-color: rgba(0, 212, 255, 0.2);
}

.certification-btn.view-credential:hover {
  background: rgba(0, 212, 255, 0.12);
  box-shadow: 0 0 20px var(--glow-cyan);
}

/* Launch button styling for certification cards */
.certification-btn.launch-btn {
  background: var(--accent-gradient);
  color: #fff;
  border: none;
}

.certification-btn.launch-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 212, 255, 0.3);
}

/* No Results */
.no-results {
  padding: 60px 40px;
  text-align: center;
  display: none;
}

.no-results i {
  font-size: 48px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.no-results h3 {
  font-family: var(--font-heading);
  font-size: 20px;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.no-results p {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.clear-filters-btn {
  padding: 12px 28px;
  background: var(--accent-gradient);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.clear-filters-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 212, 255, 0.3);
}

/* Performance Optimizations */
.certification-card,
.filter-btn,
.detail-btn,
.modal-btn {
  will-change: transform, opacity;
  backface-visibility: hidden;
}

/* Filtering Animation */
.certification-card {
  transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
}

.certification-card.filtered-out {
  opacity: 0;
  visibility: hidden;
  transform: scale(0.9);
  pointer-events: none;
  position: absolute;
}

/* Smooth filtering transition */
.certifications-grid {
  position: relative;
  min-height: 300px;
}

/* Responsive */
@media (max-width: 900px) {
  .filter-grid {
    grid-template-columns: 1fr;
  }

  .certifications-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

@media (max-width: 540px) {
  .filter-controls {
    padding: 24px;
  }

  .certifications-grid {
    grid-template-columns: 1fr;
  }

  .certification-card {
    padding: 24px;
  }

  .certification-actions {
    flex-direction: column;
  }

  .certification-btn {
    width: 100%;
  }
}

/* ============================================= */
/* SORTING STYLES                                */
/* ============================================= */

.sort-group {
  grid-column: span 2;
}

@media (max-width: 900px) {
  .sort-group {
    grid-column: span 1;
  }
}

.sorting-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.sort-btn {
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.sort-btn::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(124, 58, 237, 0.1);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.sort-btn:hover {
  color: var(--accent-violet);
  border-color: rgba(124, 58, 237, 0.3);
  background: rgba(124, 58, 237, 0.05);
  transform: translateY(-2px);
}

.sort-btn:hover::before {
  width: 300px;
  height: 300px;
}

.sort-btn.active {
  color: var(--accent-violet);
  border-color: var(--accent-violet);
  background: rgba(124, 58, 237, 0.08);
  box-shadow: 0 0 20px var(--glow-violet);
  transform: translateY(-2px);
}

.sort-btn.active::after {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: 12px;
  background: linear-gradient(
    45deg,
    rgba(124, 58, 237, 0.3),
    rgba(0, 212, 255, 0.3),
    rgba(124, 58, 237, 0.3)
  );
  z-index: -1;
  animation: sortGlow 2s ease-in-out infinite alternate;
}

@keyframes sortGlow {
  0% {
    opacity: 0.5;
    box-shadow: 0 0 10px rgba(124, 58, 237, 0.5);
  }
  100% {
    opacity: 1;
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.8);
  }
}

.sorting-loading {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 14px;
}

.loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--glass-border);
  border-top-color: var(--accent-violet);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
