* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100vh;
    overflow: hidden;
}

.container {
    display: flex;
    height: 100vh;
    transition: margin-left 0.3s ease, height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Map container positioning is handled by JavaScript transforms */

.map-container {
    flex: 1;
    position: relative;
    transition: transform 0.3s ease;
}

#map {
    height: 100%;
    width: 100%;
}

.right-sidebar {
    position: fixed;
    top: 0;
    right: -400px !important;
    width: 400px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 10px;
    overflow-y: auto;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    z-index: 1002;
}

/* Ensure the sidebar is hidden by default */
.right-sidebar:not(.open) {
    right: -400px !important;
}

.right-sidebar.open {
    right: 0 !important;
    background: rgba(255, 255, 255, 0.98) !important;
    z-index: 2500;
}


.right-sidebar .control-section {
    display: block;
}

.right-sidebar .header-text {
    display: block;
}

.right-sidebar .header {
    display: block;
}

.right-sidebar .control-sections-container {
    display: block;
}

.header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.tour-btn-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 20px;
    color: white;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.tour-btn-header:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.about-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s;
    color: #333;
}

.about-btn:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.header-text {
    text-align: center;
    flex: 1;
}

.toggle-btn {
    background: #3498db;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.toggle-btn:hover {
    background: #2980b9;
}

.right-sidebar:not(.open) .toggle-btn {
    display: none;
}

/* Floating toggle button when sidebar is collapsed */
.floating-toggle-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1003;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: 2px solid #ecf0f1;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Hide floating button when right sidebar is open */
.container.right-sidebar-open .floating-toggle-btn {
    display: none !important;
}

.floating-toggle-btn:hover {
    background: linear-gradient(135deg, #2980b9 0%, #3498db 100%);
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
}

.floating-toggle-btn.show {
    display: flex;
}

/* Enhance train emoji visibility */
.floating-toggle-btn {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    filter: brightness(1.1) contrast(1.1);
}

.floating-toggle-btn:hover {
    filter: brightness(1.2) contrast(1.2);
}

/* Events floating button in bottom left */
.events-floating-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1003;
    transition: bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    border: 2px solid #ecf0f1;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.events-floating-btn:hover {
    background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
}

.events-floating-btn img {
    width: 24px;
    height: 24px;
    filter: brightness(1.2) contrast(1.1);
    transition: filter 0.3s ease;
}

.events-floating-btn:hover img {
    filter: brightness(1.4) contrast(1.2);
}

/* Hide events button when left sidebar is open (higher priority) */
.container.left-sidebar-open .events-floating-btn {
    display: none;
}

/* Move events button up when alert panel is open (but not when events panel is open) */
.container.alert-panel-open .events-floating-btn {
    bottom: 180px; /* 20px + 160px (alert panel height) */
}

/* Left sidebar for events */
.left-sidebar {
    position: fixed;
    top: 0;
    left: -400px !important;
    width: 400px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.1);
    transition: left 0.3s ease;
    z-index: 1001;
    overflow-y: auto;
    padding: 10px;
    display: block;
}

/* Ensure the left sidebar is hidden by default */
.left-sidebar:not(.open) {
    left: -400px !important;
}

.left-sidebar.open {
    left: 0 !important;
    z-index: 2500;
}

.left-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.event-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.clear-events-btn {
    background: #2c3e50;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.clear-events-btn:hover {
    background: #34495e;
}

.left-sidebar-header h2 {
    color: #333;
    font-size: 18px;
    margin: 0;
}

.close-left-sidebar-btn {
    background: #2c3e50;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.close-left-sidebar-btn:hover {
    background: #34495e;
}

.close-left-sidebar-btn img {
    width: 16px;
    height: 16px;
    filter: brightness(1.2) contrast(1.1);
}

.left-sidebar-content {
    color: #666;
    padding: 0;
}

.event-filters {
    display: flex;
    gap: 4px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 6px 10px;
    border: 1px solid #dee2e6;
    background: white;
    border-radius: 15px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 0;
}

.filter-btn:hover {
    background: #f8f9fa;
    border-color: #667eea;
}

.filter-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.events-list {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    padding-right: 5px;
}

.events-list::-webkit-scrollbar {
    width: 4px;
}

.events-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

.events-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 2px;
}

