
/* ============================================
   CLOUDEMY — Certificate Page Styles
   Shared styles for both landing and verify pages
   ============================================ */

/* --- Hero Section --- */
.hero-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f5f3ff 0%, #fafafa 50%, #f8f7ff 100%);
  position: relative;
  overflow: hidden;
  padding: 120px 0 80px;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero-section::after {
  content: '';
  position: absolute;
  bottom: -20%;
  left: -5%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.05) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero-section > .container {
  position: relative;
  z-index: 1;
  text-align: center;
}

.hero-section h1 {
  margin-bottom: 16px;
}

.hero-section > .container > p:first-of-type {
  font-size: 1.15rem;
  color: var(--c-text-body);
  margin-bottom: 40px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

/* --- Search Form --- */
.search-form {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 600px;
  margin: 0 auto 48px;
  flex-wrap: wrap;
  justify-content: center;
}

@media (max-width: 640px) {
  .search-form {
    flex-direction: column;
    gap: 16px;
  }
}

.search-input {
  flex: 1;
  min-width: 280px;
  padding: 14px 20px;
  border: 2px solid var(--c-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--c-text);
  background: var(--c-white);
  transition: all var(--transition);
}

.search-input:focus {
  outline: none;
  border-color: var(--c-purple);
  box-shadow: 0 0 0 3px var(--c-purple-glow);
}

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

@media (max-width: 640px) {
  .search-input {
    width: 100%;
    min-width: unset;
  }
}

/* --- Section: How It Works --- */
.how-it-works {
  background: var(--c-white);
  padding: 80px 0;
}

.how-it-works .section-header {
  margin-bottom: 60px;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 40px;
}

.step-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 32px;
  border-radius: var(--radius-lg);
  background: var(--c-bg-alt);
  transition: all var(--transition);
  border: 2px solid transparent;
}

.step-card:hover {
  transform: translateY(-8px);
  border-color: var(--c-purple);
  background: var(--c-white);
  box-shadow: 0 12px 32px rgba(124, 58, 237, 0.12);
}

.step-card__icon {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #a121ca, #7b1fe4);
  border-radius: 12px;
  color: var(--c-white);
  margin-bottom: 24px;
  flex-shrink: 0;
}

.step-card__icon svg {
  width: 32px;
  height: 32px;
  stroke-width: 2;
}

.step-card h3 {
  margin-bottom: 12px;
}

.step-card p {
  color: var(--c-text-muted);
  font-size: 0.95rem;
  margin-bottom: 0;
}

/* --- Section: Trust Indicators --- */
.trust-indicators {
  background: linear-gradient(160deg, #0f0a1e 0%, #1a103a 40%, #2d1b69 100%);
  color: var(--c-dark-text);
  padding: 60px 0;
  position: relative;
  overflow: hidden;
}

.trust-indicators::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(124,58,237,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124,58,237,0.06) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

.trust-indicators > .container {
  position: relative;
  z-index: 1;
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 32px;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(124, 58, 237, 0.1);
  transition: all var(--transition);
}

.trust-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(124, 58, 237, 0.2);
}

.trust-item__icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #a121ca, #7b1fe4);
  border-radius: 8px;
  color: var(--c-white);
  flex-shrink: 0;
}

.trust-item__icon svg {
  width: 24px;
  height: 24px;
}

.trust-item__text h4 {
  color: var(--c-white);
  margin-bottom: 4px;
  font-size: 0.95rem;
}

.trust-item__text p {
  color: var(--c-dark-text);
  font-size: 0.85rem;
  margin-bottom: 0;
}

/* --- Section: About Authority --- */
.authority-section {
  padding: 80px 0;
  background: var(--c-bg-alt);
}

.authority-section h2 {
  margin-bottom: 24px;
}

.authority-section > .container > p {
  max-width: 700px;
  margin-bottom: 24px;
  color: var(--c-text-body);
  font-size: 1rem;
}

.authority-cta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.authority-cta .btn {
  font-size: 0.9rem;
}

.authority-cta .btn--outline.animate-btn {
  background: transparent;
  border-color: var(--c-purple);
  color: var(--c-purple);
}

/* ============================================
   Certificate Card Styles (Verify Page)
   ============================================ */

.cert-card {
  background: var(--c-white);
  border-radius: var(--radius-lg);
  border: 2px solid var(--c-border);
  padding: 40px;
  margin-bottom: 40px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

@media (max-width: 640px) {
  .cert-card {
    padding: 24px;
  }
}

.cert-card--verified {
  border-left: 4px solid #10b981;
}

.cert-card--error {
  border-color: #fecaca;
}

/* --- Certificate Header with Photo --- */
.cert-header-with-photo {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--c-border);
}

