@font-face {
  font-family: "IRANSans";
  src: url(../fonts/woff2/IRANSansWeb_Light.woff2) format("woff2"),
       url(../fonts/woff/IRANSansWeb_Light.woff) format("woff");
  font-weight: 300;
  font-display: swap;
}
@font-face {
  font-family: "IRANSans";
  src: url(../fonts/woff2/IRANSansWeb.woff2) format("woff2"),
       url(../fonts/woff/IRANSansWeb.woff) format("woff");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IRANSans";
  src: url(../fonts/woff2/IRANSansWeb_Bold.woff2) format("woff2"),
       url(../fonts/woff/IRANSansWeb_Bold.woff) format("woff");
  font-weight: 600;
  font-display: swap;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "IRANSans", sans-serif;
}

:root {
  --priemrey: #a551ff;
  --secondary: #200543;
  --background: #05010b;
  --headerbg: #00000050;
  --rgbferst6: #00d9ff;
  --rgbferst7: #6f00ff;
  --rgbferst8: #dd00ff;
  --text: #ffffff;
  --khat: #8400ff;
}

body {
  width: 100%;
  min-height: 100vh;
  background-color: var(--background);
  color: var(--text);
  overflow-x: hidden;
}

/* ============ HEADER ============ */
.mainheader {
  width: 100%;
  background-color: var(--headerbg);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: row;
  justify-content: space-around;
  align-items: center;
  position: fixed;
  z-index: 100;
  padding: 12px 0;
}

.headlogo {
  display: flex;
  align-items: center;
  gap: 20px;
}

.headlogo img {
  width: 70px;
  height: 45px;
}

.headlogo p {
  color: var(--text);
  font-weight: 600;
  font-size: 1.5rem;
}

.headmenu ul {
  display: flex;
  gap: 40px;
  list-style: none;
}

.headmenu ul a {
  text-decoration: none;
  color: var(--text);
  transition: all 0.5s ease;
  padding: 8px 16px;
  border-radius: 12px;
}

