/* ==================== Reset & base ==================== */
* { box-sizing: border-box; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  background: #0f1729;
  background-image: linear-gradient(180deg, #0f1729 0%, #1a2942 400px, #0f1729 100%);
  background-attachment: fixed;
  color: #e2e8f0;
  line-height: 1.5;
  min-height: 100vh;
}

/* ==================== Header (sticky) ==================== */
header {
  padding: 20px 24px;
  border-bottom: 1px solid #1e2d44;
  background: #0f1729;
  position: sticky;
  top: 0;
  z-index: 50;
  transition: padding .2s, box-shadow .2s;
}
header.scrolled {
  padding: 10px 24px;
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
header .logo {
  height: 36px;
  flex-shrink: 0;
  transition: height .2s;
}
header.scrolled .logo { height: 28px; }
.brand {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.2px;
  transition: font-size .2s;
}
header.scrolled .brand { font-size: 16px; }
.brand span {
  font-weight: 500;
  color: #e2e8f0;
}

/* ==================== Main container ==================== */
main {
  max-width: 780px;
  margin: 60px auto 80px;
  padding: 0 24px;
}

/* ==================== Sticky wrapper (searchbar + validity) ==================== */
.search-sticky {
  position: sticky;
  top: 56px;                    /* tinggi header awal */
  z-index: 40;
  background: #0f1729;
  padding: 16px 0 12px;
  margin: 0 -24px;
  padding-left: 24px;
  padding-right: 24px;
  transition: top .2s, box-shadow .2s;
}
.search-sticky.scrolled {
  top: 48px;                    /* tinggi header pas mengecil */
  box-shadow: 0 8px 16px rgba(0,0,0,.4);
}

/* ==================== Searchbar ==================== */
.searchbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}
.input-wrap {
  position: relative;
  width: 100%;
  max-width: 420px;
}
.input-wrap input {
  width: 100%;
  height: 44px;
  padding: 0 16px;
  font-size: 14px;
  background: #fff;
  color: #1a2942;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  text-align: center;
}
.input-wrap input:focus {
  border-color: #29b6f6;
  box-shadow: 0 0 0 3px rgba(41,182,246,.25);
}
.input-wrap input::placeholder {
  color: #94a3b8;
  opacity: 1;
}

/* ==================== Buttons ==================== */
button {
  background: #29b6f6;
  color: #0f1729;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 15px;
  font-family: inherit;
  font-weight: 600;
  transition: background .15s, transform .1s;
  white-space: nowrap;
  height: 44px;
  padding: 0 32px;
}
button:hover { background: #4fc3f7; }
button:active { transform: scale(.98); }
button:disabled { opacity: .5; cursor: not-allowed; }

.searchbar button {
  width: 100%;
  max-width: 420px;
}

/* ==================== Suggestions ==================== */
.suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #1e2d44;
  border: 1px solid #2d3e5a;
  border-radius: 6px;
  max-height: 260px;
  overflow-y: auto;
  z-index: 100;
  display: none;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  text-align: left;
}
.suggestions.show { display: block; }
.suggestions .item {
  padding: 10px 16px;
  cursor: pointer;
  font-size: 14px;
  color: #cbd5e1;
  border-bottom: 1px solid #2d3e5a;
}
.suggestions .item:last-child { border-bottom: none; }
.suggestions .item:hover,
.suggestions .item.active {
  background: #2d3e5a;
  color: #fff;
}
.suggestions .item b {
  color: #29b6f6;
  font-weight: 700;
}

/* ==================== Validity ==================== */
.validity {
  font-size: 13px;
  margin-top: 8px;
  min-height: 18px;
  text-align: center;
}
.validity.ok { color: #4ade80; }
.validity.err { color: #f87171; }

/* ==================== Info card ==================== */
.info-card {
  background: #1e2d44;
  border: 1px solid #2d3e5a;
  border-radius: 8px;
  margin-bottom: 16px;
  overflow: hidden;
  margin-top: 24px;
}
.info-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid #2d3e5a;
}
.info-card-icon { font-size: 18px; line-height: 1; }
.info-card-header h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
}
.info-card-body { padding: 0; }
.info-row {
  display: flex;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid #2d3e5a;
  font-size: 14px;
}
.info-row:last-child { border-bottom: none; }
.info-label {
  width: 180px;
  flex-shrink: 0;
  color: #94a3b8;
  font-weight: 600;
}
.info-value {
  flex: 1;
  color: #e2e8f0;
  word-break: break-word;
  text-align: right;
}

/* Expiry colors */
.info-value.expiry-ok   { color: #4ade80; font-weight: 600; }
.info-value.expiry-soon { color: #fbbf24; font-weight: 600; }
.info-value.expiry-warn { color: #fb923c; font-weight: 600; }
.info-value.expiry-dead { color: #f87171; font-weight: 700; }

/* ==================== Pre (raw whois) ==================== */
details {
  margin-top: 24px;
  background: #1e2d44;
  border: 1px solid #2d3e5a;
  border-radius: 8px;
  overflow: hidden;
}
details summary {
  cursor: pointer;
  padding: 14px 20px;
  font-weight: 600;
  color: #29b6f6;
  user-select: none;
  font-size: 14px;
}
details summary:hover { background: #2d3e5a; }
pre {
  background: #0f1729;
  color: #cbd5e1;
  padding: 16px 20px;
  overflow-x: auto;
  font-size: 12px;
  line-height: 1.6;
  max-height: 500px;
  margin: 0;
  border-top: 1px solid #2d3e5a;
}

/* ==================== Loading & error ==================== */
.loading {
  color: #29b6f6;
  padding: 20px 0;
  text-align: center;
}
.error {
  color: #f87171;
  padding: 20px 0;
  text-align: center;
}

/* ==================== Responsive ==================== */
@media (max-width: 600px) {
  main { padding: 0 16px; margin: 40px auto 60px; }

  header { padding: 14px 16px; }
  header.scrolled { padding: 8px 16px; }
  .brand { font-size: 15px; }
  header .logo { height: 28px; }
  header.scrolled .logo { height: 24px; }
  header.scrolled .brand { font-size: 14px; }
  header.scrolled .brand span { display: none; }

  /* Sticky override untuk mobile */
  .search-sticky {
    top: 52px;
    margin: 0 -16px;
    padding-left: 16px;
    padding-right: 16px;
    padding-top: 12px;
    padding-bottom: 10px;
  }
  .search-sticky.scrolled {
    top: 44px;
  }

  .info-row {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 16px;
  }
  .info-label {
    width: 100%;
    margin-bottom: 4px;
    font-size: 12px;
  }
  .info-value {
    text-align: left;
  }
}