/* ============================================
   HAM RADIO MAPPER
   Copyright (c) 2026 Blue Heron Data
   blueherondata.com — All rights reserved.
   ============================================ */

.hrm-wrapper {
    max-width: 100%;
    margin: 0 auto;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ---- Upload Form ---- */
.hrm-upload-section {
    background: #FFFFFF;
    border: 2px solid #D5E8F0;
    border-radius: 10px;
    padding: 32px;
    margin-bottom: 24px;
}

.hrm-form-group {
    margin-bottom: 20px;
}

.hrm-form-row {
    display: flex;
    gap: 20px;
}

.hrm-form-half {
    flex: 1;
}

.hrm-label {
    display: block;
    font-weight: 600;
    color: #2C4A6E;
    margin-bottom: 6px;
    font-size: 0.95rem;
}

.hrm-optional {
    font-weight: 400;
    color: #6B8FAD;
    font-size: 0.85rem;
}

.hrm-file-input {
    display: block;
    width: 100%;
    padding: 12px;
    border: 2px dashed #B0C4D8;
    border-radius: 8px;
    background: #F8FBFD;
    cursor: pointer;
    font-size: 0.95rem;
    transition: border-color 0.2s ease;
}

.hrm-file-input:hover {
    border-color: #4A7CAA;
}

.hrm-text-input {
    display: block;
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #B0C4D8;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    text-transform: uppercase;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.hrm-text-input:focus {
    border-color: #4A7CAA;
    box-shadow: 0 0 0 3px rgba(74, 124, 170, 0.15);
    outline: none;
}

.hrm-helper {
    display: block;
    font-size: 0.82rem;
    color: #6B8FAD;
    margin-top: 4px;
    line-height: 1.4;
}

.hrm-privacy-notice {
    background: #F0F7EC;
    border: 1px solid #C5DFB6;
    border-radius: 6px;
    padding: 10px 16px;
    font-size: 0.88rem;
    color: #3D6B2E;
    margin-bottom: 12px;
}

.hrm-info-notice {
    background: #F0F4F8;
    border: 1px solid #C0D4E4;
    border-radius: 6px;
    padding: 10px 16px;
    font-size: 0.85rem;
    color: #3A5A7A;
    margin-bottom: 12px;
}

.hrm-limit-notice {
    font-size: 0.82rem;
    color: #888;
    text-align: center;
    margin-bottom: 16px;
}

.hrm-help-link {
    text-align: center;
    font-size: 0.85rem;
    color: #6B8FAD;
    margin-bottom: 16px;
}

.hrm-help-anchor {
    color: #4A7CAA;
    text-decoration: none;
    font-weight: 500;
}

.hrm-help-anchor:hover {
    text-decoration: underline;
    color: #2C4A6E;
}

.hrm-upload-error {
    background: #FFF5F5;
    border: 1px solid #E8B4B4;
    border-radius: 6px;
    padding: 12px 16px;
    font-size: 0.88rem;
    color: #9B2C2C;
    margin-bottom: 16px;
    line-height: 1.5;
}

.hrm-upload-btn {
    display: block;
    width: 100%;
    padding: 14px 28px;
    background-color: #2C4A6E;
    color: #FFFFFF;
    border: none;
    border-radius: 8px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.hrm-upload-btn:hover:not(:disabled) {
    background-color: #4A7CAA;
    transform: translateY(-1px);
}

.hrm-upload-btn:disabled {
    background-color: #B0C4D8;
    cursor: not-allowed;
    transform: none;
}

/* ---- Progress Bar ---- */
.hrm-progress {
    text-align: center;
    padding: 40px 20px;
}

.hrm-progress-bar {
    width: 100%;
    height: 8px;
    background: #D5E8F0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.hrm-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2C4A6E, #4A7CAA);
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
}

.hrm-progress-text {
    color: #4A7CAA;
    font-size: 0.95rem;
    font-weight: 500;
}

/* ---- Map Section ---- */
.hrm-map-section {
    margin-bottom: 24px;
}

.hrm-controls {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

.hrm-band-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.hrm-band-filters-label {
    font-size: 0.78rem;
    color: #888;
    font-style: italic;
    margin-right: 2px;
}

.hrm-band-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 2px solid;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.1s ease;
    user-select: none;
}

.hrm-band-toggle:hover {
    transform: scale(1.05);
}

/* ---- Geo Stats Bar ---- */
.hrm-geo-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.hrm-geo-stat {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border: 1.5px solid;
    border-radius: 16px;
    font-size: 0.82rem;
    font-weight: 500;
    color: #555;
    background: #fff;
}

.hrm-geo-stat-num {
    font-weight: 700;
    font-size: 0.95rem;
}

.hrm-geo-stat-total {
    font-size: 0.82rem;
    color: #888;
    font-weight: 600;
    padding-left: 4px;
}

/* Hide geo stats during export */
.hrm-exporting .hrm-geo-stats {
    display: none !important;
}

.hrm-band-toggle.inactive {
    opacity: 0.35;
}

.hrm-band-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.hrm-export-area {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.hrm-guidance-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #EEF6FF;
    border: 1px solid #B8D4F0;
    border-radius: 6px;
    padding: 10px 16px;
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: #2C5282;
    line-height: 1.5;
}

.hrm-guidance-text {
    flex: 1;
}

.hrm-guidance-dismiss {
    background: none;
    border: none;
    color: #6B8FAD;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0 0 0 12px;
    line-height: 1;
}

.hrm-guidance-dismiss:hover {
    color: #2C5282;
}

/* Hide guidance banner in fullscreen and during export */
.hrm-fullscreen .hrm-guidance-banner,
.hrm-exporting .hrm-guidance-banner {
    display: none;
}

.hrm-exporting .hrm-band-filters-label {
    display: none;
}

.hrm-export-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.hrm-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-family: inherit;
}

.hrm-btn-secondary {
    background: #D5E8F0;
    color: #2C4A6E;
}

.hrm-btn-secondary:hover {
    background: #B0D4E8;
}

.hrm-btn-toggle {
    background: #2C4A6E;
    color: #FFFFFF;
}

.hrm-btn-toggle:hover {
    background: #4A7CAA;
}

.hrm-btn-toggle.active {
    background: #4A7CAA;
}

.hrm-map {
    width: 100%;
    height: 600px;
    border-radius: 10px;
    border: 2px solid #D5E8F0;
    z-index: 0;
}

/* ---- Legend ---- */
.hrm-legend {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 16px;
    background: #F8FBFD;
    border: 1px solid #D5E8F0;
    border-radius: 0 0 10px 10px;
    font-size: 0.82rem;
    color: #333;
    margin-top: -2px;
}

.hrm-legend-bands {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
}

.hrm-legend-copyright {
    text-align: center;
    font-size: 0.75rem;
    color: #6B8FAD;
    border-top: 1px solid #D5E8F0;
    padding-top: 6px;
    margin-top: 2px;
}

.hrm-legend-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 6px 0 2px;
    border-top: 1px solid #D5E8F0;
    font-size: 0.80rem;
    color: #4A6A8A;
}