.events-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.no-events {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.no-events p {
    margin-bottom: 8px;
    font-size: 14px;
}

.no-events small {
    font-size: 12px;
}

.event-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 8px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.event-item:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.event-item.expanded {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.event-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.event-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.event-type {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.event-type.train {
    color: #28a745;
}

.event-type.station {
    color: #17a2b8;
}

.event-type.alert {
    color: #dc3545;
}

.event-time {
    font-size: 10px;
    color: #999;
    margin-left: auto;
}

.event-brief {
    font-size: 12px;
    color: #333;
    line-height: 1.4;
    margin-bottom: 4px;
}

.event-details {
    display: none;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
}

.event-item.expanded .event-details {
    display: block;
}

.event-detail-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    font-size: 11px;
}

.event-detail-label {
    color: #666;
    font-weight: 500;
}

.event-detail-value {
    color: #333;
    font-weight: 600;
    text-align: right;
    max-width: 60%;
    word-break: break-word;
}

.event-topic {
    font-size: 10px;
    color: #999;
    font-family: monospace;
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
    margin-top: 6px;
}


/* Alert bottom panel */
.alert-bottom-panel {
    position: fixed;
    bottom: -160px;
    left: 0;
    right: 0;
    width: 100%;
    height: 160px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.95) 100%);
    backdrop-filter: blur(15px);
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.12), 0 -2px 8px rgba(0, 0, 0, 0.08);
    transition: bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1002;
    overflow-y: auto;
    padding: 10px;
    display: block;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.alert-bottom-panel.open {
    bottom: 0;
}

/* Push content up when alert panel is open */
.container.alert-panel-open {
    height: calc(100vh - 160px) !important;
}


/* Responsive behavior when alert panel is open */
/* Make right sidebar content scrollable and adjust height */
.container.alert-panel-open .right-sidebar.open {
    height: calc(100vh - 160px);
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Prevent the entire panel from scrolling */
}

.container.alert-panel-open .right-sidebar .header {
    flex-shrink: 0; /* Keep header fixed size */
}

/* Make the control sections container scrollable */
.container.alert-panel-open .right-sidebar .control-sections-container {
    flex: 1; /* Take remaining space after header */
    overflow-y: auto; /* Make this container scrollable */
    padding: 0; /* Remove any default padding */
}

/* Reset individual control section styling */
.container.alert-panel-open .right-sidebar .control-section {
    /* Reset any individual styling */
    flex: none;
    overflow: visible;
    max-height: none;
}

/* Make left sidebar content scrollable and adjust height */
.container.alert-panel-open .left-sidebar.open {
    height: calc(100vh - 160px);
}

.container.alert-panel-open .left-sidebar-content {
    max-height: calc(100vh - 240px); /* Account for header and padding */
    overflow-y: auto;
}

.alert-bottom-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(139, 69, 19, 0.1);
    position: relative;
}

.alert-bottom-panel-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: #dee2e6;
    border-radius: 1px;
}

.alert-bottom-panel-header h2 {
    color: #2c3e50;
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-bottom-panel-header h2::before {
    font-size: 18px;
}

.close-alert-panel-btn {
    background: linear-gradient(135deg, #8e44ad 0%, #9b59b6 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(142, 68, 173, 0.3);
}

.close-alert-panel-btn:hover {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(142, 68, 173, 0.4);
}

.close-alert-panel-btn img {
    width: 16px;
    height: 16px;
    filter: brightness(1.2) contrast(1.1);
}

.alert-bottom-panel-content {
    color: #666;
    padding: 0;
    height: auto;
    min-height: calc(100% - 50px);
    max-height: calc(100% - 50px);
    overflow: visible;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.alert-bottom-panel-content::-webkit-scrollbar {
    width: 4px;
}

.alert-bottom-panel-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 2px;
}

.alert-bottom-panel-content::-webkit-scrollbar-thumb {
    background: rgba(142, 68, 173, 0.3);
    border-radius: 2px;
}

.alert-bottom-panel-content::-webkit-scrollbar-thumb:hover {
    background: rgba(142, 68, 173, 0.5);
}


/* Train icons grid */
.train-icons-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 20px;
    width: 100%;
    margin: 0;
    padding: 4px 8px;
    align-content: start;
    min-height: fit-content;
    box-sizing: border-box;
}

.train-icon-btn {
    width: 100%;
    height: 60px;
    border-radius: 12px;
    border: 2px solid #e1e5e9;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    color: #495057;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 0 auto;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    overflow: visible;
}

.train-icon-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #6c757d 0%, #adb5bd 100%);
    transition: all 0.3s ease;
}

