/* ============================================================
   SilentSniper — Product × Hunter
   Navy / teal control-panel theme (shared system across SilentSniper pages)
   ============================================================ */

:root {
    /* Surfaces */
    --navy-950: #070b14;
    --navy-900: #0b1322;
    --navy-800: #111c30;
    --navy-700: #18253c;
    --navy-600: #213452;

    /* Lines */
    --line: #243551;
    --line-subtle: #1c2940;
    --line-strong: #2c3e5e;

    /* Accent */
    --teal-300: #7fe9da;
    --teal-400: #2dd4bf;
    --teal-500: #14b8a6;
    --teal-glow: rgba(45, 212, 191, 0.18);

    /* Status / category colors */
    --success-400: #34d399;
    --success-500: #10b981;
    --danger-400: #fb7185;
    --danger-500: #e11d48;
    --warning-300: #ffd76a;
    --info-400: #60a5fa;
    --info-500: #3b82f6;
    --violet-400: #a78bfa;
    --violet-500: #8b5cf6;

    /* Text */
    --ink-100: #eaf2fb;
    --ink-300: #c2d0e4;
    --ink-400: #91a3bd;
    --ink-600: #5a6b85;

    /* Type */
    --font-display: 'Space Grotesk', 'Inter', sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, monospace;

    --radius-lg: 14px;
    --radius-md: 10px;
    --radius-sm: 7px;

    --shadow-panel: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 14px 30px -18px rgba(0, 0, 0, 0.7);
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    color: var(--ink-100);
    margin: 0;
    padding: 0;
    background:
        radial-gradient(900px 420px at 50% -160px, rgba(45, 212, 191, 0.10), transparent 60%),
        var(--navy-950);
    min-height: 100vh;
}

.ss-shell {
    max-width: 1280px;
    margin: 0 auto;
    padding: 40px 24px 64px;
}

.ss-brand-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
    color: var(--ink-400);
}

.ss-brand__mark {
    width: 16px;
    height: 16px;
    color: var(--teal-400);
}

.ss-brand__name {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-400);
}

.ss-shell h1 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.7rem;
    color: var(--ink-100);
    text-align: center;
    margin: 0 0 28px;
}

.ss-shell h2 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--ink-100);
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ss-shell h4 {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.86rem;
    color: var(--ink-300);
    margin: 18px 0 10px;
}

.ss-shell p {
    color: var(--ink-400);
    margin: 0 0 8px;
}

.ss-shell label {
    color: var(--ink-300);
    font-size: 0.86rem;
}

.ss-gear-icon {
    width: 18px;
    height: 18px;
    filter: invert(1);
    opacity: 0.8;
    vertical-align: middle;
}

.panel__eyebrow {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-400);
    margin: 0 0 16px;
    font-weight: 500;
    display: flex;
}

/* ============================================================
   Layout
   ============================================================ */

.container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 20px;
}

.search-container,
.settings-container {
    flex: 1;
    min-width: 320px;
    margin: 0;
}

.result-container {
    flex-basis: 100%;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.panel {
    background: linear-gradient(180deg, var(--navy-800), var(--navy-900));
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-panel);
    padding: 22px 24px;
}

.textarea-wrapper {
    flex: 1 1 480px;
    min-width: 280px;
}

.textarea-wrapper>button {
    margin: 4px 8px 4px 0;
}

#pause_resume_buttons {
    margin-top: 24px;
    display: flex;
    gap: 8px;
}

#filter_heading {
    margin-top: 10px;
}

/* ============================================================
   Form controls — scoped to .ss-shell so these don't leak into the
   membership gate modal the bundle appends directly to <body>
   (already self-styled, dark, independent of this file).
   ============================================================ */

.ss-shell input[type="number"],
.ss-shell input[type="text"],
.ss-shell select,
.ss-shell textarea {
    font-family: var(--font-mono);
    font-size: 0.88rem;
    color: var(--ink-100);
    background: var(--navy-700);
    border: 1px solid var(--line-subtle);
    border-radius: var(--radius-sm);
    padding: 7px 10px;
}

.ss-shell select {
    font-family: var(--font-body);
}

.ss-shell input[type="number"] {
    width: 90px;
}

.ss-shell input::placeholder,
.ss-shell textarea::placeholder {
    color: var(--ink-600);
    font-family: var(--font-body);
}

.ss-shell input:focus-visible,
.ss-shell select:focus-visible,
.ss-shell textarea:focus-visible {
    outline: none;
    border-color: var(--teal-500);
    box-shadow: 0 0 0 3px var(--teal-glow);
}