.hrm-legend-stat {
    white-space: nowrap;
}

.hrm-legend-stat strong {
    color: #2C4A6E;
    font-weight: 600;
}

.hrm-legend-stat-sep {
    color: #B0C4D8;
    padding: 0 2px;
}

.hrm-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.hrm-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.hrm-legend-dot.level-3 {
    border: 2px solid rgba(0,0,0,0.3);
    box-sizing: border-box;
}

.hrm-legend-dot.level-5 {
    opacity: 0.45;
}

/* ---- Summary Panel ---- */
.hrm-summary {
    background: #FFFFFF;
    border: 2px solid #D5E8F0;
    border-radius: 10px;
    padding: 28px 32px;
}

.hrm-summary h3 {
    color: #2C4A6E;
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 1.2rem;
}

.hrm-summary-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
}

.hrm-stat-card {
    flex: 1;
    min-width: 120px;
    background: #F8FBFD;
    border: 1px solid #D5E8F0;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
}

.hrm-stat-number {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: #2C4A6E;
    line-height: 1;
}

.hrm-stat-label {
    display: block;
    font-size: 0.78rem;
    color: #6B8FAD;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.hrm-summary-breakdown {
    margin-bottom: 16px;
    font-size: 0.92rem;
    line-height: 1.7;
    color: #333;
}

.hrm-summary-breakdown strong {
    color: #2C4A6E;
}

.hrm-unmapped-list {
    background: #FFF9F0;
    border: 1px solid #F0DFC0;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 0.88rem;
    color: #8B6914;
}

.hrm-unmapped-list strong {
    color: #6B4D00;
}

.hrm-summary-notes {
    font-size: 0.85rem;
    color: #6B8FAD;
    line-height: 1.6;
}

.hrm-summary-notes p {
    margin: 6px 0;
}

