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

:root {
    --bg:       #0d0d12;
    --surface:  #13131c;
    --surface2: #1a1a26;
    --border:   #22222f;
    --border2:  #1c1c28;
    --text:     #d8dce8;
    --muted:    #4a4d62;
    --accent:   #e03a20;
    --accent2:  #f06a20;
    --green:    #34c96c;
    --yellow:   #f0a030;
    --red:      #e04040;
    --blue:     #3ab0f0;
    --mono:     'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    padding: 32px 24px;
    font-size: 14px;
    line-height: 1.5;
}

/* ── Layout ───────────────────────────────────────── */

.container { max-width: 1240px; margin: 0 auto; }

/* ── Header ───────────────────────────────────────── */

header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
}

.header-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.header-icon i {
    font-size: 22px;
    color: #fff;
}

header h1 {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.3px;
}

header p {
    color: var(--muted);
    font-size: 12px;
    margin-top: 2px;
}

/* ── Form card ────────────────────────────────────── */

.form-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 22px 24px;
    margin-bottom: 18px;
}

.form-query { margin-bottom: 14px; }

.form-filters {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 12px;
    align-items: flex-end;
}

.field label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--muted);
    margin-bottom: 6px;
}

.field input {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 9px 13px;
    color: var(--text);
    font-size: 14px;
    outline: none;
    transition: border-color .2s;
}

.field input:focus { border-color: var(--accent); }
.field input::placeholder { color: var(--muted); }

/* ── Button start ─────────────────────────────────── */

.btn-start {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 20px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity .2s, transform .1s;
    height: 39px;
}

.btn-start:hover  { opacity: .88; }
.btn-start:active { transform: scale(.97); }
.btn-start:disabled { opacity: .4; cursor: not-allowed; }

.btn-start i { font-size: 18px; }

/* ── Panels ───────────────────────────────────────── */

.panels {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 14px;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ── Panel header ─────────────────────────────────── */

.panel-head {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    background: var(--surface2);
}

.panel-head-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-head-left i {
    font-size: 16px;
    color: var(--muted);
}

.panel-head-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--muted);
}

.counter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    margin-left: 6px;
}

/* ── Log ──────────────────────────────────────────── */

.log-body {
    flex: 1;
    overflow-y: auto;
    padding: 10px 12px;
    font-family: var(--mono);
    font-size: 11.5px;
    line-height: 1.6;
    height: 500px;
}

.log-entry { padding: 1px 0; display: flex; gap: 6px; }

.log-ts  { color: #2e2e48; flex-shrink: 0; }

.log-status  .log-msg { color: var(--blue); }
.log-result  .log-msg { color: var(--green); }
.log-skipped .log-msg { color: var(--yellow); }
.log-error   .log-msg { color: var(--red); }

/* ── Results actions ──────────────────────────────── */

.results-actions { display: flex; gap: 6px; }

.btn-action {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 11px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}

.btn-action i { font-size: 14px; }

.btn-action:hover {
    background: var(--surface2);
    color: var(--text);
    border-color: #33334a;
}

.btn-action:disabled { opacity: .3; cursor: not-allowed; }
.btn-action:disabled:hover { background: transparent; color: var(--muted); border-color: var(--border); }

/* ── Table ────────────────────────────────────────── */

.table-wrap { overflow-y: auto; height: 500px; flex: 1; }

table { width: 100%; border-collapse: collapse; }

thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--surface2);
    padding: 10px 14px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
}

tbody tr {
    border-bottom: 1px solid var(--border2);
    transition: background .1s;
    animation: rowIn .25s ease;
}

tbody tr:hover { background: var(--surface2); }

@keyframes rowIn {
    from { opacity: 0; transform: translateY(3px); }
    to   { opacity: 1; transform: translateY(0); }
}

tbody td {
    padding: 9px 14px;
    font-size: 13px;
    vertical-align: middle;
}

.td-num  { color: var(--muted); font-size: 11px; width: 32px; }
.td-name { font-weight: 500; }
.td-addr { color: var(--muted); font-size: 12px; }

/* ── Rating badge ─────────────────────────────────── */

.badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 5px;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.2px;
}

.badge-high { background: #0d2a18; color: var(--green); }
.badge-mid  { background: #261e0a; color: var(--yellow); }
.badge-low  { background: #260e0e; color: var(--red); }
.badge-none { background: var(--surface2); color: var(--muted); }

/* ── Status bar ───────────────────────────────────── */

.statusbar {
    margin-top: 12px;
    padding: 10px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 12px;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 10px;
}

.dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--muted);
    flex-shrink: 0;
    transition: background .3s;
}

.dot.active {
    background: var(--green);
    box-shadow: 0 0 7px var(--green);
    animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: .35; }
}

/* ── Scrollbar ────────────────────────────────────── */

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2a2a3a; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #3a3a50; }


/* ── Phase 2: Website + Email ───────────────────────── */

.table-wrap {
    overflow: auto;
}

.results-table {
    min-width: 1080px;
}

.td-reviews {
    color: #7a8aaa;
    white-space: nowrap;
}

.td-site,
.td-email {
    white-space: nowrap;
    max-width: 220px;
}

.result-link {
    color: var(--blue);
    text-decoration: none;
    border-bottom: 1px solid transparent;
}

.result-link:hover {
    border-bottom-color: currentColor;
}

.email-link {
    color: var(--green);
}

.muted-cell {
    color: var(--muted);
}

@media (max-width: 900px) {
    body {
        padding: 18px 12px;
    }

    .panels {
        grid-template-columns: 1fr;
    }

    .form-filters {
        grid-template-columns: 1fr 1fr;
    }

    .btn-start {
        width: 100%;
        justify-content: center;
    }

    .log-body,
    .table-wrap {
        height: 420px;
    }
}
