/* ==========================================================================
   HANEL.PRO - GOOGLE ADS CROSS-NEGATIVE KEYWORD TOOL (STYLE.CSS)
   ========================================================================== */

:root {
    --bg-page: #03101c;
    --bg-surface: #071526;
    --bg-card: #0b1a2d;
    --bg-card-hover: #0f233d;
    --brand: #00a3e2;
    --brand-light: #38bdf8;
    --brand-glow: rgba(0, 163, 226, 0.25);
    --border: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(0, 163, 226, 0.5);
    --text-heading: #ffffff;
    --text-body: #94a3b8;
    --text-muted: #64748b;
    --success: #10b981;
    --success-light: #34d399;
    --danger: #ef4444;
    --danger-light: #f87171;
    --warning: #f59e0b;
    --purple: #a855f7;
    --cyan: #06b6d4;
    --emerald-light: #34d399;
    --amber-light: #fbbf24;
}

body {
    background-color: var(--bg-page);
    color: var(--text-body);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    min-height: 100vh;
}

/* Nav */
.tool-nav {
    background: #030d17;
    border-bottom: 1px solid var(--border);
    padding: 10px 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}
.tool-nav-inner {
    max-width: 1480px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.back-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}
.back-link:hover {
    color: var(--brand-light);
}

.tool-container {
    max-width: 1480px;
    margin: 0 auto;
    padding: 24px;
}

/* Header Card */
.tool-header-card {
    background: linear-gradient(135deg, #071526 0%, #0c2038 100%);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px 28px;
    margin-bottom: 22px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}
.badge-category {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(0, 163, 226, 0.12);
    border: 1px solid rgba(0, 163, 226, 0.25);
    color: var(--brand-light);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}
.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--brand);
    box-shadow: 0 0 8px var(--brand);
}
.tool-header-card h1 {
    color: var(--text-heading);
    font-size: 1.7rem;
    font-weight: 800;
    margin: 0 0 8px;
    letter-spacing: -0.02em;
}
.tool-header-card p {
    color: #94a3b8;
    font-size: 0.9rem;
    margin: 0;
    max-width: 980px;
    line-height: 1.6;
}

/* Stats Bar */
.cluster-stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 22px;
}
.stat-card {
    background: #071526;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
    overflow: hidden;
    transition: 0.2s;
}
.stat-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}
.stat-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--stat-color, var(--brand));
}
.stat-label {
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.stat-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.45rem;
    font-weight: 800;
    color: #ffffff;
    display: flex;
    align-items: baseline;
    gap: 6px;
}
.stat-value small {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* Grid Layout */
.workspace-grid {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

/* Input Mode Switcher Pills */
.input-mode-pills {
    display: inline-flex;
    background: #040e1a;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 3px;
    gap: 3px;
}
.mode-pill-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}
.mode-pill-btn:hover:not(.active) {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}
.mode-pill-btn.active {
    background: rgba(0, 163, 226, 0.22);
    border: 1px solid rgba(0, 163, 226, 0.5);
    color: var(--brand-light);
}

/* 3-Column Input Grid */
.input-three-columns {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 12px;
}
@media (max-width: 960px) {
    .input-three-columns {
        grid-template-columns: 1fr;
    }
}
.col-input-card {
    background: #040e1a;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.col-input-card:focus-within {
    border-color: var(--brand);
    box-shadow: 0 0 14px rgba(0, 163, 226, 0.18);
}
.col-input-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 8px;
}
.col-input-title {
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}
.col-input-count {
    font-size: 0.72rem;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-muted);
}
.col-textarea {
    width: 100%;
    height: 240px;
    background: transparent;
    border: none;
    color: #ffffff;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    line-height: 1.55;
    outline: none;
    resize: vertical;
    box-sizing: border-box;
    white-space: pre;
    overflow-x: auto;
}

/* Panels */
.panel {
    background: #071526;
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}
.panel-header {
    padding: 14px 20px;
    background: #091a30;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}
.panel-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}
.panel-body {
    padding: 18px 20px;
}

/* Textarea input (Single box mode) */
.data-textarea {
    width: 100%;
    height: 240px;
    background: #040e1a;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    color: #ffffff;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    line-height: 1.55;
    outline: none;
    resize: vertical;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
    white-space: pre;
    overflow-x: auto;
}
.data-textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 12px rgba(0, 163, 226, 0.2);
}