.headmenu ul a:hover,
.headmenu ul a.active-link {
  color: var(--priemrey);
  background: linear-gradient(45deg, #a600ff, #0099ff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ============ HERO ============ */
.cert-hero {
  min-height: 90vh;
  padding: 140px 5% 60px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  background:
    radial-gradient(ellipse at top, #1a0a3a 0%, transparent 50%),
    radial-gradient(ellipse at bottom, #0a0525 0%, transparent 50%),
    var(--background);
}

.stars-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  background: transparent;
  z-index: 0;
}

.stars-small {
  box-shadow:
    120px 80px #fff, 250px 150px #fff, 380px 90px #fff,
    520px 200px #fff, 680px 120px #fff, 820px 250px #fff,
    950px 180px #fff, 1100px 100px #fff, 1250px 220px #fff,
    1400px 150px #fff, 1550px 280px #fff, 1700px 120px #fff;
  animation: twinkle 4s ease-in-out infinite alternate;
}

.stars-medium {
  box-shadow:
    200px 100px rgba(200, 220, 255, 0.8),
    450px 250px rgba(200, 220, 255, 0.8),
    700px 180px rgba(200, 220, 255, 0.8),
    950px 300px rgba(200, 220, 255, 0.8),
    1200px 220px rgba(200, 220, 255, 0.8);
  width: 2px;
  height: 2px;
  animation: twinkle 5s ease-in-out infinite alternate-reverse;
}

@keyframes twinkle {
  0% { opacity: 0.3; }
  100% { opacity: 1; }
}

.cert-hero-content {
  flex: 1;
  z-index: 2;
  max-width: 600px;
}

.badge {
  display: inline-block;
  padding: 8px 20px;
  background: rgba(165, 81, 255, 0.15);
  border: 1px solid rgba(165, 81, 255, 0.4);
  border-radius: 50px;
  font-size: 0.9rem;
  color: #d4a5ff;
  margin-bottom: 24px;
  backdrop-filter: blur(10px);
}

.cert-hero-content h1 {
  font-size: 3.5rem;
  font-weight: 900;
  line-height: 1.3;
  margin-bottom: 24px;
}

.cert-hero-content h1 span {
  background: linear-gradient(45deg, var(--rgbferst6), var(--rgbferst7), var(--rgbferst8));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  font-size: 1.1rem;
  line-height: 2;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 40px;
}

.cert-stats {
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
}

.stat-item {
  padding: 20px 30px;
  background: rgba(165, 81, 255, 0.1);
  border: 1px solid rgba(165, 81, 255, 0.3);
  border-radius: 16px;
  backdrop-filter: blur(10px);
  min-width: 130px;
}

.stat-number {
  font-size: 2rem;
  font-weight: 900;
  background: linear-gradient(45deg, var(--rgbferst6), var(--rgbferst8));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat-label {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 6px;
}

/* سیاره تزئینی */
.hero-planet {
  position: relative;
  width: 300px;
  height: 300px;
  flex-shrink: 0;
}

.planet-glow {
  position: absolute;
  inset: -20%;
  background: radial-gradient(circle, rgba(165, 81, 255, 0.3), transparent 70%);
  border-radius: 50%;
  filter: blur(30px);
  animation: planetPulse 4s ease-in-out infinite;
}

@keyframes planetPulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
}

.planet-body {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120px;
  height: 120px;
  background: radial-gradient(circle at 30% 30%, #a551ff, #200543);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  box-shadow:
    inset -15px -15px 40px rgba(0, 0, 0, 0.6),
    0 0 60px rgba(165, 81, 255, 0.5);
  animation: floatPlanet 6s ease-in-out infinite;
}

@keyframes floatPlanet {
  0%, 100% { transform: translate(-50%, -50%) translateY(0); }
  50% { transform: translate(-50%, -50%) translateY(-15px); }
}

.orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  border: 1px solid rgba(165, 81, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.orbit-1 {
  width: 200px;
  height: 200px;
  animation: orbitSpin 10s linear infinite;
}

.orbit-2 {
  width: 280px;
  height: 280px;
  animation: orbitSpin 15s linear infinite reverse;
}

@keyframes orbitSpin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.satellite {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.5rem;
  filter: drop-shadow(0 0 10px rgba(165, 81, 255, 0.8));
}

/* ============ FILTER ============ */
.filter-section {
  padding: 40px 5%;
  display: flex;
  justify-content: center;
}

.filter-tabs {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px;
  background: rgba(10, 5, 20, 0.6);
  border: 1px solid rgba(165, 81, 255, 0.2);
  border-radius: 50px;
  backdrop-filter: blur(10px);
}

.filter-btn {
  padding: 10px 24px;
  background: transparent;
  border: none;
  border-radius: 50px;
  color: rgba(255, 255, 255, 0.7);
  font-family: "IRANSans", sans-serif;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.filter-btn:hover {
  color: #fff;
  background: rgba(165, 81, 255, 0.15);
}

.filter-btn.active {
  background: linear-gradient(45deg, var(--rgbferst7), var(--rgbferst8));
  color: #fff;
  box-shadow: 0 4px 20px rgba(165, 81, 255, 0.4);
}

/* ============ CERTIFICATES GRID ============ */
.certificates-grid-wrapper {
  padding: 40px 5% 80px;
  position: relative;
}

.certificates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 30px;
  max-width: 1400px;
  margin: 0 auto;
}

.cert-card {
  position: relative;
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease;
}

.cert-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.cert-card-glow {
  position: absolute;
  inset: -2px;
  background: linear-gradient(135deg,
    rgba(165, 81, 255, 0.6) 0%,
    rgba(0, 217, 255, 0.3) 50%,
    rgba(221, 0, 255, 0.6) 100%);
  border-radius: 24px;
  filter: blur(15px);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 0;
}

.cert-card:hover .cert-card-glow {
  opacity: 0.8;
}

.cert-card-inner {
  position: relative;
  z-index: 1;
  padding: 30px;
  background: linear-gradient(145deg,
    rgba(32, 5, 67, 0.7) 0%,
    rgba(10, 5, 20, 0.9) 100%);
  border: 1px solid rgba(165, 81, 255, 0.3);
  border-radius: 24px;
  backdrop-filter: blur(10px);
  transition: all 0.4s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.cert-card:hover .cert-card-inner {
  transform: translateY(-8px);
  border-color: rgba(165, 81, 255, 0.6);
  box-shadow: 0 20px 40px rgba(165, 81, 255, 0.3);
}

.cert-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.cert-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, rgba(165, 81, 255, 0.3), rgba(0, 217, 255, 0.2));
  border: 1px solid rgba(165, 81, 255, 0.5);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  box-shadow: 0 0 20px rgba(165, 81, 255, 0.3);
}

.cert-type {
  padding: 4px 14px;
  background: rgba(0, 217, 255, 0.1);
  border: 1px solid rgba(0, 217, 255, 0.3);
  border-radius: 50px;
  font-size: 0.8rem;
  color: #00d9ff;
}

.cert-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 12px;
  line-height: 1.5;
}

.cert-issuer {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.95rem;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(165, 81, 255, 0.2);
}

.cert-description {
  font-size: 0.92rem;
  line-height: 1.9;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 20px;
  flex: 1;
}

.cert-meta {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(165, 81, 255, 0.1);
  border: 1px solid rgba(165, 81, 255, 0.2);
  border-radius: 8px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.85);
}

.cert-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  border-top: 1px solid rgba(165, 81, 255, 0.2);
}

.cert-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
}

.cert-status.verified {
  color: #4ade80;
}

