/* ================================================================
   TLDHub – shared stylesheet
   Covers: CSS variables, nav, hero, tables, promo tooltips, footer
   ================================================================ */

/* ── Variables ── */
:root {
    --brand:     #1a6fc4;
    --brand-dk:  #0f4e8f;
    --brand-lt:  #e8f2fd;
    --accent:    #e85d04;
    --text:      #222;
    --muted:     #6c757d;
    --border:    #dee2e6;
    --row-hover: #f0f7ff;
}

* { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    color: var(--text);
    background: #f8f9fa;
}

/* ── Layout ── */
.page-wrap { max-width: 700px; margin: 0 auto; padding: 0 16px; }

/* ── Nav ── */
.site-nav { background: var(--brand); padding: 0; }
.site-nav .page-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 44px;
}
.site-logo {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    letter-spacing: -0.5px;
}
.site-logo span { color: #7ec8ff; }
.site-nav-links a {
    color: rgba(255,255,255,.85);
    text-decoration: none;
    font-size: 13px;
    margin-left: 18px;
    transition: color .15s;
}
.site-nav-links a:hover { color: #fff; }

/* ── Hero (base) ── */
.hero {
    background: linear-gradient(135deg, var(--brand-dk) 0%, var(--brand) 100%);
    color: #fff;
    padding: 24px 0 20px;
    border-bottom: 3px solid rgba(255,255,255,.15);
}
.hero h1 { font-size: 20px; font-weight: 700; margin: 0 0 6px; line-height: 1.3; }
.hero p  { font-size: 13px; opacity: .8; margin: 0; }
.hero .badge-updated {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 12px;
    margin-top: 8px;
}
.hero .dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #4ade80;
    display: inline-block;
}

/* TLD detail page hero overrides */
.hero .tld-label { font-size: 32px; font-weight: 900; letter-spacing: -1px; }
.hero .tld-label + h1 { font-size: 15px; font-weight: 500; margin: 4px 0 0; opacity: .9; }

/* ── Cards ── */
.table-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.summary-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.summary-card .price-big  { font-size: 24px; font-weight: 800; color: #1a7a3a; }
.summary-card .label {
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--muted);
    letter-spacing: .06em;
}

/* ── Stats bar (home) ── */
.stats-bar {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 13px;
    margin: 20px 0;
}
.stats-bar .stat-item  { text-align: center; }
.stats-bar .stat-num   { font-size: 20px; font-weight: 700; color: var(--brand); display: block; }
.stats-bar .stat-label { color: var(--muted); font-size: 11px; }

/* ── Section heading ── */
.section-head {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
    padding: 0 0 6px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
}

/* ── Price tables ── */
.price-table { width: 100%; border-collapse: collapse; background: #fff; }
.price-table thead th {
    background: #f3f7fb;
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: 8px 12px;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}
.price-table thead th:hover { background: var(--brand-lt); color: var(--brand); }
.price-table thead th .sort-icon { margin-left: 4px; opacity: .4; font-size: 10px; }
.price-table thead th .sort-icon::after { content: ' ⇅'; }
.price-table thead th.sort-asc  .sort-icon::after { content: ' ▲'; opacity: 1; }
.price-table thead th.sort-desc .sort-icon::after { content: ' ▼'; opacity: 1; }
.price-table tbody tr { border-bottom: 1px solid #f0f0f0; transition: background .1s; }
.price-table tbody tr:hover { background: var(--row-hover); }
.price-table td { padding: 9px 12px; vertical-align: middle; }

/* Price variants */
.price-best { font-weight: 700; font-size: 15px; color: #1a7a3a; white-space: nowrap; }
.price-reg  { font-weight: 700; color: #1a7a3a; font-size: 15px; }
.price-ren  { font-weight: 500; color: #1565c0; }
.price-tra  { font-weight: 500; color: #6a1b9a; }
.price-na   { color: #bbb; font-size: 13px; }

/* TLD badge */
.tld-badge { display: inline-block; font-weight: 700; font-size: 15px; color: var(--brand-dk); min-width: 62px; }
.tld-badge a, .tld-link { color: inherit; text-decoration: none; }
.tld-badge a:hover, .tld-link:hover { color: var(--brand); text-decoration: underline; }
.tld-link { font-weight: 700; font-size: 15px; color: var(--brand-dk); }

/* Rank column */
.rank-num { color: var(--muted); font-size: 12px; font-weight: 600; width: 36px; text-align: center; }

/* Registrar link */
.registrar-link { color: var(--brand); text-decoration: none; font-size: 13px; font-weight: 500; }
.registrar-link:hover { text-decoration: underline; }

/* Expand button */
.expand-btn {
    background: none; border: none; cursor: pointer;
    padding: 0; color: var(--brand); font-size: 18px; line-height: 1;
}
.expand-btn:hover { color: var(--brand-dk); }

/* Detail sub-table */
.tld-detail-row { display: none; background: #fafcff; }
.tld-detail-row.open { display: table-row; }
.tld-detail-inner { padding: 12px 16px; }
.detail-table { width: 100%; font-size: 13px; }
.detail-table th {
    font-size: 11px; color: var(--muted); text-transform: uppercase;
    font-weight: 700; padding: 4px 8px;
    background: #f5f8fc; border-bottom: 1px solid var(--border);
}
.detail-table td { padding: 5px 8px; border-bottom: 1px solid #f0f0f0; }
.detail-table tr:last-child td { border-bottom: none; }

/* Promo (legacy) tags */
.promo-tag { display: inline-block; background: #fff3e0; color: #e65100; border: 1px solid #ffcc80; border-radius: 3px; font-size: 10px; font-weight: 700; padding: 1px 5px; margin-left: 4px; letter-spacing: .03em; text-transform: uppercase; vertical-align: middle; }
.new-tag   { background: #e8f5e9; color: #2e7d32; border-color: #a5d6a7; }

/* Search inputs */
#tldFilter, #tldSearch, #regFilter {
    font-size: 13px;
    border-color: var(--border);
    max-width: 200px;
}
#tldFilter:focus, #tldSearch:focus, #regFilter:focus {
    border-color: var(--brand);
    box-shadow: none;
}
#tldSearch { max-width: 220px; }

/* ── Promo tooltip ── */
.promo-info-wrap {
    display: inline-flex;
    align-items: center;
    position: relative;
    vertical-align: middle;
    gap: 4px;
    cursor: pointer;
    border-radius: 3px;
    transition: background .12s;
}
.promo-info-wrap:hover {
    background: rgba(26, 111, 196, 0.07);
}
.promo-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: #b8c0cc;
    color: #fff;
    font-size: 9px;
    font-style: normal;
    font-weight: 900;
    cursor: pointer;
    user-select: none;
    transition: background .15s;
    vertical-align: middle;
    flex-shrink: 0;
}
.promo-info-icon::before { content: 'i'; font-family: -apple-system, sans-serif; }
.promo-info-icon:hover,
.promo-info-icon:focus   { background: #8a95a3; outline: none; }

.promo-tooltip {
    display: none;
    position: fixed;
    min-width: 210px; max-width: 280px;
    background: #f2f4f7;
    color: #2a3040;
    border: 1px solid #cdd3db;
    border-radius: 7px;
    padding: 9px 11px 8px;
    box-shadow: 0 6px 20px rgba(0,0,0,.14);
    font-size: 12px;
    line-height: 1.45;
    z-index: 9999;
    white-space: nowrap;
}
.promo-tooltip.tip-open {
    display: block;
    pointer-events: auto;
    animation: tipFadeIn .12s ease;
}
@keyframes tipFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Arrow */
.pt-arrow {
    position: absolute;
    left: 50%; transform: translateX(-50%);
    width: 0; height: 0;
}
.pt-arrow.arr-up {
    top: -7px;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 7px solid #cdd3db;
}
.pt-arrow.arr-up::after {
    content: '';
    position: absolute;
    top: 2px; left: -5px;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 5px solid #f2f4f7;
}
.pt-arrow.arr-down {
    bottom: -7px;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 7px solid #cdd3db;
}
.pt-arrow.arr-down::after {
    content: '';
    position: absolute;
    bottom: 2px; left: -5px;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #f2f4f7;
}

/* Tooltip rows */
.pt-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 0;
    border-bottom: 1px solid rgba(0,0,0,.07);
    flex-wrap: wrap;
}
.pt-row:last-child { border-bottom: none; }
.pt-price  { font-weight: 700; color: #1a7a3a; min-width: 50px; }
.pt-code {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    background: #fff;
    border: 1px dashed #aab4c0;
    border-radius: 3px;
    padding: 1px 7px;
    color: #445;
    cursor: pointer;
    transition: background .1s;
}
.pt-code:hover { background: #deeaff; }
.pt-copy-btn {
    font-size: 10px;
    font-family: inherit;
    background: #e2e6ec;
    border-radius: 2px;
    padding: 0 4px;
    color: #667;
    transition: background .1s, color .1s;
}
.pt-code:hover .pt-copy-btn { background: var(--brand); color: #fff; }
.pt-copied { color: #1a7a3a !important; }
.pt-auto   { font-size: 11px; color: #778899; font-style: italic; }
.pt-limit  { font-size: 10px; color: #9aa; white-space: nowrap; }
.pt-new    { font-size: 10px; background: #d4edda; color: #155724; border-radius: 3px; padding: 0 4px; }

/* ── Footer ── */
footer {
    background: #fff;
    border-top: 1px solid var(--border);
    padding: 20px 0;
    font-size: 12px;
    color: var(--muted);
    text-align: center;
}
footer a { color: var(--muted); text-decoration: underline; }

/* ── Responsive ── */
@media (max-width: 576px) {
    .hero h1          { font-size: 17px; }
    .tld-badge        { font-size: 13px; min-width: 50px; }
    .price-best       { font-size: 14px; }
    .col-hide-sm      { display: none; }
}
