/* ===== Header Icon Buttons (share, settings, logout) ===== */

.header-icon-btn {
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: all 0.2s;
    margin-left: 8px;
}

.header-icon-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-color);
}

.header-icon-btn.danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.header-icon-btn svg {
    fill: currentColor;
}

#login-nav-btn {
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 8px;
    background: var(--accent-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
    margin-left: 8px;
}

#login-nav-btn:hover {
    background: var(--accent-hover);
}

/* ===== Search & Filter Controls ===== */

.search-input-wrap {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.search-row {
    display: flex;
    gap: 6px;
    align-items: center;
}

#searchInput {
    width: 100%;
    padding-right: 32px;
}

/* JS toggles display between 'none' and 'flex' */
#clearSearchBtn {
    display: none;
    position: absolute;
    right: 6px;
    border: none;
    background: none;
    color: #999;
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

#clearSearchBtn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #666;
}

.toolbar-btn {
    width: 38px;
    height: 38px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.6);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 18px;
}

.toolbar-btn:hover {
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.toolbar-btn.filter-active {
    background: #f59e0b;
    color: white;
    border-color: #f59e0b;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.4);
}

.toolbar-btn.filter-active:hover {
    background: #d97706;
    border-color: #d97706;
}

.toolbar-btn.viewport-active {
    background: #059669;
    color: white;
    border-color: #059669;
    box-shadow: 0 2px 6px rgba(5, 150, 105, 0.4);
}

.toolbar-btn.viewport-active:hover {
    background: #047857;
    border-color: #047857;
}

/* JS toggles style.display between 'none' and 'flex' */
#googleSearchBtn {
    display: none;
    color: var(--primary-color);
    background: rgba(255, 255, 255, 0.8);
    font-size: 16px;
}

.chips-container {
    margin-top: 4px;
}

/* Filter panel slider row */
.filter-slider-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.filter-slider-row input[type="range"] {
    flex: 1;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.filter-slider-value {
    font-size: 13px;
    font-weight: 800;
    color: var(--primary-color);
    width: 40px;
    text-align: right;
}

.filter-panel-footer {
    border-top: 1px solid var(--bg-input);
    padding-top: 10px;
    display: flex;
    justify-content: flex-end;
}

.filter-panel-footer .magazine-btn {
    flex: none;
    padding: 6px 15px;
}

/* ===== Progress Modal ===== */

.progress-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.progress-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.progress-card h3 {
    margin-bottom: 15px;
    font-size: 18px;
}

.progress-bar-track {
    width: 100%;
    height: 10px;
    background: #eee;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-bar-fill {
    width: 0%;
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s;
}

.progress-text {
    text-align: center;
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
}

.progress-result {
    display: none;
    max-height: 200px;
    overflow-y: auto;
    background: #f9fafb;
    padding: 10px;
    border-radius: 8px;
    font-size: 13px;
    border: 1px solid #eee;
}

.progress-footer {
    text-align: right;
    margin-top: 20px;
}

.progress-close-btn {
    display: none;
    padding: 8px 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.progress-close-btn:hover {
    filter: brightness(1.1);
}

/* ===== Map Empty States ===== */

.map-empty-state {
    padding: 2.5rem;
    text-align: center;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-subtle);
    color: var(--text-tertiary);
}

.map-empty-state .empty-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
}

.map-empty-state h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-strong);
    margin-bottom: 1rem;
}

.map-empty-state p {
    max-width: 320px;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.map-empty-state .empty-action-btn {
    padding: 10px 24px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.map-empty-state .empty-action-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.map-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Filter controls reset */
.filter-controls {
    padding: 0;
}

/* API usage display (hidden by default, shown via JS) */
#api-usage-display {
    display: none;
    font-size: 12px;
    margin-right: 10px;
    color: #666;
}

.map-empty-state .loading-text {
    font-weight: 500;
    font-size: 0.95rem;