.view-cert-btn {
  padding: 8px 20px;
  background: linear-gradient(45deg, var(--rgbferst7), var(--rgbferst8));
  border: none;
  border-radius: 12px;
  color: white;
  font-family: "IRANSans", sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.view-cert-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 20px rgba(165, 81, 255, 0.5);
}

/* ============ CTA ============ */
.cert-cta {
  padding: 80px 5%;
  display: flex;
  justify-content: center;
}

.cta-card {
  max-width: 800px;
  padding: 60px 40px;
  background: linear-gradient(145deg,
    rgba(32, 5, 67, 0.6) 0%,
    rgba(10, 5, 20, 0.9) 100%);
  border: 1px solid rgba(165, 81, 255, 0.3);
  border-radius: 30px;
  backdrop-filter: blur(10px);
  text-align: center;
  box-shadow:
    0 0 80px rgba(165, 81, 255, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.cta-icon {
  font-size: 3rem;
  margin-bottom: 20px;
}

.cta-card h2 {
  font-size: 2rem;
  margin-bottom: 16px;
  background: linear-gradient(45deg, var(--rgbferst6), var(--rgbferst8));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.cta-card p {
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 30px;
  line-height: 1.8;
}

.cta-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.cta-btn {
  padding: 14px 28px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
}

.cta-btn.primary {
  background: linear-gradient(45deg, var(--rgbferst7), var(--rgbferst8));
  color: white;
  box-shadow: 0 4px 20px rgba(165, 81, 255, 0.4);
}

.cta-btn.secondary {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(165, 81, 255, 0.4);
}

.cta-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(165, 81, 255, 0.5);
}

/* ============ FOOTER ============ */
.cert-footer {
  position: relative;
  padding: 40px 5%;
  background: rgba(43, 0, 86, 0.3);
  border-top: 1px solid rgba(165, 81, 255, 0.3);
  text-align: center;
}

.footer-glow {
  position: absolute;
  top: -50px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 100px;
  background: radial-gradient(ellipse at center, var(--priemrey), transparent 70%);
  opacity: 0.3;
  pointer-events: none;
}

.footer-content {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-content p {
  color: rgba(255, 255, 255, 0.7);
}

.footer-content .highlight {
  color: var(--priemrey);
  font-weight: 700;
}

.back-home {
  color: #00d9ff;
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
}

.back-home:hover {
  color: var(--rgbferst8);
  transform: translateX(-5px);
}

/* ============ PRELOADER ============ */
.preloader-overlay {
  position: fixed;
  inset: 0;
  background: var(--background);
  z-index: 99999;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.preloader-overlay.loader-hidden {
  opacity: 0;
  visibility: hidden;
}

.cert-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
}

.loader-ring {
  position: absolute;
  border: 3px solid transparent;
  border-top-color: var(--priemrey);
  border-radius: 50%;
  animation: ringRotate 1.5s linear infinite;
}

.loader-ring:nth-child(1) {
  width: 120px;
  height: 120px;
  border-top-color: var(--rgbferst6);
}

.loader-ring:nth-child(2) {
  width: 90px;
  height: 90px;
  border-top-color: var(--rgbferst8);
  animation-duration: 1s;
  animation-direction: reverse;
}

@keyframes ringRotate {
  to { transform: rotate(360deg); }
}

.loader-core {
  font-size: 2.5rem;
  animation: floatPlanet 2s ease-in-out infinite;
}

.loader-text {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1rem;
  letter-spacing: 3px;
}

.loader-text span {
  animation: dotBlink 1.4s infinite;
}

.loader-text span:nth-child(2) { animation-delay: 0.2s; }
.loader-text span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotBlink {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 992px) {
  .cert-hero {
    flex-direction: column;
    text-align: center;
    padding-top: 120px;
  }

  .cert-hero-content h1 {
    font-size: 2.5rem;
  }

  .cert-stats {
    justify-content: center;
  }

  .hero-planet {
    margin-top: 40px;
    width: 250px;
    height: 250px;
  }

  .mainheader {
    flex-direction: column;
    gap: 10px;
    padding: 10px 0;
  }
}

@media (max-width: 768px) {
  .headmenu ul {
    gap: 20px;
    font-size: 0.9rem;
  }

  .cert-hero-content h1 {
    font-size: 2rem;
  }

  .hero-desc {
    font-size: 1rem;
  }

  .certificates-grid {
    grid-template-columns: 1fr;
  }

  .cta-card {
    padding: 40px 20px;
  }

  .cta-card h2 {
    font-size: 1.5rem;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .cert-hero-content h1 {
    font-size: 1.6rem;
  }

  .stat-item {
    min-width: 100%;
  }

  .filter-tabs {
    border-radius: 20px;
  }

  .filter-btn {
    padding: 8px 16px;
    font-size: 0.85rem;
  }

  .cert-card-inner {
    padding: 24px 20px;
  }

  .cta-buttons {
    flex-direction: column;
  }

  .cta-btn {
    width: 100%;
    justify-content: center;
  }
}