/* === FONT DEFINITIONS === */
/* InfinityC - for headers like KALI SILAT EVOLUTION, HEREBY AWARDS */
@font-face {
  font-family: 'InfinityCExtraBold';
  src: url('../fonts/InfinityFont/InfinityCExtraBold.ttf') format('truetype');
  font-weight: 800;
  font-style: normal;
}

/* InfinityT - for EDITION text */
@font-face {
  font-family: 'InfinityT';
  src: url('../fonts/InfinityFont/INFINTEB.TTF') format('truetype');
  font-weight: 800;
  font-style: normal;
}

/* InfinityST - legacy/fallback */
@font-face {
  font-family: 'Infinity';
  src: url('../fonts/InfinityFont/InfinitySTExtraBold.ttf') format('truetype');
  font-weight: 800;
  font-style: normal;
}

@font-face {
  font-family: 'Infinity';
  src: url('../fonts/InfinityFont/InfinitySTMedium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
}

@font-face {
  font-family: 'Globet';
  src: url('../fonts/Globet-Round-Family-commercial/Globet Extra Bold -commercial-/Globet-ExtraBold.ttf') format('truetype');
  font-weight: 800;
  font-style: normal;
}

@font-face {
  font-family: 'Globet';
  src: url('../fonts/Globet-Round-Family-commercial/Globet Bold -commercial-/Globet-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
}

@font-face {
  font-family: 'Globet';
  src: url('../fonts/Globet-Round-Family-commercial/Globet Regular -commercial-/Globet-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}

/* === BASE STYLES === */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Globet', Arial, sans-serif;
  background: #1a1a2e;
  color: #fff;
  min-height: 100vh;
}

/* === APP LAYOUT === */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* === FORM PANEL === */
.form-panel {
  width: 320px;
  padding: 24px;
  background: #16213e;
  overflow-y: auto;
  flex-shrink: 0;
}

.form-panel h1 {
  font-family: 'Globet', sans-serif;
  font-weight: 800;
  font-size: 1.8rem;
  margin-bottom: 4px;
}

.subtitle {
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: #ccc;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 10px 12px;
  font-size: 1rem;
  font-family: inherit;
  border: 2px solid #333;
  border-radius: 6px;
  background: #0f0f23;
  color: #fff;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #e31e24;
}

.form-group input::placeholder {
  color: #555;
}

.form-actions {
  margin-top: 24px;
}

.btn-primary {
  width: 100%;
  padding: 14px;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  background: #e31e24;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: #c41a1f;
}

.help-text {
  margin-top: 24px;
  padding: 16px;
  background: rgba(255,255,255,0.05);
  border-radius: 6px;
  font-size: 0.85rem;
  color: #888;
}

.help-text p {
  margin-bottom: 8px;
}

.help-text ul {
  padding-left: 20px;
}

.help-text li {
  margin-bottom: 4px;
}

/* === PREVIEW PANEL === */
.preview-panel {
  flex: 1;
  padding: 24px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow: auto;
  background: #2a2a4a;
}

/* === CERTIFICATE === */
.certificate {
  width: 297mm;
  height: 210mm;
  background: #fff;
  color: #000;
  position: relative;
  padding: 7.3mm 12.8mm 45mm 11mm;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  overflow: hidden;
}

/* Debug Overlay für Positionierung */
.certificate.debug-overlay::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('../reference-screenshot/student-test.png') center/100% 100% no-repeat;
  opacity: 0.4;
  pointer-events: none;
  z-index: 100;
}

/* Watermark */
.watermark {
  position: absolute;
  top: 39px;
  left: 84mm;
  right: 0;
  bottom: 2mm;
  width: auto;
  height: auto;
  background: url('../assets/watermark.svg') center/contain no-repeat;
  opacity: 1;
  pointer-events: none;
}

/* Header */
.cert-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 3mm;
}

.cert-title {
  flex: 1;
}

.org-name {
  font-family: 'InfinityCExtraBold', sans-serif;
  font-weight: normal;
  font-size: 39.685pt;
  letter-spacing: -0.039em;
  line-height: 1;
  transform: scaleX(1.2);
  transform-origin: left;
  -webkit-text-stroke: 2.835px #000;
  paint-order: stroke fill;
  margin-top: 23mm;
  position: relative;
  z-index: 10;
}

.awards-text {
  font-family: 'InfinityCExtraBold', sans-serif;
  font-weight: 800;
  font-size: 21pt;
  letter-spacing: 0.01em;
  margin-top: 0.1px;
  -webkit-text-stroke: 1.5px #000;
  paint-order: stroke fill;
  position: relative;
  z-index: 10;
}

.cert-logo {
  width: 312px;
  height: 136px;
  position: relative;
  z-index: 5;
}

.cert-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Student Name */
.student-name {
  font-family: 'Globet', sans-serif;
  font-weight: 800;
  font-size: 39.685pt;
  letter-spacing: 1.3px;
  margin: 0mm 0 0mm 6mm;
  text-transform: uppercase;
  color: transparent;
  -webkit-text-stroke: 3px #000;
  paint-order: stroke fill;
  transform: scaleX(1.2);
  transform-origin: left;
  position: relative;
  z-index: 10;
}

/* Rank Section */
.rank-section {
  margin: 6.3mm 0 0;
  line-height: 1;
  position: relative;
  z-index: 10;
}

.rank-label {
  font-family: 'InfinityCExtraBold', sans-serif;
  font-weight: 800;
  font-size: 24pt;
  background: #000;
  color: #fff;
  display: inline-block;
  padding: 1.4mm 2.2mm 1.8mm;
  margin-left: 0.12em;
  letter-spacing: 0;
  min-width: 69%;
}

.rank-value {
  font-family: 'Globet', sans-serif;
  font-weight: 800;
  font-size: 39.685pt;
  letter-spacing: 1.5px;
  margin: 5mm 0 0 6mm;
  text-transform: uppercase;
  color: transparent;
  -webkit-text-stroke: 3px #000;
  paint-order: stroke fill;
  transform: scaleX(1.2);
  transform-origin: left;
}

/* Art Description */
.art-description {
  margin: 4.9mm 0;
  font-family: 'InfinityCExtraBold', sans-serif;
  font-weight: 800;
  font-size: 21.4pt;
  letter-spacing: 0.001em;
  line-height: 1.2;
  position: relative;
  z-index: 10;
}

.art-description strong {
  font-weight: 800;
}

.highlight-e {
  color: #e31e24;
}

/* Footer */
.cert-footer {
  position: absolute;
  bottom: 7.6mm;
  left: 11.3mm;
  right: 11.5mm;
  padding: 19.7mm 0 0;
  margin: 0 0 0 6mm;
  letter-spacing: 0;
  z-index: 10;
}

.instructor-section {
  font-family: 'Globet', sans-serif;
  font-weight: 700;
  font-size: 12.8pt;
  letter-spacing: 0;
  line-height: 1.2;
  position: static;
  width: 48%;
  margin-top: 21.8mm;
  float: left;
  background: #000;
  color: #fff;
  padding: 2mm 3mm;
  display: inline-block;
}

.instructor-name {
  margin-bottom: 0;
  line-height: 1;
}

.cert-date {
  color: #333;
}

.founder-section {
  text-align: right;
  position: relative;
  display: block;
  float: right;
  width: 51.5%;
  padding: 22mm 0 5mm;
  letter-spacing: 0;
}

.signature {
  height: 100%;
  position: absolute;
  object-fit: unset;
  left: auto;
  right: 39mm;
  bottom: 0;
  top: 0;
}

.founder-name-row {
  display: block;
  margin: 0;
}

.founder-name {
  font-family: 'InfinityCExtraBold', sans-serif;
  font-weight: 800;
  font-size: 14.8pt;
  letter-spacing: 0.03em;
  margin-top: 111px;
}

.founder-title {
  font-family: 'InfinityCExtraBold', sans-serif;
  font-weight: 800;
  font-size: 14.1pt;
  letter-spacing: 0.03em;
  margin-top: 0;
  text-align: left;
  line-height: 1;
}

.edition-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
  margin-top: 0;
  line-height: 1;
  font-size: 11.3pt;
  font-family: 'InfinityCExtraBold', sans-serif;
  font-weight: normal;
}