.ss-shell input[type="checkbox"],
.ss-shell input[type="radio"] {
    accent-color: var(--teal-400);
}

.ss-shell .filter-container>div {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

#searchTerms,
#restricted_words {
    width: 100%;
}

#searchTermPosition {
    width: 70px;
}

/* Flash state the bundle adds to searchTermPosition on invalid range.
   Needs to out-specificity .ss-shell input[type="number"] above, so
   it's written as a compound selector rather than reaching for !important. */
.ss-shell input[type="number"].alert {
    border: 2px solid var(--danger-500);
    color: var(--ink-100);
    background: var(--navy-700);
    padding: 8px 12px;
    font-weight: bold;
    display: inline-block;
    margin-top: 10px;
    animation: flash 1s ease-in-out 3 alternate;
}

@keyframes flash {
    0% {
        background-color: rgba(225, 29, 72, 0.14);
    }

    100% {
        background-color: rgba(225, 29, 72, 0.4);
    }
}

/* ============================================================
   Buttons
   ============================================================ */

.ss-shell button {
    font-family: var(--font-body);
    font-size: 0.86rem;
    font-weight: 500;
    color: var(--ink-300);
    background: var(--navy-700);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.05s ease;
}

.ss-shell button:hover {
    background: var(--navy-600);
    color: var(--ink-100);
}

.ss-shell button:active {
    transform: translateY(1px);
}

.ss-shell button:disabled {
    background: var(--navy-700);
    border-color: var(--line-subtle);
    color: var(--ink-600);
    cursor: not-allowed;
    transform: none;
}

.clear {
    background: transparent;
    border-color: rgba(225, 29, 72, 0.4);
    color: var(--danger-400);
}

.clear:hover {
    background: rgba(225, 29, 72, 0.1);
    border-color: var(--danger-500);
    color: var(--danger-400);
}

.exportResults {
    background: var(--success-500);
    border-color: var(--success-500);
    color: var(--navy-950);
}

.exportResults:hover {
    background: var(--success-400);
    border-color: var(--success-400);
    color: var(--navy-950);
}

.searchTitle {
    background: var(--teal-500);
    border-color: var(--teal-500);
    color: var(--navy-950);
}

.searchTitle:hover {
    background: var(--teal-400);
    border-color: var(--teal-400);
    color: var(--navy-950);
}

.searchTitle:disabled {
    background: var(--navy-700);
    border-color: var(--line-subtle);
    color: var(--ink-600);
}

#exportResultsToBulk,
#exportResultsToProductSub {
    background: var(--info-500);
    border-color: var(--info-500);
    color: var(--navy-950);
}

#exportResultsToBulk:hover,
#exportResultsToProductSub:hover {
    background: var(--info-400);
    border-color: var(--info-400);
}

#openKeywordTool {
    background: var(--violet-500);
    border-color: var(--violet-500);
    color: var(--navy-950);
}

#openKeywordTool:hover {
    background: var(--violet-400);
    border-color: var(--violet-400);
}

#quickFilter {
    background: var(--info-500);
    border-color: var(--info-500);
    color: var(--navy-950);
}

#quickFilter:hover {
    background: transparent;
    color: var(--info-400);
}

/* ============================================================
   Progress / loading bars
   ============================================================ */

.progress-container {
    width: 100%;
    flex: 1 1 220px;
    min-width: 200px;
    align-self: flex-start;
}

.progress-container p {
    color: var(--ink-300);
    font-size: 0.86rem;
}

#progress-bar {
    height: 26px;
    width: 0;
    background-color: var(--navy-700);
    border: 1px solid var(--line-subtle);
    border-radius: var(--radius-sm);
    transition: width 0.4s ease-in-out, background-color 0.4s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--navy-950);
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 600;
    overflow: hidden;
}

.progress-percentage {
    visibility: hidden;
}

.loading-bar-container {
    width: 100%;
    height: 16px;
    background-color: var(--navy-700);
    border: 1px solid var(--line-subtle);
    border-radius: var(--radius-sm);
    overflow: hidden;
    display: none;
    margin-top: 10px;
}

.loading-bar {
    height: 100%;
    width: 0%;
    background-color: var(--teal-400);
}

/* ============================================================
   Product table
   ============================================================ */

#productTable {
    width: 100%;
    margin: 0 auto;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    border-collapse: collapse;
    background: var(--navy-900);
}

#productTable {
    display: block;
    height: 280px;
    overflow: auto;
    resize: both;
}

#productTable th,
#productTable td {
    padding: 8px 10px;
    text-align: left;
    vertical-align: top;
    border: 1px solid var(--line-subtle);
    color: var(--ink-300);
    font-size: 0.86rem;
}

