/* ============================================================
   Google Maps Scraper — Page Styles
   File: google-maps-scraper.css
   Builds on top of Rankyfy common.css + keyword-research-extension.css
   Only adds styles not already covered by the base sheets.
   ============================================================ */

/* ============================================================
   HERO — Map Preview Component
   ============================================================ */
.gms-map-preview {
    display: flex;
    height: 340px;
    background: #f1f3f4;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
    font-family: inherit;
}

/* Sidebar */
.gms-map-sidebar {
    width: 320px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.gms-search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid #e8eaed;
    background: #fff;
    font-size: 12px;
    color: #555;
}

.gms-result-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px 0;
}

.gms-result-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
}

.gms-result-item:hover,
.gms-result-item--active {
    background: rgba(255, 85, 0, 0.04);
}

.gms-result-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary-color);
    flex-shrink: 0;
    margin-top: 4px;
}

.gms-result-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.gms-result-info strong {
    font-size: 12px;
    color: #202124;
    font-weight: 600;
}

.gms-result-info span {
    font-size: 11px;
    color: #70757a;
    opacity: 1;
}

.gms-scraped-badge {
    font-size: 9px;
    font-weight: 700;
    background: rgba(40, 167, 69, 0.12);
    color: #28a745;
    padding: 2px 6px;
    border-radius: 4px;
    flex-shrink: 0;
    align-self: flex-start;
}

/* Map area */
.gms-map-area {
    flex: 1;
    background: linear-gradient(135deg, #e8f5e9 0%, #e3f2fd 50%, #fce4ec 100%);
    position: relative;
    overflow: hidden;
}

.gms-map-area::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        repeating-linear-gradient(0deg, rgba(0,0,0,0.04) 0, rgba(0,0,0,0.04) 1px, transparent 1px, transparent 40px),
        repeating-linear-gradient(90deg, rgba(0,0,0,0.04) 0, rgba(0,0,0,0.04) 1px, transparent 1px, transparent 40px);
}

.gms-map-pin {
    position: absolute;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
    animation: pinBounce 1.5s ease-in-out infinite alternate;
}

.gms-pin-1 { top: 28%; left: 30%; animation-delay: 0s; }
.gms-pin-2 { top: 50%; left: 55%; animation-delay: 0.4s; }
.gms-pin-3 { top: 65%; left: 38%; animation-delay: 0.8s; }

@keyframes pinBounce {
    from { transform: translateY(0); }
    to   { transform: translateY(-5px); }
}

.gms-export-popup {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: #fff;
    border-radius: 10px;
    padding: 12px 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 150px;
}

.gms-export-popup__title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    color: #333;
}

.gms-export-btn {
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.gms-export-btn:hover { background: #e04a00; }


/* ============================================================
   SECTION 1 — Fields Grid (UI Card body)
   ============================================================ */
.gms-fields-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 18px;
}

.gms-field-chip {
    background: #f6f7ff;
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.gms-field-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #aaa;
}

.gms-field-val {
    font-size: 12px;
    font-weight: 600;
    color: var(--secondary-color);
}

.gms-field-val.gms-link { color: var(--primary-color); }
.gms-field-val.gms-rating { color: #f5a623; }

/* Progress row */
.gms-progress-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
}

.gms-progress-label {
    color: #888;
    flex-shrink: 0;
}

.gms-progress-bar-wrap {
    flex: 1;
    height: 5px;
    background: #f0f0f0;
    border-radius: 3px;
    overflow: hidden;
}

.gms-progress-bar {
    height: 100%;
    width: 20%;
    background: var(--primary-color);
    border-radius: 3px;
    animation: gmsProgress 2s ease-in-out infinite alternate;
}

@keyframes gmsProgress {
    from { width: 10%; }
    to   { width: 90%; }
}

.gms-progress-count {
    color: var(--primary-color);
    font-weight: 700;
    flex-shrink: 0;
}


/* ============================================================
   SECTION 2 — Export Table (inside kre-issue-card)
   ============================================================ */
.gms-export-table {
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 14px;
    border: 1px solid rgba(255,255,255,0.1);
}

.gms-export-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr 1fr;
    gap: 0;
}

.gms-export-row span {
    padding: 8px 10px;
    font-size: 11px;
    color: rgba(255,255,255,0.75);
    border-right: 1px solid rgba(255,255,255,0.07);
    opacity: 1;
}

.gms-export-row span:last-child { border-right: none; }

.gms-export-head {
    background: rgba(255,255,255,0.1);
}

.gms-export-head span {
    font-weight: 700;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255,255,255,0.5);
}

.gms-export-row:not(.gms-export-head) {
    border-bottom: 1px solid rgba(255,255,255,0.06);
    transition: background 0.2s;
}

.gms-export-row:not(.gms-export-head):hover {
    background: rgba(255,255,255,0.05);
}

.gms-star {
    color: #f5a623 !important;
    font-weight: 700 !important;
}

.gms-export-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.gms-record-count {
    margin-left: auto;
    font-size: 11px;
    font-weight: 700;
    color: rgba(255,255,255,0.4);
    opacity: 1;
}


/* ============================================================
   SECTION 3 — Star badge (in table)
   ============================================================ */
.gms-star-badge {
    display: inline-block;
    background: rgba(245,166,35,0.12);
    color: #f5a623;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
}


/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 767px) {
    .gms-map-preview {
        flex-direction: column;
        height: auto;
    }

    .gms-map-sidebar {
        width: 100%;
        max-height: 220px;
    }

    .gms-map-area {
        height: 160px;
    }

    .gms-fields-grid {
        grid-template-columns: 1fr;
    }

    .gms-export-row {
        grid-template-columns: 2fr 1fr;
    }

    .gms-export-row span:nth-child(3),
    .gms-export-row span:nth-child(4) {
        display: none;
    }
}