/* Buttons */
.btn-action {
    background: rgba(0, 163, 226, 0.15);
    border: 1px solid rgba(0, 163, 226, 0.35);
    color: var(--brand-light);
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    text-decoration: none;
}
.btn-action:hover {
    background: rgba(0, 163, 226, 0.28);
    border-color: var(--brand-light);
    color: #ffffff;
}
.btn-emerald {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.4);
    color: #34d399;
}
.btn-emerald:hover {
    background: rgba(16, 185, 129, 0.3);
    border-color: #34d399;
    color: #ffffff;
}
.btn-amber {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.4);
    color: #fbbf24;
}
.btn-amber:hover {
    background: rgba(245, 158, 11, 0.3);
    border-color: #fbbf24;
    color: #ffffff;
}
.chip-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-body);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.74rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}
.chip-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.25);
}

/* Control Pills */
.scope-tabs {
    display: inline-flex;
    background: #040e1a;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 3px;
    gap: 3px;
}
.scope-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}
.scope-btn:hover:not(.active) {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.04);
}
.scope-btn.active {
    background: rgba(0, 163, 226, 0.22);
    border: 1px solid rgba(0, 163, 226, 0.5);
    color: var(--brand-light);
    box-shadow: 0 2px 8px rgba(0, 163, 226, 0.2);
}

/* Cross-Negative Strategy Selector */
.strategy-selector-pill {
    display: inline-flex;
    align-items: center;
    background: #040e1a;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 3px;
    gap: 3px;
}
.strategy-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    padding: 5px 11px;
    border-radius: 7px;
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
}
.strategy-btn:hover:not(.active) {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}
.strategy-btn.active.subset {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.55);
    color: #34d399;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
}
.strategy-btn.active.theme {
    background: rgba(56, 189, 248, 0.2);
    border-color: rgba(56, 189, 248, 0.55);
    color: #38bdf8;
    box-shadow: 0 2px 8px rgba(56, 189, 248, 0.2);
}
.strategy-btn.active.matrix {
    background: rgba(245, 158, 11, 0.22);
    border-color: rgba(245, 158, 11, 0.55);
    color: #fbbf24;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
}

.match-pills {
    display: inline-flex;
    background: #040e1a;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 3px;
    gap: 3px;
}
.match-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.74rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    cursor: pointer;
    transition: 0.2s;
}
.match-btn.active.exact {
    background: rgba(244, 63, 94, 0.2);
    border: 1px solid rgba(244, 63, 94, 0.5);
    color: #f43f5e;
}
.match-btn.active.phrase {
    background: rgba(56, 189, 248, 0.2);
    border: 1px solid rgba(56, 189, 248, 0.5);
    color: #38bdf8;
}
.match-btn.active.broad {
    background: rgba(251, 191, 36, 0.2);
    border: 1px solid rgba(251, 191, 36, 0.5);
    color: #fbbf24;
}

/* Strategy Selector Pills */
.strategy-selector-pill {
    display: inline-flex;
    align-items: center;
    background: #040e1a;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 3px 6px;
    gap: 5px;
}
.strategy-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 5px 12px;
    border-radius: 7px;
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.strategy-btn:hover:not(.active) {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}
.strategy-btn.active.subset {
    background: rgba(16, 185, 129, 0.22);
    border: 1px solid rgba(16, 185, 129, 0.5);
    color: #34d399;
}
.strategy-btn.active.theme {
    background: rgba(0, 163, 226, 0.22);
    border: 1px solid rgba(0, 163, 226, 0.5);
    color: #38bdf8;
}
.strategy-btn.active.matrix {
    background: rgba(244, 63, 94, 0.22);
    border: 1px solid rgba(244, 63, 94, 0.55);
    color: #f43f5e;
}

/* Results Table */
.table-responsive-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #05101d;
    max-height: 580px;
    overflow-y: auto;
}
.ads-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
    text-align: left;
}
.ads-table thead th {
    background: #081729;
    padding: 10px 12px;
    color: var(--brand-light);
    font-weight: 700;
    font-size: 0.74rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 10;
    white-space: nowrap;
}
.ads-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.15s;
}
.ads-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}
.ads-table tbody td {
    padding: 8px 12px;
    vertical-align: middle;
}

.badge-camp {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 5px;
    background: rgba(0, 163, 226, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(0, 163, 226, 0.3);
    font-weight: 600;
    font-size: 0.73rem;
    font-family: 'JetBrains Mono', monospace;
}
.badge-adgroup {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 5px;
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.35);
    font-weight: 600;
    font-size: 0.73rem;
    font-family: 'JetBrains Mono', monospace;
}

/* Toast */
.toast-msg {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #0b2238;
    color: #ffffff;
    border: 1px solid var(--brand);
    border-radius: 10px;
    padding: 12px 18px;
    font-size: 0.82rem;
    font-weight: 600;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    z-index: 9999;
    opacity: 0;
    transform: translateY(15px);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}
.toast-msg.show {
    opacity: 1;
    transform: translateY(0);
}

/* Guide Accordion */
.guide-box {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(7, 21, 38, 0.95) 100%);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-left: 4px solid #10b981;
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 20px;
}
