.container {
    display: flex;
    height: 100vh;
    font-family: Arial, sans-serif;
}

.sidebar {
    width: 350px;
    background: #f8f9fa;
    border-right: 1px solid #dee2e6;
    padding: 20px;
    overflow-y: auto;
    box-sizing: border-box;
}

.map-container {
    flex: 1;
    position: relative;
}

.header {
    margin-bottom: 8px;
    text-align: center;
}

.header h1 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.2em;
}

.search-section {
    margin-bottom: 20px;
}

.welcome-message {
    text-align: center;
    margin-top: 0px;
    margin-bottom: 0;
    padding: 5px 8px;
    background: #e7f3ff;
    border-radius: 4px;
    font-size: 0.9em;
    color: #2c3e50;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.welcome-message a {
    color: #007bff;
    text-decoration: none;
    font-weight: 600;
}

.welcome-message a:hover {
    text-decoration: underline;
}

/* Callsign Badge */
.callsign-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #e7f3ff;
    border: 1px solid #90caf9;
    border-radius: 4px;
    margin-bottom: 10px;
}

.callsign-badge-text {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: #1976d2;
    text-transform: uppercase;
}

.callsign-badge-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: #1976d2;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    transition: background-color 0.2s;
}

.callsign-badge-close:hover {
    background-color: rgba(25, 118, 210, 0.1);
}

/* POTA Search Results (Autocomplete) */
.pota-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ced4da;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-top: -1px;
}

.pota-search-result-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}

.pota-search-result-item:last-child {
    border-bottom: none;
}

.pota-search-result-item:hover {
    background-color: #e7f3ff;
}

.pota-result-reference {
    font-weight: 600;
    color: #1976d2;
    font-size: 13px;
}

.pota-result-name {
    font-size: 12px;
    color: #555;
    margin-top: 2px;
}

/* Search Box */
.search-section .search-box {
    display: flex !important;
    gap: 0;
    margin-bottom: 0px;
    width: 100%;
    position: relative;
}

.search-section #callsignInput {
    flex: 1 !important;
    padding: 10px 40px 10px 12px !important;
    border: 1px solid #ced4da !important;
    border-radius: 4px !important;
    font-size: 14px !important;
    text-transform: uppercase;
    background: white !important;
    box-sizing: border-box;
    margin: 0;
    width: auto !important;
}

#callsignInput::placeholder {
    font-size: 12px;
    color: #999;
    text-transform: none;
}

.search-section #callsignInput:focus {
    outline: none !important;
    border-color: #3498db !important;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.search-section #searchButton {
    position: absolute !important;
    right: 5px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background: none !important;
    border: none !important;
    cursor: pointer;
    font-size: 18px !important;
    padding: 4px !important;
    color: #555;
    transition: color 0.2s;
}

.search-section #searchButton:hover {
    color: #007bff !important;
}

.search-section #searchButton:disabled {
    color: #ccc !important;
    cursor: not-allowed;
}

.search-status {
    padding: 10px;
    border-radius: 4px;
    text-align: center;
    font-weight: 500;
    min-height: 20px;
}

.search-status.loading {
    background: #e3f2fd;
    color: #1976d2;
}

.search-status.success {
    background: #e8f5e8;
    color: #2e7d32;
}

.search-status.error {
    background: #ffebee;
    color: #c62828;
}

.stats-section {
    margin-bottom: 20px;
}

.stats-subsection {
    margin-bottom: 20px;
}

.stats-subsection:last-child {
    margin-bottom: 0;
}

.stats-subsection h4 {
    margin: 0 0 12px 0;
    color: #2c3e50;
    font-size: 1em;
    font-weight: 600;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 6px;
}

/* Modern Stats Container */
.stats-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* Full-width stat box (Activations, Parks) */
.stat-box-full {
    grid-column: 1 / -1;
    background: white;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    text-align: center;
}

.stat-box-title {
    margin: 0 0 10px 0;
    font-size: 0.75em;
    font-weight: 700;
    color: #2c3e50;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-columns {
    display: flex;
    justify-content: center;
    gap: 30px;
}

.stat-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

