/* ============================================================
   Google Search Scraper — Page Styles
   File: google-search-scraper.css
   Builds on top of Rankyfy common.css + keyword-research-extension.css
   Only adds styles not already covered by the base sheets.
   ============================================================ */


/* ============================================================
   HERO — Fake SERP Preview
   ============================================================ */
.gss-serp-preview {
    background: #fff;
    min-height: 340px;
    border-radius: 0 0 8px 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* Google-style top bar */
.gss-google-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 16px;
    border-bottom: 1px solid #e8eaed;
    background: #fff;
    flex-shrink: 0;
}

.gss-google-logo {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -1px;
    flex-shrink: 0;
}

.gss-search-input {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #dfe1e5;
    border-radius: 24px;
    padding: 6px 14px;
    font-size: 12px;
    color: #202124;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.gss-scrape-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,85,0,0.1);
    border: 1px solid rgba(255,85,0,0.25);
    color: var(--primary-color);
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    flex-shrink: 0;
}

.gss-scrape-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--primary-color);
    animation: gssPulse 1s ease-in-out infinite alternate;
}

@keyframes gssPulse {
    from { opacity: 1; transform: scale(1); }
    to   { opacity: 0.4; transform: scale(0.7); }
}

/* Result list */
.gss-serp-results {
    flex: 1;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: hidden;
}

.gss-serp-result {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid transparent;
    transition: all 0.2s;
    position: relative;
}

.gss-result--scraped {
    background: rgba(40,167,69,0.04);
    border-color: rgba(40,167,69,0.15);
}

.gss-result-pos {
    font-size: 11px;
    font-weight: 800;
    color: #aaa;
    width: 22px;
    flex-shrink: 0;
    padding-top: 2px;
}

.gss-result-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.gss-result-domain {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #202124;
    font-weight: 600;
}

.gss-favicon {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    background: var(--primary-color);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.gss-result-title {
    font-size: 12px;
    font-weight: 700;
    color: #1a0dab;
    line-height: 1.3;
}

.gss-result-url {
    font-size: 10px;
    color: #19b045;
    font-weight: 500;
}

.gss-result-desc {
    font-size: 11px;
    color: #4d5156;
    line-height: 1.4;
    opacity: 1;
}

/* Captured / capturing badges */
.gss-captured-tag {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 700;
    color: #28a745;
    background: rgba(40,167,69,0.1);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gss-capturing-tag {
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-color);
    animation: gssEllipsis 1s ease-in-out infinite;
}

@keyframes gssEllipsis {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.3; }
}

/* Floating export tray at bottom of preview */
.gss-tray {
    position: absolute;
    bottom: 14px;
    right: 14px;
    background: var(--secondary-color);
    border-radius: 10px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.gss-tray-count {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: rgba(255,255,255,0.7);
}

.gss-tray-count strong {
    color: var(--primary-color);
}

.gss-tray-btn {
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.gss-tray-btn:hover { background: #e04a00; }


/* ============================================================
   SECTION 1 — Data rows in kre-ui-card
   ============================================================ */
.gss-data-rows {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid rgba(0,0,0,0.07);
    border-radius: 10px;
    overflow: hidden;
}

.gss-data-row {
    display: grid;
    grid-template-columns: 40px 1fr 130px 50px;
    align-items: center;
    padding: 9px 12px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    transition: background 0.15s;
}

.gss-data-row:last-child { border-bottom: none; }
.gss-data-row:not(.gss-data-head):hover { background: rgba(255,85,0,0.03); }

.gss-data-head {
    background: rgba(17,20,81,0.04);
}

.gss-data-head span {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #999;
}

.gss-data-row span { font-size: 12px; color: #555; }

.gss-pos {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 4px;
    display: inline-block;
}

.gss-pos--1   { color: #28a745; background: rgba(40,167,69,0.1); }
.gss-pos--mid { color: #ffc107; background: rgba(255,193,7,0.1); }

.gss-title-cell {
    font-weight: 600 !important;
    color: var(--secondary-color) !important;
    font-size: 12px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 8px;
}

.gss-domain-cell {
    font-size: 11px !important;
    color: #888 !important;
}

.gss-da {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
}

.gss-da--high { background: #f8d7da; color: #721c24; }
.gss-da--mid  { background: #fff3cd; color: #856404; }
.gss-da--low  { background: #d4edda; color: #155724; }


/* ============================================================
   SECTION 2 — Bulk scraping pages grid
   ============================================================ */
.gss-pages-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.gss-page-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    min-width: 100px;
    transition: all 0.2s;
}

.gss-page-done {
    background: rgba(40,167,69,0.12);
    border-color: rgba(40,167,69,0.25);
}

.gss-page-active {
    background: rgba(255,85,0,0.12);
    border-color: rgba(255,85,0,0.3);
}

.gss-page-pending {
    background: rgba(255,255,255,0.04);
    opacity: 0.5;
}

.gss-page-num {
    font-size: 12px;
    font-weight: 700;
    color: rgba(255,255,255,0.85);
    opacity: 1;
}

.gss-page-count {
    font-size: 11px;
    color: rgba(255,255,255,0.5);
    opacity: 1;
    flex: 1;
}

/* Spinner for active page */
.gss-spinner {
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255,85,0,0.3);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: gssSpin 0.7s linear infinite;
}

@keyframes gssSpin {
    to { transform: rotate(360deg); }
}

/* Summary stats row */
.gss-bulk-summary {
    display: flex;
    align-items: center;
    gap: 0;
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    padding: 12px 0;
    margin-bottom: 14px;
    border: 1px solid rgba(255,255,255,0.07);
}

.gss-summary-stat {
    flex: 1;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.gss-summary-stat strong {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary-color);
    display: block;
    line-height: 1;
}

.gss-summary-stat span {
    font-size: 10px;
    color: rgba(255,255,255,0.45);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 1;
}

.gss-summary-divider {
    width: 1px;
    height: 36px;
    background: rgba(255,255,255,0.08);
}


/* ============================================================
   SECTION 4 — Config grid inside kre-serp-card
   ============================================================ */
.gss-config-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 4px;
}

.gss-config-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.gss-config-item:last-child { border-bottom: none; }

.gss-config-label {
    font-size: 11px;
    font-weight: 700;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 0.7px;
    flex-shrink: 0;
    opacity: 1;
}

.gss-config-val {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255,255,255,0.85);
    opacity: 1;
}

.gss-toggle-row {
    display: flex;
    gap: 4px;
}

.gss-toggle-btn {
    border: 1px solid rgba(255,255,255,0.15);
    background: transparent;
    color: rgba(255,255,255,0.5);
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.gss-toggle-btn:hover {
    border-color: rgba(255,85,0,0.4);
    color: rgba(255,255,255,0.8);
}

.gss-toggle-btn--active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}


/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 767px) {
    .gss-serp-results { padding: 8px; }
    .gss-result-desc  { display: none; }
    .gss-tray         { bottom: 8px; right: 8px; }

    .gss-data-row {
        grid-template-columns: 36px 1fr 80px;
    }
    .gss-data-row > span:nth-child(4) { display: none; }

    .gss-pages-grid { gap: 6px; }
    .gss-page-chip  { min-width: 80px; }
}