.hrm-attribution {
    text-align: right;
    font-size: 0.78rem;
    color: #999;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #E8EEF2;
}

.hrm-attribution a {
    color: #6B8FAD;
    text-decoration: none;
}

.hrm-attribution a:hover {
    text-decoration: underline;
}

/* ---- Custom Leaflet Markers ---- */
.hrm-marker {
    border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,0.9);
    box-shadow: 0 0 3px rgba(0,0,0,0.3);
}

.hrm-marker.level-3 {
    border: 1px solid rgba(0,0,0,0.2);
}

.hrm-marker.level-5 {
    opacity: 0.4;
}

.hrm-activator-marker {
    font-size: 24px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

/* ---- Cluster Overrides ---- */
.marker-cluster {
    background-color: rgba(44, 74, 110, 0.25) !important;
}

.marker-cluster div {
    background-color: rgba(44, 74, 110, 0.7) !important;
    color: #FFFFFF !important;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
}

/* ---- Leaflet Popup ---- */
.hrm-popup {
    font-family: 'Inter', sans-serif;
    font-size: 0.88rem;
    line-height: 1.5;
}

.hrm-popup-call {
    font-weight: 700;
    font-size: 1.05rem;
    color: #2C4A6E;
}

.hrm-popup-detail {
    color: #666;
    font-size: 0.82rem;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .hrm-upload-section {
        padding: 20px;
    }

    .hrm-form-row {
        flex-direction: column;
        gap: 0;
    }

    .hrm-controls {
        flex-direction: column;
    }

    .hrm-map {
        height: 450px;
    }

    .hrm-summary-stats {
        flex-direction: column;
    }

    .hrm-stat-card {
        min-width: auto;
    }
}

/* ---- Lines Button — secondary style until active ---- */
.hrm-btn-lines {
    background: #D5E8F0;
    color: #2C4A6E;
}

.hrm-btn-lines:hover {
    background: #B0D4E8;
}

.hrm-btn-lines.active {
    background: #2C4A6E;
    color: #FFFFFF;
}

/* ---- Line Speed Selector ---- */
.hrm-lines-control-group {
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.hrm-lines-speed {
    padding: 7px 10px !important;
    border: 1px solid #B0C4D8 !important;
    border-radius: 6px !important;
    font-size: 0.85rem !important;
    font-family: inherit !important;
    background: #F8FBFD !important;
    color: #2C4A6E !important;
    cursor: pointer !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 130px !important;
    height: 36px !important;
    box-sizing: border-box !important;
}

.hrm-lines-speed:hover,
.hrm-lines-speed:focus {
    border-color: #4A7CAA !important;
    outline: none !important;
}

/* ---- Contact Lines Warning ---- */
.hrm-lines-warning {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #FFF8E6;
    border: 1px solid #F0D080;
    border-radius: 6px;
    padding: 10px 16px;
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: #7A5800;
    line-height: 1.5;
}

.hrm-lines-warning strong {
    color: #5A3E00;
}

.hrm-lines-warning-dismiss {
    background: none;
    border: none;
    color: #A07820;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0 0 0 12px;
    line-height: 1;
    flex-shrink: 0;
}

.hrm-lines-warning-dismiss:hover {
    color: #5A3E00;
}

/* ---- PNG Export: hide controls during capture ---- */
.hrm-exporting .hrm-controls,
.hrm-exporting .leaflet-control-zoom,
.hrm-exporting .leaflet-control-layers {
    display: none !important;
}

.hrm-exporting .hrm-guidance-banner {
    display: none !important;
}

/* Hide the filter label in export but keep legend */
.hrm-exporting .hrm-band-filters-label {
    display: none;
}
.hrm-exporting .hrm-map {
    border-radius: 0;
    border: none;
}

.hrm-exporting .hrm-legend {
    border-radius: 0;
}

/* ---- Fullscreen Mode ---- */
.hrm-map-section.hrm-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    background: #FFFFFF;
    margin: 0;
    padding: 0;
    display: flex !important;
    flex-direction: column;
}

.hrm-fullscreen .hrm-controls {
    padding: 10px 16px;
    background: #FFFFFF;
    border-bottom: 1px solid #D5E8F0;
    flex-shrink: 0;
    z-index: 10;
}

.hrm-fullscreen .hrm-map {
    flex: 1;
    height: 0 !important;
    min-height: 0;
    border-radius: 0;
    border: none;
}

.hrm-fullscreen .hrm-legend {
    border-radius: 0;
    flex-shrink: 0;
}