.train-icon-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: #8e44ad;
}

.train-icon-btn.enabled {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-color: #28a745;
    color: #155724;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.2);
}

.train-icon-btn.enabled::before {
    background: linear-gradient(90deg, #28a745 0%, #20c997 100%);
}

.train-icon-btn.enabled:hover {
    background: linear-gradient(135deg, #c3e6cb 0%, #b8dacc 100%);
    border-color: #1e7e34;
    box-shadow: 0 4px 16px rgba(40, 167, 69, 0.3);
}

.train-icon-btn.disabled {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

/* Alert Menu Styles */
.alert-menu {
    position: fixed;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    min-width: 180px;
    padding: 8px 0;
    margin-bottom: 4px;
}

/* Alert flag styles */
.alert-flag {
    position: absolute;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    z-index: 2500; /* Above train markers (2000) and hints */
    cursor: pointer;
    transform: translate(-50%, -50%);
    transition: all 0.2s ease;
    text-shadow: none; /* remove heavy shadow on flag content */
}

.alert-flag:hover {
    transform: translate(-50%, -50%) scale(1.2);
    text-shadow: none;
}

.alert-flag::before {
    content: '🚩';
    font-size: 24px;
}

.alert-flag-tooltip {
    position: absolute;
    background: white;
    color: #2c3e50;
    padding: 0;
    border-radius: 8px;
    font-size: 12px;
    font-family: 'Segoe UI', sans-serif;
    white-space: nowrap;
    z-index: 10001;
    pointer-events: auto;
    opacity: 0;
    transition: opacity 0.2s ease;
    transform: translate(-50%, -50%);
    margin-top: -8px;
    min-width: 200px;
    max-width: 360px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    border: 1px solid #dee2e6;
    text-align: center;
}
.alert-train-line {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 6px 0;
}

.alert-train-line .emoji {
    font-size: 16px;
    line-height: 1.2;
}

.alert-train-text {
    color: #2c3e50;
    font-size: 13px;
    font-weight: 500;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.alert-flag-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: white;
}

.alert-flag:hover .alert-flag-tooltip {
    opacity: 1;
}

.alert-tooltip-content {
    text-align: left;
    font-family: 'Segoe UI', sans-serif;
    min-width: 300px;
    padding: 14px 16px 12px 16px;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

.alert-tooltip-header {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    text-shadow: none; /* remove shadow in header */
}

/* Badge for alert type pills */
.alert-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 999px;
    background: #eef2f7;
    color: #2c3e50;
    font-size: 11px;
    font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.03);
}

.alert-type-badge .emoji {
    font-size: 14px;
}

.alert-type-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 6px 0;
}

.alert-tooltip-details {
    background: #f8f9fb;
    border-radius: 8px;
    padding: 10px 12px;
    margin: 8px 0 10px 0;
}

.alert-tooltip-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 4px 0;
    font-size: 12px;
}

.alert-tooltip-detail-label {
    color: #6c757d;
    font-weight: 600;
}

.alert-tooltip-detail-value {
    color: #2c3e50;
    font-weight: 500;
}

.alert-serve-button {
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 4px;
    align-self: flex-end;
    box-shadow: 0 2px 6px rgba(39, 174, 96, 0.35);
}

.alert-serve-button:hover {
    background: #229954;
    transform: translateY(-1px);
}

.alert-serve-button:active {
    background: #1e8449;
    transform: translateY(0);
}

/* Close button (top-right) */
.alert-tooltip-close {
    position: absolute;
    top: 6px;
    right: 8px;
    width: 20px;
    height: 20px;
    line-height: 18px;
    text-align: center;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    background: #fff;
    color: #6c757d;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.alert-tooltip-close:hover {
    background: #f1f3f5;
    color: #343a40;
}

/* Blinking animation for served alerts - but not the tooltip */
.alert-flag.served {
    animation: alertBlink 1s infinite;
}