.badge-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.badge-kse {
  width: 28px;
  height: 18px;
}

.edition-text {
  font-family: inherit;
  font-weight: 400;
  font-size: 10.9pt;
  letter-spacing: 0.05em;
  margin-left: 0;
}

/* === PRINT STYLES === */
@media print {
  @page {
    size: A4 landscape;
    margin: 0;
  }

  body {
    background: white;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .app-container {
    display: block;
  }

  .form-panel {
    display: none;
  }

  .preview-panel {
    padding: 0;
    background: white;
  }

  .certificate {
    width: 297mm;
    height: 210mm;
    box-shadow: none;
    margin: 0;
    padding: 10mm 15mm;
  }

  .watermark {
    opacity: 0.8;
  }

  .rank-label {
    background: #000 !important;
    color: #fff !important;
  }

  .highlight-e {
    color: #e31e24 !important;
  }

  /* Hide debug overlay and UI elements in print */
  .certificate.debug-overlay::before {
    display: none !important;
  }
  .privacy-notice {
    display: none !important;
  }
}

/* === NAV LINK === */
.nav-link {
  display: inline-block;
  color: #e31e24;
  text-decoration: none;
  font-size: 0.85rem;
  margin-bottom: 16px;
  padding: 6px 0;
  transition: color 0.2s;
}

.nav-link:hover {
  color: #fff;
}

/* === BLACK BELT VARIANT === */
.blackbelt-cert .rank-label {
  min-width: 78%;
}

.rank-degree {
  font-family: 'InfinityCExtraBold', sans-serif;
  font-weight: 800;
  font-size: 18pt;
  letter-spacing: 0.05em;
  margin: 1.5mm 0 0 6.5mm;
  color: #e31e24;
  text-transform: uppercase;
  position: relative;
  z-index: 10;
}

/* === PRIVACY NOTICE === */
.privacy-notice {
  margin-top: 16px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
  font-size: 0.7rem;
  color: #666;
  line-height: 1.4;
}

/* === RESPONSIVE === */
@media screen and (max-width: 1200px) {
  .certificate {
    transform: scale(0.7);
    transform-origin: top left;
  }
}

@media screen and (max-width: 900px) {
  .app-container {
    flex-direction: column;
  }

  .form-panel {
    width: 100%;
  }

  .preview-panel {
    padding: 16px;
  }

  .certificate {
    transform: scale(0.5);
    transform-origin: top center;
  }
}