@media (max-width: 640px) {
  .cert-header-with-photo {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

.cert-photo {
  flex-shrink: 0;
}

.cert-photo__avatar {
  width: 120px;
  height: 120px;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid var(--c-border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.cert-photo__avatar svg {
  width: 70%;
  height: 70%;
}

.cert-name-section {
  flex: 1;
}

.cert-name-section h2 {
  font-size: 1.8rem;
}

.cert-divider {
  height: 1px;
  background: var(--c-border);
  margin: 24px 0;
}

/* --- Status Badge --- */
.cert-status {
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.cert-status__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.cert-status__badge--verified {
  background: #ecfdf5;
  color: #10b981;
  border: 1px solid #d1fae5;
}

.cert-status__badge--error {
  background: #fef2f2;
  color: #ef4444;
  border: 1px solid #fee2e2;
}

.cert-status__badge svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* --- Certificate Grid --- */
.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 32px;
  margin-bottom: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--c-border);
}

@media (max-width: 640px) {
  .cert-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

.cert-field label {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-text-muted);
  margin-bottom: 8px;
}

.cert-field p {
  font-size: 1rem;
  color: var(--c-text);
  font-weight: 500;
  margin-bottom: 0;
}

.cert-id {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

/* --- Skills Section --- */
.cert-skills {
  margin-bottom: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--c-border);
}

.cert-skills label {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-text-muted);
  margin-bottom: 16px;
}

.skills-container {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.skill-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  background: var(--c-purple-faint);
  color: var(--c-purple);
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid var(--c-border);
  white-space: nowrap;
}

.skill-tag:hover {
  background: var(--c-purple-light);
  color: var(--c-white);
  border-color: var(--c-purple-light);
}

/* --- Authority Section in Card --- */
.cert-authority {
  padding: 24px;
  background: var(--c-bg-alt);
  border-radius: var(--radius-sm);
  margin-bottom: 32px;
}

.cert-authority__content {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.cert-authority__icon {
  width: 32px;
  height: 32px;
  color: var(--c-purple);
  flex-shrink: 0;
  margin-top: 4px;
}

.cert-authority__name {
  font-weight: 600;
  color: var(--c-text);
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.cert-authority__desc {
  color: var(--c-text-muted);
  font-size: 0.9rem;
  margin-bottom: 0;
  line-height: 1.6;
}

/* --- Certificate Footer --- */
.cert-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 24px;
  border-top: 1px solid var(--c-border);
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .cert-footer {
    flex-direction: column;
    align-items: stretch;
  }
}

.cert-timestamp {
  font-size: 0.85rem;
  color: var(--c-text-muted);
  margin-bottom: 0;
}

@media (max-width: 640px) {
  .cert-timestamp {
    order: 2;
  }
}

.copy-btn {
  width: auto;
}

@media (max-width: 860px) {
  .copy-btn {
    width: 100%;
  }
}

/* --- Error Content --- */
.error-content {
  text-align: center;
  padding: 32px 0;
}

.error-content h2 {
  margin-bottom: 16px;
  color: #ef4444;
}

.error-content p {
  color: var(--c-text-body);
  margin-bottom: 16px;
}

.error-help {
  color: var(--c-text-muted);
  font-size: 0.95rem;
}

.error-help a {
  color: var(--c-purple);
  font-weight: 600;
}

/* --- Verify Again Section --- */
.verify-again-section {
  background: var(--c-bg-alt);
  padding: 48px;
  border-radius: var(--radius-lg);
  text-align: center;
}

@media (max-width: 640px) {
  .verify-again-section {
    padding: 32px 24px;
  }
}

.verify-again-section h3 {
  margin-bottom: 32px;
}

/* ============================================
   Loading Skeleton Animation
   ============================================ */

.cert-card--loading {
  pointer-events: none;
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--c-border) 0%,
    var(--c-white) 50%,
    var(--c-border) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.skeleton--badge {
  width: 150px;
  height: 36px;
  margin-bottom: 32px;
}

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--c-border);
}

.skeleton--field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skeleton--field::before {
  content: '';
  height: 12px;
  width: 60px;
  background: var(--c-border);
  border-radius: 4px;
  display: block;
}

.skeleton--field {
  height: 60px;
  background: var(--c-border);
  animation: none;
}

.skeleton-skills {
  padding-bottom: 40px;
  border-bottom: 1px solid var(--c-border);
  margin-bottom: 40px;
}

.skeleton--tag {
  width: 100px;
  height: 32px;
  display: inline-block;
}

.skeleton--text {
  height: 16px;
  display: block;
}

/* ============================================
   Hero Verification Card
   ============================================ */

.cert-hero {
  display: flex;
  flex-direction: column;
  background: linear-gradient(160deg, #0f0a1e 0%, #1a103a 60%, #2d1b69 100%);
  border-radius: 16px;
  padding: 28px 32px;
  margin-bottom: 28px;
  border: 1px solid rgba(124, 58, 237, 0.15);
  position: relative;
  overflow: hidden;
}

.cert-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(124, 58, 237, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124, 58, 237, 0.06) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

/* ---- Top row ---- */
.cert-hero__top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  align-items: center;
  position: relative;
  z-index: 1;
}

@media (max-width: 860px) {
  .cert-hero__top {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
  }
  .cert-hero__actions {
    grid-column: 1 / -1;
    align-items: stretch;
  }
}

@media (max-width: 600px) {
  .cert-hero {
    padding: 20px;
  }
  .cert-hero__top {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .cert-hero__avatar {
    margin: 0 auto;
  }
  .cert-hero__ids {
    justify-content: center;
  }
}

.cert-hero__avatar {
  width: 88px;
  height: 88px;
  border-radius: 14px;
  flex-shrink: 0;
}

.cert-hero__avatar svg {
  width: 60%;
  height: 60%;
}

.cert-hero__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cert-hero__info {
  min-width: 0;
}

.cert-hero__badge {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 5px 12px;
  font-size: 0.78rem;
}

.cert-hero__name-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  min-width: 0;
}

.cert-hero__name {
  font-family: var(--font-heading);
  font-size: 1.55rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.cert-hero__gender-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cert-hero__gender-icon svg {
  width: 14px;
  height: 14px;
}

.cert-hero__gender-icon--male {
  background: rgba(14, 165, 233, 0.2);
  border: 1px solid rgba(14, 165, 233, 0.4);
  color: #38bdf8;
}

.cert-hero__gender-icon--female {
  background: rgba(236, 72, 153, 0.2);
  border: 1px solid rgba(236, 72, 153, 0.4);
  color: #f472b6;
}

.cert-hero__course {
  font-size: 0.9rem;
  color: #a78bfa;
  margin: 0 0 12px;
  font-weight: 500;
}

.cert-hero__ids {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cert-hero__pill {
  display: inline-block;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  font-size: 0.75rem;
  color: rgb(255, 255, 255);
  font-family: monospace;
  letter-spacing: 0.02em;
}

.cert-hero__pill--green {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.25);
  color: #6ee7b7;
  font-family: var(--font-body);
  letter-spacing: 0;
}

.cert-hero__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
  flex-shrink: 0;
}

.cert-hero__download-btn {
  background: transparent;
  border-color: rgba(167, 139, 250, 0.4);
  color: #a78bfa;
  width: 100%;
}

.cert-hero__download-btn:hover {
  background: rgba(167, 139, 250, 0.1);
  border-color: #a78bfa;
}

.cert-hero__actions .cert-timestamp {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.35);
  margin: 0;
  text-align: right;
}