#productTable th {
    background-color: var(--navy-700);
    color: var(--ink-100);
    font-weight: 600;
    position: sticky;
    top: 0;
}

#productTable td img {
    max-width: 100%;
    height: auto;
}

#productTable button {
    background: transparent;
    border-color: rgba(225, 29, 72, 0.4);
    color: var(--danger-400);
    font-size: 0.8rem;
    padding: 6px 10px;
}

#productTable button:hover {
    background: rgba(225, 29, 72, 0.1);
    border-color: var(--danger-500);
}

.img-link {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    transition: transform 0.3s;
    background: var(--navy-700);
}

.img-link:hover {
    animation: wiggle 0.5s infinite;
    cursor: pointer;
}

@keyframes wiggle {
    0% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-5deg);
    }

    50% {
        transform: rotate(0deg);
    }

    75% {
        transform: rotate(5deg);
    }

    100% {
        transform: rotate(0deg);
    }
}

/* eBay comparison card — the bundle builds this with an inline
   style.cssText (border:#ccc, no background) and one hardcoded
   inline color:#444 on the price line, written for a white table.
   No class hook exists on any of it, so target it structurally by
   column position (Comparison is the 7th <th>/<td>) and override
   the inline declarations with !important — same justified case as
   the CSV Processor's price-rule fix. */
#productTable td:nth-child(7)>div {
    font-family: var(--font-body) !important;
    border-color: var(--line-strong) !important;
    background: var(--navy-700) !important;
    border-radius: var(--radius-sm) !important;
}

#productTable td:nth-child(7)>div>div:last-child>div:last-child {
    color: var(--teal-300) !important;
}

/* ============================================================
   Modals — #filterModal (Quick Filter) and .keyword-modal both use
   .modal-content; #myModal is styled directly in its HTML inline
   style (changed at the source rather than fought here).
   ============================================================ */

#filterModal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(7, 11, 20, 0.78);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-content {
    background: linear-gradient(180deg, var(--navy-800), var(--navy-900));
    margin: 5% auto;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    width: 90%;
    height: 80%;
    overflow: auto;
    box-shadow: var(--shadow-panel);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.modal-content h1,
.modal-content h2 {
    color: var(--ink-100);
}

#closeFilterModal {
    color: var(--ink-400);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

#closeFilterModal:hover {
    color: var(--danger-400);
}

.modal-buttons {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.product-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.product-image {
    max-width: 220px;
    max-height: 220px;
    object-fit: contain;
    background: var(--navy-900);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 8px;
}

.product-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--ink-100);
}

.product-price {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--success-400);
}

.product-reviews {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--warning-300);
}

.product-asin {
    color: var(--ink-400);
    font-family: var(--font-mono);
    font-size: 0.86rem;
}

.price-reviews {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
}

@keyframes slideLeft {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-100%);
    }
}

@keyframes slideRight {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(100%);
    }
}

.slide-left {
    animation: slideLeft 0.5s forwards;
    background-color: rgba(225, 29, 72, 0.25);
}

.slide-right {
    animation: slideRight 0.5s forwards;
    background-color: rgba(45, 212, 191, 0.2);
}

/* Keyword modal */
.keyword-modal.modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(7, 11, 20, 0.78);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

.keyword-modal .modal-content {
    position: relative;
    background: linear-gradient(180deg, var(--navy-800), var(--navy-900));
    margin: 0;
    padding: 24px;
    width: 50%;
    height: auto;
    max-width: 600px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-panel);
    text-align: left;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.keyword-modal .modal-content p {
    color: var(--ink-400);
}

.close {
    position: absolute;
    top: 14px;
    right: 16px;
    font-size: 22px;
    font-weight: bold;
    color: var(--ink-400);
    cursor: pointer;
}

.close:hover {
    color: var(--danger-400);
}

.keyword-modal textarea {
    width: 100%;
    flex-grow: 1;
    min-height: 100px;
    max-height: 300px;
    padding: 10px;
    margin-top: 10px;
    margin-bottom: 10px;
    resize: vertical;
}

.keyword-modal label {
    margin: 0;
    cursor: pointer;
}

.required_keyword_radio_container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 10px 0 0;
    margin-top: 10px;
    gap: 8px;
}

.required_keyword_radio_container div {
    margin-bottom: 0;
}

@media (max-width: 600px) {
    .modal-content {
        width: 90%;
        padding: 14px;
    }

    .keyword-modal .modal-content {
        width: 90%;
    }
}

@media (max-width: 768px) {
    .ss-shell {
        padding: 28px 16px 48px;
    }

    .panel {
        padding: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}