/* JPN Modern Official Theme Stylesheet */

:root {
  --jpn-gold: #dfa539;
  --jpn-gold-deep: #c98e27;
  --jpn-accent: #d98a1a;
  --jpn-dark: #1a1a1a;
  --jpn-border: #222222;
  --jpn-box-bg: #ffffff;
  --font-main: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-heading: "Montserrat", "IBM Plex Sans", sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
}

/* -----------------------------
   HOME & PUBLIC SHARED
   ----------------------------- */
body.jpn-theme-page {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: var(--font-main);
  color: var(--jpn-dark);
  display: flex;
  flex-direction: column;
  position: relative;
  background-color: var(--jpn-gold);
}

body.jpn-theme-page::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 25%, rgba(255, 255, 255, 0.22) 0%, rgba(0, 0, 0, 0.12) 100%);
  pointer-events: none;
  z-index: 1;
}

.jpn-public-header {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 20px 32px;
}

.admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.92);
  color: #1a1a1a;
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 4px 14px rgba(0,0,0,0.1);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.admin-badge:hover {
  background: #ffffff;
  color: #000000;
  box-shadow: 0 8px 22px rgba(0,0,0,0.18);
  transform: translateY(-2px);
}

.jpn-main-container {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 10px 20px 48px;
}

.jpn-alert {
  width: min(720px, 100%);
  padding: 14px 20px;
  border-radius: 12px;
  font-weight: 600;
  margin-bottom: 24px;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.jpn-alert-error {
  background: #fee4e2;
  color: #b42318;
  border: 1px solid #fecdca;
}

.jpn-alert-success {
  background: #dcfae6;
  color: #067647;
  border: 1px solid #abefc6;
}

/* -----------------------------
   HOME SEARCH CARD REDESIGN
   ----------------------------- */
.jpn-search-wrapper {
  width: min(820px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin: auto 0;
}

.jpn-brand-header {
  margin-bottom: 30px;
}

.jpn-emblem-wrap {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 18px;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,0.12));
}

.jpn-emblem-img {
  max-height: 130px;
  max-width: 85vw;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.jpn-main-title {
  font-family: var(--font-heading);
  font-size: clamp(1.85rem, 4vw, 2.7rem);
  font-weight: 900;
  color: #111111;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
  text-shadow: 0 1px 2px rgba(255,255,255,0.4);
}

.jpn-subtitle {
  font-size: clamp(0.95rem, 1.8vw, 1.15rem);
  color: #382c16;
  font-weight: 600;
  margin: 0;
  letter-spacing: 0.01em;
}

.jpn-search-card {
  width: min(680px, 100%);
  position: relative;
  background: rgba(255, 255, 255, 0.96);
  padding: 32px 36px 28px;
  border-radius: 24px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(255, 255, 255, 0.9) inset;
  backdrop-filter: blur(20px);
}

.search-input-group {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 2.5px solid #1a1a1a;
  border-radius: 14px;
  padding: 6px 6px 6px 16px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.06);
  transition: all 0.2s ease;
}

.search-input-group:focus-within {
  border-color: #000000;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15), 0 0 0 3px rgba(217, 138, 26, 0.35);
}

.search-input-icon {
  display: flex;
  align-items: center;
  color: #666666;
  margin-right: 12px;
}

.jpn-search-input {
  flex: 1;
  border: 0;
  outline: 0;
  font-size: 1.15rem;
  font-weight: 700;
  font-family: var(--font-main);
  color: #111111;
  padding: 10px 4px;
  letter-spacing: 0.03em;
  background: transparent;
}

.jpn-search-input::placeholder {
  font-weight: 500;
  color: #888888;
  letter-spacing: normal;
  font-size: 0.96rem;
}

.jpn-search-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #111111;
  color: #ffffff;
  border: 0;
  padding: 12px 26px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font-main);
  cursor: pointer;
  transition: all 0.2s ease;
}

.jpn-search-btn:hover {
  background: #000000;
  color: #f7ce68;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.25);
}

.search-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.85rem;
  color: #555555;
  margin-top: 18px;
  line-height: 1.4;
}

.search-hint code {
  background: #f1f3f5;
  border: 1px solid #e2e8f0;
  padding: 2px 7px;
  border-radius: 6px;
  font-weight: 700;
  color: #111;
}

/* -----------------------------
   RESULT FULL PAGE REPLICA
   100% Full-bleed matching PDF sample
   Strict Full Height - Exact 1:1 Layout
   ----------------------------- */
body.jpn-result-fullscreen {
  margin: 0;
  padding: 0;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  font-family: Arial, Helvetica, sans-serif;
  color: #000000;
  background-color: #DDB448;
}

/* Remove radial glow overlay in result page so background is 100% clean flat matching sample */
body.jpn-result-fullscreen::before {
  display: none !important;
}

