/* Client WHOIS Lookup - client area styles
 * Author: Daksh B
 * Primary color is injected from the module settings through CSS variables.
 */

.cw {
  --cw-primary: #674cc7;
  --cw-primary-dark: #513a9f;
  --cw-primary-soft: #f1eefb;
  --cw-text: #1f2437;
  --cw-muted: #6b7185;
  --cw-border: #e4e6ef;
  --cw-green: #12805c;
  --cw-green-soft: #e4f6ee;
  --cw-amber: #a15c07;
  --cw-amber-soft: #fff4de;
  --cw-red: #c0362c;
  --cw-red-soft: #fdeceb;

  max-width: 1040px;
  margin: 0 auto;
  padding: 8px 0 32px;
  color: var(--cw-text);
  font-size: 14px;
  line-height: 1.55;
}

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

/* ---------------- Hero ---------------- */
.cw-hero {
  background: linear-gradient(135deg, var(--cw-primary-dark) 0%, var(--cw-primary) 100%);
  border-radius: 16px;
  padding: 46px 28px 50px;
  text-align: center;
  color: #fff;
  box-shadow: 0 14px 34px -14px var(--cw-primary);
}

.cw-hero-inner { max-width: 720px; margin: 0 auto; }

.cw-eyebrow {
  display: inline-block;
  background: rgba(255, 255, 255, .16);
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .8px;
  text-transform: uppercase;
}

.cw-title {
  margin: 14px 0 8px;
  font-size: 36px;
  line-height: 1.15;
  font-weight: 800;
  color: #fff;
}

.cw-sub {
  margin: 0 auto 26px;
  max-width: 540px;
  font-size: 16px;
  opacity: .92;
}

.cw-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border-radius: 12px;
  padding: 7px 7px 7px 16px;
  box-shadow: 0 10px 28px rgba(20, 10, 60, .28);
}

.cw-search-icon { flex: none; color: var(--cw-primary); }

.cw-input {
  flex: 1;
  min-width: 0;
  border: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  font-size: 17px;
  color: var(--cw-text);
  padding: 10px 6px;
}

.cw-input::placeholder { color: #9aa0b4; }

/* ---------------- Buttons ---------------- */
.cw-btn,
.cw-btn:link,
.cw-btn:visited {
  display: inline-block;
  border: 0;
  border-radius: 9px;
  background: var(--cw-primary);
  color: #fff;
  padding: 11px 22px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s ease, transform .05s ease;
}

.cw-btn:hover { background: var(--cw-primary-dark); color: #fff; text-decoration: none; }
.cw-btn:active { transform: translateY(1px); }
.cw-btn-search { padding: 13px 26px; white-space: nowrap; }

/* ---------------- Results ---------------- */
.cw-results { margin-top: 24px; }

.cw-card {
  background: #fff;
  border: 1px solid var(--cw-border);
  border-radius: 14px;
  padding: 22px 24px;
  margin-bottom: 20px;
  box-shadow: 0 1px 2px rgba(31, 36, 55, .04);
}

.cw-card-title {
  margin: 0 0 14px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--cw-primary-soft);
  font-size: 16px;
  font-weight: 700;
  color: var(--cw-text);
}

.cw-card-title::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 15px;
  margin-right: 10px;
  border-radius: 2px;
  background: var(--cw-primary);
  vertical-align: -2px;
}

/* Domain header */
.cw-domain-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  border-left: 5px solid var(--cw-primary);
}

.cw-domain-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .7px;
  text-transform: uppercase;
  color: var(--cw-muted);
}

.cw-domain-name {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.2;
  word-break: break-all;
  color: var(--cw-text);
}

.cw-domain-side { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.cw-badge {
  display: inline-block;
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 700;
}

.cw-badge-registered { background: var(--cw-primary-soft); color: var(--cw-primary-dark); }
.cw-badge-available  { background: var(--cw-green-soft); color: var(--cw-green); }
.cw-badge-unknown    { background: #eceef4; color: var(--cw-muted); }

/* Stat tiles */
.cw-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.cw-stat {
  background: var(--cw-primary-soft);
  border-radius: 14px;
  padding: 18px 22px;
}

.cw-stat-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .7px;
  text-transform: uppercase;
  color: var(--cw-primary-dark);
}

.cw-stat-value { margin-top: 4px; font-size: 22px; font-weight: 800; color: var(--cw-text); }
.cw-stat-sub { margin-top: 2px; font-size: 13px; color: var(--cw-muted); }
.cw-exp-soon { color: var(--cw-amber); font-weight: 600; }
.cw-exp-expired { color: var(--cw-red); font-weight: 600; }

.cw-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.cw-grid .cw-card { margin-bottom: 20px; }

/* Tables */
.cw-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
}

