/* ── Variables ─────────────────────────────────────────────── */
:root {
    --yellow:      #FFC107;
    --yellow-dark: #E0A800;
    --yellow-pale: #FFF8E1;
    --blue:        #0D47A1;
    --blue-mid:    #1565C0;
    --blue-light:  #1976D2;
    --blue-pale:   #E3F2FD;
    --black:       #111827;
    --gray-900:    #1F2937;
    --gray-700:    #374151;
    --gray-500:    #6B7280;
    --gray-300:    #D1D5DB;
    --gray-100:    #F3F4F6;
    --white:       #FFFFFF;
    --danger:      #DC2626;

    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --radius-sm:  4px;
    --radius:     8px;
    --radius-lg:  12px;
    --shadow-sm:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --shadow:     0 4px 6px -1px rgba(0,0,0,.10), 0 2px 4px -1px rgba(0,0,0,.06);
    --shadow-lg:  0 10px 15px -3px rgba(0,0,0,.10), 0 4px 6px -2px rgba(0,0,0,.05);

    --ad-w:        160px;
    --content-max: 680px;
    --gap:         24px;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font);
    background: var(--gray-100);
    color: var(--black);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-size: 15px;
    line-height: 1.5;
}

a { color: var(--blue-light); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--blue); }

/* ── Header ────────────────────────────────────────────────── */
.site-header {
    background: var(--black);
    padding: 0 var(--gap);
    display: flex;
    align-items: center;
    height: 60px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,.35);
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header__logo {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--yellow);
}

.site-header__logo span { color: var(--white); font-weight: 400; }

.site-header__tagline {
    margin-left: 16px;
    font-size: 0.78rem;
    color: var(--gray-500);
    border-left: 1px solid var(--gray-700);
    padding-left: 16px;
}

/* ── Layout ────────────────────────────────────────────────── */
.site-body {
    display: flex;
    flex: 1;
    max-width: calc(var(--ad-w) * 2 + var(--content-max) + var(--gap) * 4);
    margin: 0 auto;
    width: 100%;
    padding: 32px var(--gap);
    gap: var(--gap);
    align-items: flex-start;
}

/* ── Ad Columns ────────────────────────────────────────────── */
.ad-col {
    width: var(--ad-w);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: var(--gap);
    position: sticky;
    top: 92px;
}

.ad-slot {
    background: var(--white);
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 250px;
    color: var(--gray-300);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-align: center;
    padding: 8px;
    line-height: 1.8;
}

.ad-slot--tall { min-height: 600px; }

/* ── Main Content ──────────────────────────────────────────── */
.site-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ── Hero ──────────────────────────────────────────────────── */
.hero {
    background: linear-gradient(135deg, var(--blue) 0%, var(--blue-mid) 60%, #1A237E 100%);
    color: var(--white);
    padding: 36px 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    right: -40px;
    top: -40px;
    width: 220px;
    height: 220px;
    background: rgba(255,193,7,.12);
    border-radius: 50%;
}

.hero::after {
    content: '';
    position: absolute;
    right: 60px;
    bottom: -60px;
    width: 160px;
    height: 160px;
    background: rgba(255,255,255,.05);
    border-radius: 50%;
}

.hero__title {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
    position: relative;
}

.hero__title em {
    color: var(--yellow);
    font-style: normal;
}

.hero__sub {
    font-size: 0.9rem;
    color: rgba(255,255,255,.70);
    position: relative;
}

.hero__badges {
    display: flex;
    gap: 8px;
    margin-top: 20px;
    flex-wrap: wrap;
    position: relative;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 0.02em;
}

.badge--yellow { background: var(--yellow); color: var(--black); }
.badge--outline { background: rgba(255,255,255,.1); color: rgba(255,255,255,.85); border: 1px solid rgba(255,255,255,.2); }

/* ── Card ──────────────────────────────────────────────────── */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 1px solid var(--gray-300);
}

.card__body { padding: 24px; }

/* ── Nav Tabs ──────────────────────────────────────────────── */
.nav-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--gray-300);
    background: var(--gray-100);
    padding: 0 24px;
}

.tab {
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 14px 18px;
    cursor: pointer;
    color: var(--gray-500);
    transition: color 0.15s, border-color 0.15s;
    margin-bottom: -1px;
}

.tab:hover { color: var(--blue-light); }
.tab--active { color: var(--blue); border-bottom-color: var(--yellow); }

/* ── Input Group ───────────────────────────────────────────── */
.input-group {
    display: flex;
    box-shadow: var(--shadow-sm);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1.5px solid var(--gray-300);
    transition: border-color 0.15s, box-shadow 0.15s;
    margin-bottom: 20px;
}

.input-group:focus-within {
    border-color: var(--blue-light);
    box-shadow: 0 0 0 3px rgba(25,118,210,.15);
}