.jpn-fullscreen-card {
  width: 100%;
  height: 100vh;
  max-height: 100vh;
  padding: 2.2vh 4.5vw 1.2vh 4.5vw;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  box-sizing: border-box;
  overflow: hidden;
}

.card-brand-header {
  text-align: center;
  margin-bottom: 2.2vh;
  flex-shrink: 0;
}

.card-emblem-wrap {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 0.8vh;
}

.card-emblem-img {
  height: 13.5vh;
  max-width: 90vw;
  object-fit: contain;
  filter: none !important;
  mix-blend-mode: normal !important;
}

.card-dept-title {
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(1.6rem, 2.7vw, 2.6rem);
  font-weight: 900;
  color: #000000;
  margin: 0;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.card-content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2vh 4.5vw;
  align-items: start;
  max-width: 1580px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
}

.field-column {
  display: flex;
  flex-direction: column;
  gap: 1.1vh;
}

.jpn-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  align-items: center;
  gap: 12px;
}

.field-tag {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.95rem;
  font-weight: 900;
  color: #000000;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.field-value {
  background: #ffffff;
  border: 2px solid #000000;
  border-radius: 0px;
  height: 4.6vh;
  min-height: 34px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  font-size: 1.05rem;
  font-weight: 700;
  font-family: Arial, Helvetica, sans-serif;
  color: #000000;
  word-break: break-word;
  box-shadow: none;
}

.bold-ic {
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.jpn-photo-row {
  align-items: start;
  margin-top: 0.2vh;
}

.photo-container-wrapper {
  display: flex;
}

.jpn-photo-frame {
  height: 25.5vh;
  aspect-ratio: 3 / 4;
  width: auto;
  border: 2px solid #000000;
  border-radius: 0px;
  background: #ffffff;
  overflow: hidden;
  box-shadow: none;
}

.jpn-photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-bottom-searchbar {
  position: fixed;
  bottom: 1.2vh;
  right: 4.5vw;
  margin-top: 0;
  z-index: 100;
}

.bottom-quick-search {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.bottom-quick-search input {
  width: 190px;
  border: 2px solid #000000;
  background: #ffffff;
  border-radius: 0px;
  padding: 0 10px;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 700;
  font-size: 0.98rem;
  outline: 0;
  height: 4.2vh;
  min-height: 32px;
}

.bottom-quick-search button {
  background: #ffffff;
  border: 2px solid #000000;
  color: #000000;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 0 18px;
  border-radius: 0px;
  cursor: pointer;
  transition: all 0.2s ease;
  height: 4.2vh;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.bottom-quick-search button:hover {
  background: #000000;
  color: #ffffff;
}

/* Responsive adjustments */
@media (max-width: 960px) {
  .card-content-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .jpn-row {
    grid-template-columns: 170px 1fr;
  }
  .bottom-quick-search {
    justify-content: flex-start;
  }
}

@media (max-width: 600px) {
  .jpn-fullscreen-card {
    padding: 16px;
  }
  .jpn-search-card {
    padding: 24px 18px 20px;
    border-radius: 20px;
  }
  .search-input-group {
    flex-direction: column;
    padding: 10px;
    border-radius: 12px;
    gap: 8px;
  }
  .search-input-icon {
    display: none;
  }
  .jpn-search-input {
    width: 100%;
    text-align: center;
  }
  .jpn-search-btn {
    width: 100%;
    justify-content: center;
  }
  .jpn-row {
    grid-template-columns: 1fr;
    gap: 5px;
  }
  .field-tag {
    font-size: 0.88rem;
  }
  .bottom-quick-search {
    width: 100%;
  }
  .bottom-quick-search input {
    flex: 1;
    width: auto;
  }
}


/* -----------------------------
   SEARCHING MODAL (5s EFFECT)
   ----------------------------- */
.searching-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.searching-overlay.active {
  opacity: 1;
  visibility: visible;
}

.searching-box {
  width: min(520px, calc(100% - 32px));
  background: #111827;
  border: 1px solid rgba(223, 165, 57, 0.4);
  border-radius: 24px;
  padding: 38px 32px;
  text-align: center;
  color: #ffffff;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 40px rgba(223, 165, 57, 0.15);
  animation: boxPop 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes boxPop {
  0% { transform: scale(0.92); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.searching-emblem-wrap {
  margin-bottom: 20px;
}
.searching-logo {
  max-height: 75px;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.5));
}

.radar-spinner-wrap {
  position: relative;
  width: 90px;
  height: 90px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.radar-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid transparent;
}

.radar-ring-1 {
  border-top-color: #dfa539;
  border-bottom-color: #dfa539;
  animation: radarSpin 1.8s linear infinite;
}

.radar-ring-2 {
  inset: 8px;
  border-left-color: #f7ce68;
  border-right-color: #f7ce68;
  animation: radarSpinReverse 1.2s linear infinite;
}

.radar-ring-3 {
  inset: 16px;
  border-top-color: rgba(255,255,255,0.4);
  animation: radarSpin 0.9s linear infinite;
}

.radar-core {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulseGlow 1.5s ease-in-out infinite alternate;
}

@keyframes radarSpin {
  100% { transform: rotate(360deg); }
}

@keyframes radarSpinReverse {
  100% { transform: rotate(-360deg); }
}

@keyframes pulseGlow {
  0% { transform: scale(0.88); opacity: 0.7; }
  100% { transform: scale(1.08); opacity: 1; }
}

.searching-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  letter-spacing: 0.14em;
  color: #dfa539;
  margin: 0 0 8px;
  font-weight: 800;
  text-transform: uppercase;
}

.searching-target {
  font-size: 0.95rem;
  color: #94a3b8;
  margin: 0 0 22px;
}
.searching-target span {
  color: #ffffff;
  font-weight: 700;
  background: rgba(255,255,255,0.1);
  padding: 3px 8px;
  border-radius: 5px;
  letter-spacing: 0.05em;
}

.searching-progress-track {
  width: 100%;
  height: 7px;
  background: rgba(255,255,255,0.1);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 16px;
}

.searching-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #d98a1a, #f7ce68, #ffffff);
  border-radius: 999px;
  transition: width 0.08s linear;
  box-shadow: 0 0 14px rgba(223, 165, 57, 0.8);
}

.searching-status-text {
  font-size: 0.86rem;
  color: #cbd5e1;
  min-height: 22px;
  line-height: 1.4;
  letter-spacing: 0.01em;
}

/* -----------------------------
   RESULT PAGE TYPEWRITER STYLING
   ----------------------------- */
.type-target {
  display: inline-block;
  min-height: 1em;
}

.type-target.typing-active::after {
  content: "|";
  display: inline-block;
  margin-left: 2px;
  color: #111111;
  font-weight: 900;
  animation: typingBlink 0.6s infinite;
}

@keyframes typingBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Photo scanning beam effect */
.jpn-photo-frame.photo-revealing {
  position: relative;
}

.jpn-photo-frame.photo-revealing img {
  opacity: 0.2;
  filter: blur(4px) grayscale(60%);
  transition: opacity 0.8s ease, filter 0.8s ease;
}

.jpn-photo-frame.loaded img {
  opacity: 1;
  filter: blur(0px) grayscale(0%);
}

.photo-scanner-beam {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, transparent, #dfa539, #ffffff, #dfa539, transparent);
  box-shadow: 0 0 12px #dfa539;
  opacity: 0.9;
  animation: scanDown 2s ease-in-out infinite;
  pointer-events: none;
}

.jpn-photo-frame.loaded .photo-scanner-beam {
  display: none;
}

@keyframes scanDown {
  0% { top: 0%; opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}


/* -----------------------------
   RESULT PAGE 5s PRELOADER
   ----------------------------- */
.result-preloader-screen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at 50% 40%, #172033 0%, #090d16 100%);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.result-preloader-screen.fade-out {
  opacity: 0;
  visibility: hidden;
}

.preloader-content-box {
  width: min(540px, calc(100% - 36px));
  background: rgba(17, 24, 39, 0.95);
  border: 1.5px solid rgba(223, 165, 57, 0.45);
  border-radius: 26px;
  padding: 40px 32px 34px;
  text-align: center;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.7), 0 0 40px rgba(223, 165, 57, 0.15);
  color: #ffffff;
}

.preloader-logo-wrap {
  margin-bottom: 22px;
}
.preloader-logo-img {
  max-height: 80px;
  max-width: 80%;
  object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,0.6));
}