.cw-table th,
.cw-table td {
  padding: 11px 4px;
  border-bottom: 1px solid #eef0f6;
  text-align: left;
  vertical-align: top;
  background: transparent;
}

.cw-table tr:last-child th,
.cw-table tr:last-child td { border-bottom: 0; }

.cw-table th {
  width: 36%;
  padding-right: 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--cw-muted);
}

.cw-table td {
  font-weight: 600;
  color: var(--cw-text);
  word-break: break-word;
}

.cw-table a { color: var(--cw-primary); font-weight: 600; }
.cw-table-compact th, .cw-table-compact td { padding: 8px 4px; font-size: 13px; }

/* Status chips */
.cw-chips { display: flex; flex-wrap: wrap; gap: 6px; }

.cw-chip {
  display: inline-block;
  border-radius: 6px;
  background: var(--cw-primary-soft);
  color: var(--cw-primary-dark);
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: help;
}

/* Name servers */
.cw-ns {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}

.cw-ns li {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--cw-border);
  border-radius: 10px;
  padding: 10px 14px;
  background: #fbfbfe;
}

.cw-ns-num {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--cw-primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  line-height: 24px;
}

.cw-ns-host {
  font-family: Consolas, Menlo, "Courier New", monospace;
  font-size: 13px;
  font-weight: 600;
  word-break: break-all;
}

/* Contacts */
.cw-contacts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.cw-contact {
  border: 1px solid var(--cw-border);
  border-radius: 12px;
  padding: 14px 18px;
  background: #fbfbfe;
}

.cw-contact-title {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--cw-primary-dark);
}

.cw-note {
  background: var(--cw-amber-soft);
  color: var(--cw-amber);
  border-radius: 8px;
  padding: 9px 14px;
  margin-bottom: 16px;
  font-size: 13px;
}

/* Available */
.cw-available { text-align: center; padding: 38px 24px; }
.cw-available h3 { margin: 12px 0 6px; font-size: 22px; font-weight: 800; }
.cw-available p { margin: 0 0 18px; color: var(--cw-muted); }

.cw-available-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto;
  border-radius: 50%;
  background: var(--cw-green-soft);
  color: var(--cw-green);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Raw data */
.cw-raw { padding: 0; overflow: hidden; }

.cw-raw summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.cw-raw summary::-webkit-details-marker { display: none; }

.cw-raw summary::after {
  content: "\25BE";
  margin-left: 12px;
  color: var(--cw-primary);
  transition: transform .15s ease;
}

.cw-raw[open] summary::after { transform: rotate(180deg); }
.cw-raw summary span { flex: 1; }

.cw-copy {
  border: 1px solid var(--cw-primary);
  background: #fff;
  color: var(--cw-primary);
  border-radius: 7px;
  padding: 4px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.cw-copy:hover { background: var(--cw-primary-soft); }

.cw-pre {
  margin: 0;
  max-height: 460px;
  overflow: auto;
  background: #16132b;
  color: #ece9fb;
  border: 0;
  border-radius: 0;
  padding: 18px 24px;
  font-size: 12.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Alerts */
.cw-alert {
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 20px;
  border: 1px solid transparent;
}

.cw-alert-error { background: var(--cw-red-soft); color: var(--cw-red); border-color: #f4c9c5; }
.cw-alert-warn  { background: var(--cw-amber-soft); color: var(--cw-amber); border-color: #f2dcaa; }

.cw-disclaimer {
  margin: 4px 4px 0;
  font-size: 12px;
  color: var(--cw-muted);
  text-align: center;
}

/* ---------------- Responsive ---------------- */
@media (max-width: 767px) {
  .cw-hero { padding: 34px 18px 38px; border-radius: 14px; }
  .cw-title { font-size: 28px; }
  .cw-search-box { flex-wrap: wrap; padding: 10px; }
  .cw-search-icon { display: none; }
  .cw-input { flex: 1 1 100%; padding: 8px 6px; }
  .cw-btn-search { width: 100%; }
  .cw-stats { grid-template-columns: 1fr; }
  .cw-grid { grid-template-columns: 1fr; gap: 0; }
  .cw-card { padding: 18px; }
  .cw-domain-name { font-size: 22px; }
  .cw-table th { width: 42%; }
}