.input-field {
    flex: 1;
    border: none;
    padding: 11px 14px;
    font-family: var(--font);
    font-size: 0.92rem;
    background: var(--white);
    color: var(--black);
    outline: none;
    min-width: 0;
}

.input-field::placeholder { color: var(--gray-300); }

.input-group-btn {
    flex-shrink: 0;
    border-left: 1.5px solid var(--gray-300);
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    padding: 11px 20px;
    white-space: nowrap;
    transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
    border-radius: 0;
    line-height: 1;
}

.btn:active:not(:disabled) { transform: translateY(1px); }

.btn--primary { background: var(--yellow); color: var(--black); }
.btn--primary:hover:not(:disabled) { background: var(--yellow-dark); }
.btn--primary:disabled { background: var(--gray-300); color: var(--gray-500); cursor: not-allowed; }

.btn--secondary { background: var(--blue); color: var(--white); }
.btn--secondary:hover:not(:disabled) { background: var(--blue-mid); }
.btn--secondary:disabled { background: var(--gray-500); cursor: not-allowed; }

.btn--copy {
    background: var(--white);
    color: var(--blue-light);
    border: 1.5px solid var(--gray-300);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    letter-spacing: 0.03em;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s;
}

.btn--copy:hover { background: var(--blue-pale); border-color: var(--blue-light); }

.btn-label { pointer-events: none; }

/* ── Section label ─────────────────────────────────────────── */
.section-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gray-500);
    padding-bottom: 10px;
    border-bottom: 1px solid var(--gray-100);
    margin-bottom: 14px;
}

/* ── Link Items ────────────────────────────────────────────── */
#links-list { display: flex; flex-direction: column; gap: 10px; }

.link-item {
    background: var(--white);
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius);
    padding: 12px 14px;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.25s, box-shadow 0.25s, opacity 0.35s;
}

.link-item--new {
    border-color: var(--yellow);
    box-shadow: 0 0 0 3px rgba(255,193,7,.20);
    opacity: 0;
}

.link-item:hover {
    border-color: var(--blue-light);
    box-shadow: var(--shadow);
}

.link-item__original {
    font-size: 0.75rem;
    color: var(--gray-500);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    margin-bottom: 6px;
}

.link-item__row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.link-item__short {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--blue);
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.link-item__count {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--gray-500);
    background: var(--gray-100);
    padding: 3px 8px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}

.link-badge {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

.link-badge--disabled {
    background: var(--gray-100);
    color: var(--gray-500);
    border: 1px solid var(--gray-300);
}

.link-badge--banned {
    background: #FEE2E2;
    color: #DC2626;
    border: 1px solid #FECACA;
}

.link-item--muted { opacity: 0.6; }
.link-item--muted:hover { opacity: 1; }

.link-empty {
    color: var(--gray-300);
    font-size: 0.85rem;
    padding: 28px 0;
    text-align: center;
}

/* ── Reveal Result ─────────────────────────────────────────── */
.reveal-result {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: var(--radius);
    border-left: 4px solid;
}

.reveal-result--found {
    border-color: var(--yellow);
    background: var(--yellow-pale);
}

.reveal-result--miss {
    border-color: var(--gray-300);
    background: var(--gray-100);
}

.reveal-result__label {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gray-500);
    margin-bottom: 5px;
}

.reveal-result__url {
    font-size: 0.95rem;
    font-weight: 600;
    word-break: break-all;
    color: var(--blue);
}

/* ── Toast ─────────────────────────────────────────────────── */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 1000;
    pointer-events: none;
}

.toast {
    background: var(--gray-900);
    color: var(--white);
    font-size: 0.82rem;
    padding: 12px 16px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--yellow);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.2s, transform 0.2s;
    max-width: 340px;
    min-width: 220px;
}

.toast--warn  { border-left-color: var(--yellow); }
.toast--error { border-left-color: var(--danger); }
.toast--visible { opacity: 1; transform: translateY(0); }

/* ── Footer ────────────────────────────────────────────────── */
.site-footer {
    background: var(--black);
    color: var(--gray-500);
    font-size: 0.78rem;
    text-align: center;
    padding: 18px var(--gap);
    flex-shrink: 0;
    margin-top: auto;
}

.site-footer a { color: var(--gray-500); }
.site-footer a:hover { color: var(--yellow); text-decoration: none; }

/* ── Utility ───────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 960px) {
    .ad-col--right { display: none; }
}

@media (max-width: 680px) {
    .ad-col { display: none; }
    .site-body { padding: 16px; }
    .hero { padding: 24px 20px; }
    .hero__title { font-size: 1.35rem; }
    .input-group { flex-direction: column; border-radius: var(--radius); }
    .input-group-btn { border-left: none; border-top: 1.5px solid var(--gray-300); }
    .btn--primary, .btn--secondary { width: 100%; border-radius: 0 0 var(--radius) var(--radius); }
}