/* Half-width stat box (QSOs, Entities, Hunted Parks) */
.stat-box-half {
    background: white;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-number {
    display: block;
    font-size: 1.4em;
    font-weight: 700;
    color: #007bff;
    line-height: 1;
}

.stat-label {
    font-size: 0.7em;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.csv-timestamp-section {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.csv-timestamp-label {
    font-size: 0.85em;
    color: #6c757d;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.csv-timestamp-value {
    font-size: 0.9em;
    color: #2c3e50;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

.upload-section {
    margin-bottom: 20px;
}

.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 1.1em;
}

.collapse-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.collapse-toggle:hover {
    background-color: #f8f9fa;
}

.collapse-toggle .arrow {
    font-size: 14px;
    color: #6c757d;
    transition: transform 0.3s ease;
    display: inline-block;
}

.collapse-toggle.collapsed .arrow {
    transform: rotate(-90deg);
}

.upload-content {
    transition: max-height 0.3s ease, opacity 0.3s ease;
    overflow: hidden;
    max-height: 1000px;
    opacity: 1;
}

.upload-content.collapsed {
    max-height: 0;
    opacity: 0;
}

.upload-form {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.upload-description {
    margin: 0 0 15px 0;
    color: #6c757d;
    font-size: 0.9em;
    line-height: 1.4;
}

.file-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.file-button {
    padding: 10px 15px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.file-button:hover {
    background: #5a6268;
}

.file-name {
    font-size: 0.9em;
    color: #495057;
    font-style: italic;
}

.upload-validation {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 15px;
}

.validation-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.validation-info:last-of-type {
    margin-bottom: 12px;
}

.validation-label {
    font-size: 0.9em;
    color: #6c757d;
}

.validation-count {
    font-weight: bold;
    color: #2c3e50;
}

.validation-status {
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.9em;
    font-weight: 500;
    text-align: center;
}

.validation-status.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.validation-status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.validation-status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.upload-button {
    width: 100%;
    padding: 12px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 15px;
}

.upload-button:hover:not(:disabled) {
    background: #218838;
}

.upload-button:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.upload-progress {
    margin-bottom: 15px;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: #007bff;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    text-align: center;
    font-size: 0.9em;
    color: #6c757d;
}

.upload-results {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 15px;
}

.upload-results h4 {
    margin: 0 0 10px 0;
    color: #2c3e50;
}

.upload-results .result-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 0.9em;
}

.upload-results .result-label {
    color: #6c757d;
}

.upload-results .result-value {
    font-weight: bold;
    color: #2c3e50;
}

.activations-section {
    margin-bottom: 20px;
}

.activations-section h3 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 1.3em;
}

.activations-list {
    max-height: 300px;
    overflow-y: auto;
}

.activation-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 10px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: all 0.2s ease;
}

.activation-item:hover {
    background: #f8f9fa;
    border-color: #007bff;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.activation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.activation-reference {
    font-weight: bold;
    color: #007bff;
    font-size: 1.1em;
}

.activation-date {
    font-size: 0.9em;
    color: #6c757d;
}

.activation-name {
    color: #2c3e50;
    margin-bottom: 5px;
    font-size: 0.95em;
}

.activation-details {
    display: flex;
    justify-content: space-between;
    font-size: 0.85em;
    color: #6c757d;
}

.activation-qsos {
    font-weight: 500;
}

.activation-entity {
    font-style: italic;
}

.custom-marker {
    background: transparent !important;
    border: none !important;
}

.custom-marker div {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.custom-marker:hover div {
    transform: scale(1.2);
}

.custom-cluster-marker {
    background: transparent !important;
    border: none !important;
}

.custom-cluster-marker div {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.custom-cluster-marker:hover div {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3) !important;
}

.custom-cluster-marker.enhanced {
    background: transparent !important;
    border: none !important;
}

.custom-cluster-marker.enhanced .advanced-cluster {
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
    will-change: transform, box-shadow;
}

.custom-cluster-marker.enhanced:hover .advanced-cluster {
    transform: scale(1.12) translateY(-1px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.25), 0 4px 12px rgba(0,0,0,0.15) !important;
    filter: brightness(1.05);
}

.custom-cluster-marker.enhanced:active .advanced-cluster {
    transform: scale(1.05);
    transition: all 0.1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Enhanced individual marker styling */
.custom-marker div {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, box-shadow;
}

.custom-marker:hover div {
    transform: scale(1.25) translateY(-1px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.25), 0 2px 8px rgba(0,0,0,0.15) !important;
    filter: brightness(1.1);
}

/* Responsive cluster sizing */
@media (max-width: 768px) {
    .custom-cluster-marker.enhanced .advanced-cluster {
        font-size: 12px !important;
    }

    .custom-cluster-marker.enhanced:hover .advanced-cluster {
        transform: scale(1.08) translateY(-1px);
    }
}

.legend-section {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

.legend-section h4 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 1em;
    font-weight: 600;
    text-align: center;
}

.legend-items {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 6px;
    background: white;
    border-radius: 3px;
    border: 1px solid #e9ecef;
    font-size: 0.85em;
}

.legend-marker {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
    flex-shrink: 0;
}

.legend-marker-green {
    background-color: #28a745;
}

.legend-marker-red {
    background-color: #dc3545;
}

.legend-marker-split {
    background: linear-gradient(90deg, #dc3545 50%, #28a745 50%);
}

.legend-marker-yellow {
    background-color: #ffc107;
    width: 10px;
    height: 10px;
}

.legend-marker-grey {
    background-color: #6c757d;
    width: 10px;
    height: 10px;
}

.legend-text {
    color: #2c3e50;
    font-weight: 500;
}

/* Compact Popup Styles for MyPOTA */
.mypota-popup-compact {
    font-size: 10px !important;
}

.mypota-popup-compact .popup-close-btn {
    transition: opacity 0.2s ease, transform 0.1s ease;
}

.mypota-popup-compact .popup-close-btn:hover {
    opacity: 1 !important;
    transform: scale(1.1);
}

.mypota-popup-compact .popup-close-btn:active {
    transform: scale(0.95);
}

/* Override Leaflet popup defaults for compact popups */
.leaflet-popup-content-wrapper {
    border-radius: 4px;
    box-shadow: 0 3px 14px rgba(0,0,0,0.3);
}

.leaflet-popup-content {
    margin: 0;
    line-height: 1.4;
}

.leaflet-popup-tip-container {
    margin-top: -1px;
}

/* Hide Leaflet's default close button (we have our own) */
.leaflet-popup-close-button {
    display: none !important;
}

/* Clear All Button Control */
.leaflet-control-clear-all-container {
    margin: 10px;
}

.clear-all-button {
    background: linear-gradient(145deg, #ffffff, #f1f3f4);
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.clear-button-label {
    font-size: 9px;
    line-height: 1;
    text-align: center;
    color: #495057;
    pointer-events: none;
}

.clear-all-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.clear-all-button:hover {
    background: linear-gradient(145deg, #007bff, #0056b3);
    color: white;
    border-color: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.3);
}

.clear-all-button:hover .clear-button-label {
    color: white;
}

.clear-all-button:hover::before {
    left: 100%;
}

.clear-all-button:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.2);
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #dee2e6;
    }

    .map-container {
        height: 60vh;
    }

    .stats-container {
        grid-template-columns: 1fr;
    }

    .stat-box-half {
        grid-column: 1;
    }

    .stat-columns {
        gap: 20px;
    }

    .mypota-popup-compact {
        font-size: 9px !important;
    }
}

/* Language Controls for MyPOTA */
.language-controls {
    display: flex;
    gap: 8px;
    padding: 15px;
    border-top: 1px solid #dee2e6;
    margin-top: auto;
}

.language-button {
    background: linear-gradient(145deg, #ffffff, #f1f3f4);
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #495057;
    text-decoration: none;
    flex: 1;
    justify-content: center;
}

.language-button:hover {
    background: linear-gradient(145deg, #0056b3, #004085);
    color: white;
    border-color: #004085;
}

.language-button.active {
    background: linear-gradient(145deg, #007bff, #0056b3);
    color: white;
    border-color: #0056b3;
}

.lang-icon {
    font-size: 14px;
}

.lang-text {
    font-size: 11px;
    font-weight: 500;
}