.alert-flag.served .alert-flag-tooltip,
.alert-flag.served:hover .alert-flag-tooltip {
    animation: none !important;
    opacity: 0 !important;
    display: none !important;
    transition: none !important;
    pointer-events: none !important;
}

@keyframes alertBlink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}

.alert-menu::before {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid white;
}

.alert-menu-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-size: 12px;
    color: #333;
}

.alert-menu-item:hover {
    background-color: #f8f9fa;
}

.alert-menu-item .icon {
    margin-right: 8px;
    font-size: 14px;
}

.alert-menu-item .text {
    flex: 1;
}


.train-icon-btn.disabled::before {
    background: linear-gradient(90deg, #6c757d 0%, #adb5bd 100%);
}

.train-icon-btn.disabled:hover {
    transform: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Train number styling */
.train-icon-btn .train-number {
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 2px;
}

/* Status indicator dot */
.train-icon-btn .status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #6c757d;
    transition: all 0.3s ease;
}

.train-icon-btn.enabled .status-dot {
    background: #28a745;
    box-shadow: 0 0 6px rgba(40, 167, 69, 0.5);
}

.train-icon-btn.disabled .status-dot {
    background: #6c757d;
}

.header h1 {
    color: #333;
    font-size: 20px;
    margin-bottom: 3px;
}

.header p {
    color: #666;
    font-size: 12px;
}

.control-section {
    margin-bottom: 25px;
}

.control-section h3 {
    color: #333;
    font-size: 14px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.control-section h3::before {
    content: '';
    width: 3px;
    height: 16px;
    background: #667eea;
    margin-right: 8px;
    border-radius: 2px;
}

/* Section header with title and controls */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.section-header h3 {
    margin-bottom: 0;
}

/* Publish events control */
.simulation-header-controls {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.generate-alerts-control,
.publish-events-control {
    display: flex;
    align-items: center;
    gap: 6px;
}

.generate-alerts-checkbox,
.publish-events-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.simulation-header-controls label {
    font-size: 12px;
    color: #666;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    line-height: 1.2;
}

.section-header h3 {
    margin-bottom: 0;
}

.realtime-toggle {
    display: flex;
    align-items: center;
}

.toggle-checkbox {
    display: none;
}

.toggle-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 12px;
    color: #666;
    transition: color 0.2s ease;
}

.toggle-label:hover {
    color: #333;
}

.toggle-text {
    position: relative;
    padding-left: 25px;
}

.toggle-text::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid #ddd;
    border-radius: 3px;
    background: #fff;
    transition: all 0.2s ease;
}

.toggle-checkbox:checked + .toggle-label .toggle-text::before {
    background: #667eea;
    border-color: #667eea;
}

.toggle-checkbox:checked + .toggle-label .toggle-text::after {
    content: '✓';
    position: absolute;
    left: 2px;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 10px;
    font-weight: bold;
}

.toggle-checkbox:checked + .toggle-label .toggle-text {
    color: #667eea;
    font-weight: 500;
}

.realtime-section {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.time-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    /* padding: 8px 12px; */
    background: #f8f9fa;
    border-radius: 5px;
    border: 1px solid #e9ecef;
    flex-direction: row;
}

#currentTime {
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-weight: bold;
    color: #2c3e50;
    background: #fff;
    padding: 4px 8px;
    border-radius: 3px;
    border: 1px solid #ddd;
    min-width: 60px;
    text-align: center;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.time-chooser-btn {
    background: #667eea;
    color: white;
    border: none;
    border-radius: 3px;
    padding: 4px 8px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.time-chooser-btn:hover {
    background: #5a6fd8;
}

.time-chooser-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.time-increment-input {
    width: 50px;
    height: 28px;
    padding: 2px 4px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 12px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.time-increment-input:disabled {
    background: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

/* Train number hint styling */
.train-number-hint {
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: bold;
    white-space: nowrap;
    z-index: 2000 !important; /* Match train marker z-index for proper stacking */
    pointer-events: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    transform: translateX(-50%);
}

/* Simple tooltip styling */
.simple-tooltip {
    position: absolute;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 3000 !important; /* Above train marker (2000) and hint */
    display: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    max-width: 300px;
    min-width: 250px;
    font-family: 'Segoe UI', sans-serif;
    font-size: 14px;
    line-height: 1.4;
}

/* Tooltip header */
.simple-tooltip h4 {
    margin: 0 0 12px 0;
    color: #2c3e50;
    font-size: 16px;
    font-weight: 600;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 8px;
}

/* Tooltip content sections */
.simple-tooltip .tooltip-section {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 12px;
    margin: 8px 0;
}

/* Tooltip info rows */
.simple-tooltip .info-row {
    margin: 6px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.simple-tooltip .info-row strong {
    color: #495057;
    font-weight: 600;
    margin-right: 8px;
}

.simple-tooltip .info-row span {
    color: #6c757d;
    text-align: right;
}

/* Tooltip close button */
.simple-tooltip .tooltip-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.simple-tooltip .tooltip-close:hover {
    background-color: #f8f9fa;
    color: #495057;
}

/* Coordinates section */
.simple-tooltip .coordinates-section {
    background: #e9ecef;
    border-radius: 4px;
    padding: 8px;
    margin: 8px 0;
    font-size: 12px;
}

.simple-tooltip .coordinates-row {
    display: flex;
    justify-content: space-between;
    margin: 2px 0;
    font-size: 12px;
}

.simple-tooltip .coordinates-label {
    color: #6c757d;
}

.simple-tooltip .coordinates-value {
    color: #495057;
    font-weight: 600;
    font-family: monospace;
}

.controls {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.btn {
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
    flex: 1;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #f8f9fa;
    color: #333;
    border: 1px solid #dee2e6;
}

.btn-secondary:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-2px);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.speed-control {
    margin-bottom: 12px;
}

.speed-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    font-size: 11px;
    color: #666;
}

.speed-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.speed-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.speed-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.info-display {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 18px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 12px;
}

.info-item:last-child {
    margin-bottom: 0;
}

.info-label {
    color: #666;
    font-weight: 500;
}

.info-value {
    color: #333;
    font-weight: 600;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
    margin: 8px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    width: 0%;
    transition: width 0.3s ease;
}

.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 8px;
}

.quick-btn {
    padding: 6px 10px;
    border: 1px solid #dee2e6;
    background: white;
    border-radius: 5px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.3s ease;
}

.quick-btn:hover {
    background: #f8f9fa;
    border-color: #667eea;
}

.quick-btn:disabled,
.quick-btn.disabled {
    background: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

.quick-btn:disabled:hover,
.quick-btn.disabled:hover {
    background: #f8f9fa;
    border-color: #dee2e6;
}

/* Auto-clean toggle styling for events panel */
.auto-clean-toggle {
    margin: 8px 0 12px 0;
    padding: 6px 8px;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

.toggle-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 11px;
    color: #6c757d;
    user-select: none;
    margin: 0;
}

.toggle-label input[type="checkbox"] {
    margin-right: 6px;
    transform: scale(0.9);
    cursor: pointer;
}

.toggle-text {
    font-size: 11px;
    color: #495057;
    transition: color 0.2s ease;
}

.toggle-label:hover .toggle-text {
    color: #667eea;
}

.toggle-label input[type="checkbox"]:checked + .toggle-text {
    color: #28a745;
    font-weight: 500;
}

.train-search {
    display: flex;
    flex-direction: row;
    gap: 6px;
    align-items: center;
    width: 100%;
}

.searchable-select-container {
    position: relative;
    flex: 1;
}

.combo-box-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.searchable-select-input {
    width: 100%;
    padding: 8px 35px 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    font-size: 12px;
    transition: border-color 0.3s ease;
    background: #fff;
    cursor: text;
}

.searchable-select-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.dropdown-arrow {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 12px;
    color: #666;
    cursor: pointer;
    padding: 2px;
    transition: color 0.2s ease, transform 0.2s ease;
    z-index: 1;
}

.dropdown-arrow:hover {
    color: #333;
}

.dropdown-arrow.active {
    transform: translateY(-50%) rotate(180deg);
    color: #667eea;
}

.searchable-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 5px 5px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.dropdown-options {
    max-height: 200px;
    overflow-y: auto;
}

.dropdown-option {
    padding: 8px 12px;
    font-size: 12px;
    cursor: pointer;
    border-bottom: 1px solid #f1f3f4;
    transition: background-color 0.2s ease;
}

.dropdown-option:hover {
    background-color: #f8f9fa;
}

.dropdown-option.selected {
    background-color: #e3f2fd;
    color: #1976d2;
}

.dropdown-option:last-child {
    border-bottom: none;
}

.dropdown-option.highlighted {
    background-color: #667eea;
    color: white;
}

/* Override button flex for train selection button */
.train-search .btn {
    flex: none;
    width: 70px;
    min-width: 70px;
    white-space: nowrap;
}

.search-result {
    background: #f8f9fa;
    border-radius: 5px;
    padding: 8px;
    font-size: 11px;
    min-height: 18px;
    border: 1px solid #e9ecef;
}

.search-result.loading {
    color: #667eea;
    font-style: italic;
}

.search-result.success {
    color: #28a745;
    border-color: #28a745;
}

.search-result.error {
    color: #dc3545;
    border-color: #dc3545;
}

.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-running {
    background: #28a745;
    animation: pulse 2s infinite;
}

.status-paused {
    background: #ffc107;
}

.status-stopped {
    background: #dc3545;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}


/* Custom station marker */
.station-marker {
    background: #28a745;
    border: 3px solid white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    position: relative;
    z-index: 100;
    display: block !important;
    visibility: visible !important;
}

/* Origin and destination station markers - same size as regular but blue */
.station-marker.origin-destination {
    background: #007bff !important;
    border: 3px solid white !important;
    border-radius: 50% !important;
    width: 20px !important;
    height: 20px !important;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.4) !important;
    cursor: pointer !important;
    position: relative !important;
    z-index: 101 !important;
    display: block !important;
    visibility: visible !important;
}

/* Custom train marker */
.train-marker {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #2c3e50;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative !important;
    z-index: 2000 !important;  /* Ensure train marker is always on top of station markers */
}

.train-marker img {
    border-radius: 50%;
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    
    .right-sidebar {
        position: fixed;
        top: 0;
        right: -100% !important;
        width: 100% !important;
        height: 40vh;
        order: 2;
        z-index: 1000;
    }
    
    .right-sidebar.open {
        right: 0 !important;
    }
    
    .map-container {
        height: 60vh;
        order: 1;
    }
}

/* Broker Status Indicator */
.broker-status-indicator {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    z-index: 1001;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.broker-status-indicator img {
    width: 24px;
    height: 24px;
    transition: filter 0.3s ease;
}

.broker-status-indicator.connected img {
    filter: none; /* Green - Solace connected */
}

.broker-status-indicator.inmemory img {
    filter: grayscale(100%); /* Gray - In-memory */
}

.broker-status-indicator.disconnected img {
    filter: grayscale(100%) brightness(0.5); /* Dark gray - Disconnected */
}

.broker-tooltip {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    margin-top: 5px;
}

.broker-status-indicator:hover .broker-tooltip {
    opacity: 1;
}


/* Mobile responsive for broker indicator */
@media (max-width: 768px) {
    .broker-status-indicator {
        top: 10px;
        left: 50%;
        transform: translateX(-50%);
        width: 35px;
        height: 35px;
    }
    
    .broker-status-indicator img {
        width: 20px;
        height: 20px;
    }
    
    .broker-tooltip {
        font-size: 11px;
        padding: 6px 10px;
    }
}

/* About Dialog Styles */
.about-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10004;
    pointer-events: auto;
    padding: 20px;
    box-sizing: border-box;
}

.about-dialog {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 100%;
    height: 80vh;
    animation: slideIn 0.3s ease-out;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
}

.about-dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #e0e0e0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px 12px 0 0;
    flex-shrink: 0;
}

.about-dialog-header h3 {
    margin: 0;
    font-size: 1.4em;
    font-weight: 600;
}

.about-dialog-close {
    background: none;
    border: none;
    font-size: 24px;
    color: white;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.about-dialog-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.about-dialog-content {
    padding: 25px;
    overflow-y: scroll;
    flex: 1;
    height: 0;
    position: relative;
    z-index: 1;
}

.about-section {
    margin-bottom: 25px;
}

.about-section h4 {
    color: #333;
    margin: 0 0 12px 0;
    font-size: 1.1em;
    font-weight: 600;
    border-bottom: 2px solid #667eea;
    padding-bottom: 5px;
}

.about-section p {
    color: #666;
    line-height: 1.6;
    margin: 0 0 10px 0;
}

.about-section ul {
    margin: 0;
    padding-left: 20px;
}

.about-section li {
    color: #666;
    line-height: 1.6;
    margin-bottom: 8px;
}

.about-section strong {
    color: #333;
}

.status-indicators {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #e9ecef;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.status-item:last-child {
    margin-bottom: 0;
}

.status-label {
    font-weight: 500;
    color: #333;
}

.status-value {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 500;
}

.status-value.connected {
    background-color: #d4edda;
    color: #155724;
}

.status-value.active {
    background-color: #d1ecf1;
    color: #0c5460;
}

.status-value.ready {
    background-color: #d4edda;
    color: #155724;
}

.status-value.disconnected {
    background-color: #f8d7da;
    color: #721c24;
}

.about-footer {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

.about-footer p {
    margin: 5px 0;
    color: #666;
    font-size: 0.9em;
}

/* Broker Configuration Dialog Styles */
.broker-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.broker-dialog {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.broker-dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 20px 0 20px;
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
}

.broker-dialog-header h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
}

.broker-dialog-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.broker-dialog-close:hover {
    color: #333;
}

.broker-dialog-content {
    padding: 0 20px 20px 20px;
}

.broker-type-selection {
    margin-bottom: 20px;
}

.broker-type-label {
    display: block;
    margin-bottom: 15px;
    cursor: pointer;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.broker-type-label:hover {
    border-color: #007bff;
    background: #f8f9fa;
}

.broker-type-label input[type="radio"] {
    margin-right: 10px;
    transform: scale(1.2);
}

.broker-type-label input[type="radio"]:checked + .broker-type-option {
    color: #007bff;
}

.broker-type-label:has(input[type="radio"]:checked) {
    border-color: #007bff;
    background: #f0f8ff;
}

.broker-type-option {
    display: flex;
    flex-direction: column;
}

.broker-type-option strong {
    font-size: 16px;
    margin-bottom: 5px;
}

.broker-type-option small {
    color: #666;
    font-size: 12px;
}

.hosted-environment-note {
    background: #e3f2fd;
    border: 1px solid #2196f3;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
}

.hosted-environment-note .note-content strong {
    color: #1976d2;
    display: block;
    margin-bottom: 8px;
}

.hosted-environment-note .note-content p {
    margin: 0;
    color: #424242;
    font-size: 0.9em;
    line-height: 1.4;
}

.solace-config-fields {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.broker-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.btn {
    /* padding: 10px 20px; */
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Old train tooltip styles removed - now using simple click tooltips */

/* Horizontal zoom control panel at bottom center */
.leaflet-control-zoom {
    position: fixed !important;
    bottom: 20px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 1000 !important;
    display: flex !important;
    flex-direction: row !important;
    background: rgba(255, 255, 255, 0.95) !important;
    border: 2px solid #ddd !important;
    border-radius: 25px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
    overflow: hidden !important;
    transition: all 0.3s ease !important;
}

/* Individual zoom buttons */
.leaflet-control-zoom a {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    /* width: 40px !important; */
    /* height: 40px !important; */
    text-decoration: none !important;
    color: #333 !important;
    font-size: 18px !important;
    font-weight: bold !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    border-right: 1px solid #ddd !important;
    transition: background-color 0.2s ease !important;
    cursor: pointer !important;
}

/* Hover effects for zoom buttons */
.leaflet-control-zoom a:hover {
    background: rgba(52, 152, 219, 0.1) !important;
    color: #3498db !important;
}

/* Active state for zoom buttons */
.leaflet-control-zoom a:active {
    background: rgba(52, 152, 219, 0.2) !important;
    color: #2980b9 !important;
}

/* Remove default Leaflet zoom button styling */
.leaflet-control-zoom a.leaflet-control-zoom-in,
.leaflet-control-zoom a.leaflet-control-zoom-out {
    border: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Add separator between zoom in and zoom out */
.leaflet-control-zoom a.leaflet-control-zoom-in {
    border-right: 1px solid #ddd !important;
}

/* Old train tooltip arrow styles removed */

/* Zoom Level Display */
.leaflet-control-zoom-level {
    background: white !important;
    border: 2px solid rgba(0,0,0,0.2) !important;
    border-radius: 4px !important;
    box-shadow: 0 1px 5px rgba(0,0,0,0.4) !important;
    margin-top: 5px !important;
    padding: 0 !important;
    font-family: Arial, sans-serif !important;
}

.zoom-level-content {
    padding: 4px 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    min-width: 60px !important;
}

.zoom-level-label {
    font-size: 11px !important;
    color: #333 !important;
    font-weight: 500 !important;
}

.zoom-level-value {
    font-size: 12px !important;
    color: #007bff !important;
    font-weight: bold !important;
    min-width: 20px !important;
    text-align: center !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .zoom-level-content {
        padding: 3px 6px !important;
        min-width: 50px !important;
    }
    
    .zoom-level-label {
        font-size: 10px !important;
    }
    
    .zoom-level-value {
        font-size: 11px !important;
    }
}

/* ====== 产品导览样式 ====== */
.tour-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: none;
}

.tour-step {
    position: absolute;
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 300px;
    z-index: 10001;
}

.tour-step::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border: 10px solid transparent;
}

.tour-step[data-position="top"]::before {
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    border-top-color: white;
}

.tour-step[data-position="bottom"]::before {
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    border-bottom-color: white;
}

.tour-step[data-position="left"]::before {
    right: -20px;
    top: 50%;
    transform: translateY(-50%);
    border-left-color: white;
}

.tour-step[data-position="right"]::before {
    left: -20px;
    top: 50%;
    transform: translateY(-50%);
    border-right-color: white;
}

.tour-step h3 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 16px;
}

.tour-step p {
    margin: 0 0 15px 0;
    color: #555;
    font-size: 14px;
    line-height: 1.4;
}

.tour-step .tour-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.tour-step button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.tour-step .tour-next {
    background: #3498db;
    color: white;
}

.tour-step .tour-next:hover {
    background: #2980b9;
}

.tour-step .tour-prev {
    background: #95a5a6;
    color: white;
}

.tour-step .tour-prev:hover {
    background: #7f8c8d;
}

.tour-step .tour-skip {
    background: #e74c3c;
    color: white;
}

.tour-step .tour-skip:hover {
    background: #c0392b;
}

.tour-step .tour-finish {
    background: #27ae60;
    color: white;
}

.tour-step .tour-finish:hover {
    background: #229954;
}

/* Publish Events Disabled Popup */
.publish-events-disabled-popup,
.auto-sim-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.publish-events-disabled-popup .popup-content,
.auto-sim-popup .popup-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 450px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease;
}

.publish-events-disabled-popup .popup-header,
.auto-sim-popup .popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #e9ecef;
}

.publish-events-disabled-popup .popup-header h3,
.auto-sim-popup .popup-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
}

.publish-events-disabled-popup .popup-close,
.auto-sim-popup .popup-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.publish-events-disabled-popup .popup-close:hover,
.auto-sim-popup .popup-close:hover {
    background: #f8f9fa;
    color: #495057;
}

.publish-events-disabled-popup .popup-body,
.auto-sim-popup .popup-body {
    padding: 20px 24px;
}

.publish-events-disabled-popup .popup-body p,
.auto-sim-popup .popup-body p {
    margin: 0 0 16px 0;
    color: #495057;
    line-height: 1.5;
}

.publish-events-disabled-popup .popup-body ol,
.auto-sim-popup .popup-body ol {
    margin: 0 0 16px 0;
    padding-left: 20px;
    color: #495057;
}

.publish-events-disabled-popup .popup-body li,
.auto-sim-popup .popup-body li {
    margin-bottom: 8px;
    line-height: 1.4;
}

.publish-events-disabled-popup .popup-hint,
.auto-sim-popup .popup-hint {
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 16px;
    color: #1565c0;
    font-size: 14px;
    line-height: 1.4;
}

.publish-events-disabled-popup .popup-footer,
.auto-sim-popup .popup-footer {
    padding: 16px 24px 20px;
    border-top: 1px solid #e9ecef;
    text-align: right;
}

.publish-events-disabled-popup .btn,
.auto-sim-popup .btn {
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.publish-events-disabled-popup .btn-primary,
.auto-sim-popup .btn-primary {
    background: #4CAF50;
    color: white;
}

.publish-events-disabled-popup .btn-primary:hover,
.auto-sim-popup .btn-primary:hover {
    background: #45a049;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