/* ---- Divider ---- */
.cert-hero__divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(167, 139, 250, 0.25), transparent);
  margin: 24px 0;
  position: relative;
  z-index: 1;
}

/* ---- Details grid ---- */
.cert-hero__details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  position: relative;
  z-index: 1;
}

@media (max-width: 760px) {
  .cert-hero__details {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

.cert-hero__details-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cert-hero__details-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #a78bfa;
}

.cert-hero__details-title svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.cert-hero__fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 20px;
}

.cert-hero__field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cert-hero__field--full {
  grid-column: 1 / -1;
}

.cert-hero__field-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.38);
}

.cert-hero__field-value {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
  line-height: 1.4;
}

.cert-hero__field-mono {
  font-family: monospace;
  font-size: 0.83rem;
  letter-spacing: 0.04em;
}

/* ============================================
   Inline SVG Certificate Preview
   ============================================ */

.cert-svg-wrapper {
  width: 100%;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 24px 64px rgba(15, 10, 30, 0.25), 0 4px 16px rgba(0, 0, 0, 0.1);
  margin-bottom: 32px;
  border: 1px solid var(--c-border);
  background: #faf8e6;
}

.cert-svg-document {
  width: 3095.18px;
  height: 2171.24px;
  position: relative;
  overflow: hidden;
  transform-origin: top left;
  background: #faf8e6;
}

.cert-svg-template {
  display: block;
  width: 3095.18px;
  height: 2171.24px;
}

.cert-svg-error {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font: 700 48px var(--font-body);
  color: #ef4444;
  background: #fff5f5;
}

/* ============================================
   Button Loading Spinner
   ============================================ */

.btn-spinner {
  width: 16px;
  height: 16px;
  animation: btn-spin 0.75s linear infinite;
  flex-shrink: 0;
}

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

/* ============================================
   Print Styles — Certificate Download
   ============================================ */

@media print {
  @page { size: A4 landscape; margin: 0; }

  html.cert-print-mode body > *,
  html.cert-print-mode .verify-page-hero,
  html.cert-print-mode .verify-content > .container > *:not(.cert-svg-wrapper),
  html.cert-print-mode .cert-hero,
  html.cert-print-mode .verify-again-section,
  html.cert-print-mode #site-header,
  html.cert-print-mode #site-footer,
  html.cert-print-mode #mobile-menu-slot {
    display: none !important;
  }

  html.cert-print-mode .verify-content,
  html.cert-print-mode .cert-svg-wrapper {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
  }

  html.cert-print-mode .cert-svg-document {
    width: 297mm !important;
    height: 210mm !important;
    transform: none !important;
  }
}