.preloader-radar {
  position: relative;
  width: 96px;
  height: 96px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.radar-outer-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px dashed rgba(223, 165, 57, 0.7);
  animation: radarSpin 6s linear infinite;
}

.radar-middle-ring {
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: #f7ce68;
  border-bottom-color: #f7ce68;
  animation: radarSpinReverse 1.5s linear infinite;
}

.radar-inner-scanner {
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-left-color: #dfa539;
  animation: radarSpin 0.9s linear infinite;
}

.radar-center-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulseGlow 1.4s ease-in-out infinite alternate;
}

.preloader-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  letter-spacing: 0.16em;
  color: #dfa539;
  margin: 0 0 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.preloader-ic-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 22px;
}
.ic-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #94a3b8;
}
.ic-num {
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #f7ce68;
}

.preloader-progress-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 16px;
}

.preloader-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #d98a1a 0%, #f7ce68 60%, #ffffff 100%);
  border-radius: 999px;
  transition: width 0.08s linear;
  box-shadow: 0 0 16px rgba(223, 165, 57, 0.9);
}

.preloader-status-text {
  font-size: 0.88rem;
  color: #cbd5e1;
  min-height: 24px;
  line-height: 1.4;
  letter-spacing: 0.02em;
}

/* Initially hidden until preloader is done */
.result-initially-hidden {
  opacity: 0;
  transform: scale(0.99);
  pointer-events: none;
}

.result-shown {
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
