/* Main App Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f8f9fa;
    overflow: hidden;
}

/* App Layout */
.app-layout {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 320px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    transition: width 0.3s, transform 0.3s;
}

.sidebar.collapsed {
    width: 64px;
}

.sidebar-header {
    padding: 20px 24px 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: left;
    transition: padding 0.3s;
}

.sidebar.collapsed .sidebar-header {
    padding: 20px 8px 20px 8px;
    text-align: center;
}

.sidebar.collapsed .sidebar-header h4 {
    font-size: 0;
    overflow: hidden;
}

.sidebar-content {
    padding: 20px;
}

/* Control Sections */
.control-section {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
}

.control-section h5 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Modern Buttons */
.btn-modern {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    font-weight: 500;
    cursor: pointer;
}

.btn-modern:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    color: white;
    text-decoration: none;
}

/* 
.btn-modern.primary {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    border: none;
} */

.btn-modern.success {
    background: linear-gradient(45deg, #2196F3, #1976D2);
    border: none;
}

.btn-modern.info {
    background: linear-gradient(45deg, #00BCD4, #0097A7);
    border: none;
}

.btn-modern.warning {
    background: linear-gradient(45deg, #FF9800, #F57C00);
    border: none;
}

.btn-modern.danger {
    background: linear-gradient(45deg, #f44336, #d32f2f);
    border: none;
}

/* Button States */
.btn-modern:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    background: rgba(255, 255, 255, 0.1) !important;
}

.btn-modern:disabled:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    transform: none;
}

.btn-modern.active {
    background: rgba(3, 244, 51, 0.4);
    box-shadow: 0 4px 12px rgba(243, 247, 5, 0.2);
}

.btn-modern.ready {
    background: linear-gradient(45deg, #4CAF50, #45a049) !important;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(76, 175, 80, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
}

/* Form Controls */
.form-control-modern {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    width: 100%;
}

.form-control-modern:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.form-control-modern::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.form-control-modern option {
    background: #2c3e50;
    color: white;
}

.form-label-modern {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    margin-bottom: 8px;
    display: block;
}

/* Simulation Controls */
.simulation-controls {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

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

.simulation-controls .form-group:last-child {
    margin-bottom: 0;
}

.simulation-controls label {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    margin-bottom: 5px;
    display: block;
    font-size: 0.9rem;
}

.simulation-controls input,
.simulation-controls select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    width: 100%;
    font-size: 0.9rem;
}

.simulation-controls input:focus,
.simulation-controls select:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}

.simulation-controls select option {
    background: #2c3e50;
    color: white;
}

/* Status Indicators */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-indicator.success {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.status-indicator.warning {
    background: rgba(255, 152, 0, 0.2);
    color: #FF9800;
    border: 1px solid rgba(255, 152, 0, 0.3);
}

.status-indicator.error {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
    border: 1px solid rgba(244, 67, 54, 0.3);
}

.status-indicator.info {
    background: rgba(33, 150, 243, 0.2);
    color: #2196F3;
    border: 1px solid rgba(33, 150, 243, 0.3);
}

/* Enhanced Info Panels */
.info-panel {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.info-panel:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.info-panel h6 {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-panel .small {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.5;
}

.info-panel .small div {
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.info-panel .small div:last-child {
    margin-bottom: 0;
}

.info-panel .small strong {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
}

/* Checkboxes */
.form-check-modern {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    cursor: pointer;
}

.form-check-input {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    accent-color: #4CAF50;
}

.form-check-label {
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
}

/* Main Content */
.main-content {
    flex: 1 1 0;
    min-width: 0;
    height: 100vh;
    transition: margin-left 0.3s, width 0.3s;
    margin-left: 320px;
}

.sidebar.collapsed~.main-content {
    margin-left: 64px;
}

/* Map Container */
.map-container {
    width: 100%;
    height: 100%;
    position: relative;
}

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

/* Sidebar Toggle Button */
.sidebar-toggle-btn {
    position: fixed;
    top: 28px;
    left: 320px;
    z-index: 2001;
    background: #fff;
    color: #764ba2;
    border: 2px solid #764ba2;
    border-radius: 0 50% 50% 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: left 0.3s, background 0.2s, color 0.2s;
    font-size: 22px;
    cursor: pointer;
}

.sidebar.collapsed~.sidebar-toggle-btn {
    left: 64px;
}

.sidebar-toggle-btn:hover {
    background: #764ba2;
    color: #fff;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.spinner-border {
    width: 3rem;
    height: 3rem;
    color: #2196F3;
}

/* Status Messages */
.status-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    max-width: 400px;
    display: none;
}

.status-message {
    background: white;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-left: 4px solid #2196F3;
}

.status-success {
    border-left-color: #4CAF50;
}

.status-error {
    border-left-color: #f44336;
}

.status-warning {
    border-left-color: #FF9800;
}

.status-info {
    border-left-color: #2196F3;
}

/* Map Controls */
.map-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1000;
}

.map-control-btn {
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #e0e0e0;
    margin-top: 30px !important;
    border-radius: 10px;
    padding: 12px;
    background: #1bd8f1;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    color: #333;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.map-control-btn:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    border-color: #2196F3;
}

.map-control-btn i {
    font-size: 18px;
}

/* Layer Panel */
.layer-panel {
    position: absolute;
    top: 60px;
    right: 10px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 1001;
    min-width: 250px;
    max-width: 300px;
}

.layer-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(0, 0, 0, 0.02);
    border-radius: 12px 12px 0 0;
}

.layer-panel-header h6 {
    margin: 0;
    color: #333;
    font-weight: 600;
    font-size: 0.9rem;
}

.layer-panel-close {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s;
}

.layer-panel-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

.layer-panel-content {
    padding: 15px 20px;
}

.layer-section {
    margin-bottom: 20px;
}

.layer-section:last-child {
    margin-bottom: 0;
}

.layer-section h6 {
    margin: 0 0 10px 0;
    color: #333;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.layer-item {
    display: flex;
    align-items: center;
    margin: 8px 0;
    padding: 5px 0;
}

.layer-item input[type="checkbox"],
.layer-item input[type="radio"] {
    margin-right: 10px;
    width: 16px;
    height: 16px;
    accent-color: #2196F3;
}

.layer-item label {
    color: #333;
    font-size: 0.9rem;
    cursor: pointer;
    flex: 1;
}

.layer-item:hover {
    background: rgba(33, 150, 243, 0.05);
    border-radius: 4px;
    padding: 5px 8px;
    margin: 8px -8px;
}

/* Legend */
.legend {
    position: absolute;
    bottom: 10px;
    right: 20px;
    background: rgba(146, 218, 245, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 1000;
    min-width: 150px;
    font-size: 8px;
}

/* Effects Panel */
.effects-panel {
    position: absolute;
    top: 60px;
    right: 10px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 1001;
    min-width: 250px;
    max-width: 300px;
}

.effects-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border-radius: 12px 12px 0 0;
}

.effects-panel-header h6 {
    margin: 0;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.effects-panel-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s;
}

.effects-panel-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.effects-panel-content {
    padding: 15px 20px;
}

.effect-item {
    display: flex;
    align-items: center;
    margin: 8px 0;
    padding: 5px 0;
    gap: 10px;
}

.effect-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #28a745;
    cursor: pointer;
}

.effect-item label {
    color: #333;
    font-size: 0.9rem;
    cursor: pointer;
    flex: 1;
    font-weight: 500;
}

.effect-item:hover {
    background: rgba(40, 167, 69, 0.05);
    border-radius: 4px;
    padding: 5px 8px;
    margin: 8px -8px;
}

.effect-info {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.legend h6 {
    margin-bottom: 10px;
    color: #333;
    font-weight: 600;
    font-size: 10px;
}

.legend-item {
    display: flex;
    align-items: center;
    margin: 5px 0;
    font-size: 0.6rem;
}

.legend-color {
    width: 13px;
    height: 13px;
    margin-right: 8px;
    border-radius: 3px;
    border: 1px solid #ccc;
}

/* Responsive Design */
@media (max-width: 768px) {

    /* XÓA/CMT ĐOẠN ẨN SIDEBAR KHI KHÔNG SHOW */
    /*
    .sidebar {
        transform: translateX(-100%);
        width: 320px !important;
    }
    .sidebar.show {
        transform: translateX(0);
    }
    */
    .main-content {
        margin-left: 0 !important;
    }

    .sidebar-toggle-btn {
        left: 0 !important;
        top: 15px;
        border-radius: 0 50% 50% 0;
    }

    .map-controls {
        left: 20px;
        top: -15px !important;
    }

    .map-control-btn {
        background: rgba(255, 255, 255, 0.98);
        border: 2px solid #2196F3;
        border-radius: 12px;
        padding: 14px;
        box-shadow: 0 6px 20px rgba(33, 150, 243, 0.3);
        min-width: 48px;
        min-height: 48px;
    }

    .map-control-btn:hover {
        background: white;
        transform: translateY(-3px);
        box-shadow: 0 8px 25px rgba(33, 150, 243, 0.4);
    }

    .map-control-btn i {
        font-size: 20px;
        color: #2196F3;
    }

    .legend {
        bottom: 10px;
        right: 10px;
        max-width: 250px;
    }
}

/* Utility Classes */
.text-white-50 {
    color: rgba(255, 255, 255, 0.5) !important;
}

.small {
    font-size: 0.875rem;
}

.mb-2 {
    margin-bottom: 0.5rem !important;
}

.mb-3 {
    margin-bottom: 1rem !important;
}

.mt-2 {
    margin-top: -0.5rem !important;
}

.mt-3 {
    margin-top: 1rem !important;
}

.d-flex {
    display: flex !important;
}

.flex-column {
    flex-direction: column !important;
}

.flex-fill {
    flex: 1 1 auto !important;
}

.align-items-center {
    align-items: center !important;
}

.gap-2 {
    gap: 0.5rem !important;
}

.w-100 {
    width: 100% !important;
}

.d-grid {
    display: grid !important;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    border-radius: 0.2rem;
}

/* Bootstrap Icons */
.bi {
    display: inline-block;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    line-height: 1;
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }

    to {
        transform: translateX(0);
    }
}

/* Time Slider Styles */
.time-slider-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #007bff;
    border-radius: 15px;
    padding: 20px;
    min-width: 500px;
    z-index: 1000;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.time-slider-header {
    text-align: center;
    margin-bottom: 15px;
}

.time-slider-header h5 {
    color: #fff;
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.time-display {
    text-align: center;
    color: #fff;
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 15px;
    padding: 8px;
    background: rgba(0, 123, 255, 0.2);
    border-radius: 8px;
}

.time-slider-wrapper {
    margin-bottom: 15px;
}

.time-slider {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: #333;
    outline: none;
    -webkit-appearance: none;
    margin-bottom: 8px;
}

.time-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.time-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.time-slider-labels {
    display: flex;
    justify-content: space-between;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 500;
}

.time-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.time-buttons {
    display: flex;
    gap: 8px;
}

.time-buttons .btn {
    padding: 6px 12px;
    font-size: 0.85rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.time-buttons .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.time-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.time-step-info {
    color: #fff;
    font-size: 0.85rem;
    font-weight: 500;
}

.simulation-progress {
    color: #28a745;
    font-size: 0.9rem;
    font-weight: bold;
}

/* Animation for time slider */
.time-slider-container.show {
    animation: slideUp 0.5s ease-out;
}

.time-slider-container.hide {
    animation: slideDown 0.5s ease-in;
}

@keyframes slideUp {
    from {
        transform: translateX(-50%) translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }

    to {
        transform: translateX(-50%) translateY(100%);
        opacity: 0;
    }
}

/* Responsive design for time slider */
@media (max-width: 768px) {
    .time-slider-container {
        min-width: 90%;
        left: 5%;
        transform: none;
        padding: 15px;
    }

    .time-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .time-buttons {
        justify-content: center;
    }

    .time-info {
        align-items: center;
        margin-top: 10px;
    }
}

/* GSM Simulation Panel */
.simulation-panel {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.simulation-panel .panel-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 8px 8px 0 0;
    border-bottom: 1px solid #ddd;
}

.simulation-panel .panel-header h5 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.simulation-panel .panel-header i {
    margin-right: 8px;
}

.simulation-panel .panel-body {
    padding: 20px;
}

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

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

.simulation-panel .form-control {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 14px;
}

.simulation-panel .form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.simulation-panel .btn {
    border-radius: 6px;
    font-weight: 500;
    padding: 10px 16px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.simulation-panel .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
}

.simulation-panel .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.simulation-panel .btn-success {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
    border: none;
}

.simulation-panel .btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(86, 171, 47, 0.3);
}

.simulation-panel .btn-danger {
    background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
    border: none;
}

.simulation-panel .btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 65, 108, 0.3);
}

.simulation-panel .btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    border: none;
}

.simulation-panel .btn-secondary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(108, 117, 125, 0.3);
}

/* Progress bar */
.simulation-panel .progress {
    height: 8px;
    border-radius: 4px;
    background-color: #e9ecef;
}

.simulation-panel .progress-bar {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Time slider */
.simulation-panel .form-range {
    height: 6px;
    border-radius: 3px;
    background: #e9ecef;
    outline: none;
}

.simulation-panel .form-range::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.simulation-panel .form-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Results display */
.simulation-panel #gsm-results {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 15px;
}

.simulation-panel #gsm-results h6 {
    color: #495057;
    font-weight: 600;
    margin-bottom: 15px;
    border-bottom: 2px solid #667eea;
    padding-bottom: 8px;
}

.simulation-panel #gsm-results small {
    font-size: 12px;
    color: #6c757d;
}

.simulation-panel #gsm-results div[id^="gsm-"] {
    font-weight: 500;
    color: #333;
    margin-top: 2px;
}

/* Time controls */
.simulation-panel #gsm-time-controls {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 15px;
}

.simulation-panel #gsm-time-display {
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    margin-top: 8px;
}

/* Alert styling */
.simulation-panel .alert {
    border-radius: 6px;
    border: none;
    padding: 12px 15px;
}

.simulation-panel .alert-info {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    color: #1565c0;
}

/* Responsive design */
@media (max-width: 768px) {
    .simulation-panel .panel-body {
        padding: 15px;
    }

    .simulation-panel .btn {
        padding: 8px 12px;
        font-size: 13px;
    }

    .simulation-panel .form-control {
        font-size: 13px;
    }
}

/* Animation for buttons */
.simulation-panel .btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.simulation-panel .btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Loading animation */
@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

.simulation-panel .btn:disabled {
    animation: pulse 1.5s infinite;
    opacity: 0.7;
}

/* Sidebar modern collapse/expand - fix selector và icon alignment */
.sidebar {
    width: 320px;
    min-width: 320px;
    max-width: 320px;
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    background: #232946;
    color: #fff;
    min-height: 100vh;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.08);
    z-index: 100;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.sidebar.sidebar-collapsed {
    width: 60px !important;
    min-width: 60px !important;
    max-width: 60px !important;
    overflow-x: hidden !important;
}

.sidebar .sidebar-header {
    padding: 18px 12px 12px 12px;
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

.sidebar.sidebar-collapsed .sidebar-header h4 {
    font-size: 1.5rem;
    margin: 0 auto;
    text-align: center;
}

.sidebar .sidebar-content {
    padding: 0 12px 18px 12px;
}

.sidebar.sidebar-collapsed .sidebar-content {
    padding: 0 2px 0 2px;
}

.sidebar .sidebar-label,
.sidebar .sidebar-text {
    display: inline;
    transition: opacity 0.2s;
}

.sidebar.sidebar-collapsed .sidebar-label,
.sidebar.sidebar-collapsed .sidebar-text {
    display: none !important;
}

.sidebar .btn.btn-modern {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: background 0.2s, color 0.2s;
    margin-top: 30px !important;
}

.sidebar.sidebar-collapsed .btn.btn-modern {
    justify-content: center;
    padding: 10px 0;
    font-size: 1.3rem;
    width: 44px;
    height: 44px;
    margin: 0 auto 12px auto;
}

.sidebar .btn.btn-modern i {
    font-size: 1.3rem;
    margin: 0 auto;
    display: block;
}

.sidebar.sidebar-collapsed .btn.btn-modern i {
    margin: 0 auto;
    font-size: 1.5rem;
    display: block;
}

.sidebar .control-section h5,
.sidebar .control-section label,
.sidebar .form-label-modern {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 8px;
    color: #eebbc3;
}

.sidebar.sidebar-collapsed .control-section h5,
.sidebar.sidebar-collapsed .control-section label,
.sidebar.sidebar-collapsed .form-label-modern {
    display: none !important;
}

.sidebar .control-section {
    margin-bottom: 18px;
}

.sidebar.sidebar-collapsed .control-section {
    text-align: center;
    margin-bottom: 10px;
}

.sidebar.sidebar-collapsed .form-check-label,
.sidebar.sidebar-collapsed .form-label-modern,
.sidebar.sidebar-collapsed .layer-section h6,
.sidebar.sidebar-collapsed .layer-item label,
.sidebar.sidebar-collapsed .effect-info,
.sidebar.sidebar-collapsed .effect-item label,
.sidebar.sidebar-collapsed .debug-section h6,
.sidebar.sidebar-collapsed .debug-section button,
.sidebar.sidebar-collapsed .info-panel,
.sidebar.sidebar-collapsed .small {
    display: none !important;
}

.sidebar.sidebar-collapsed .form-check-input {
    margin: 0 auto;
    display: block;
}

/* Sidebar toggle button fix */
.sidebar-toggle-btn {
    position: absolute;
    top: 18px;
    left: 320px;
    z-index: 200;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #fff;
    color: #232946;
    border: 1px solid #eebbc3;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.sidebar-collapsed~.sidebar-toggle-btn {
    left: 60px !important;
}

@media (max-width: 900px) {
    .sidebar {
        width: 220px;
        min-width: 220px;
        max-width: 220px;
    }

    .sidebar.sidebar-collapsed {
        width: 48px !important;
        min-width: 48px !important;
        max-width: 48px !important;
    }

    .sidebar-toggle-btn {
        left: 220px;
    }

    .sidebar.sidebar-collapsed~.sidebar-toggle-btn {
        left: 48px !important;
    }
}

/* Sidebar overlay modern - fix sibling selector */
.sidebar.sidebar-overlay {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 9999 !important;
    box-shadow: 2px 0 8px rgba(2, 151, 244, 0.08);
    background: #023173;
    width: 320px;
    min-width: 320px;
    max-width: 320px;
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    color: #fff;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.sidebar.sidebar-overlay.sidebar-collapsed {
    width: 60px !important;
    min-width: 60px !important;
    max-width: 60px !important;
    overflow-x: hidden !important;
}

.main-content {
    margin-left: 0 !important;
    width: 100vw;
    transition: none;
}

.sidebar-toggle-btn {
    position: fixed;
    left: 320px;
    top: 24px;
    z-index: 10001 !important;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #fff;
    color: #232946;
    border: 1px solid #eebbc3;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.sidebar-collapsed+.sidebar-toggle-btn {
    left: 60px !important;
}

/* Sidebar collapsed: chỉ ẩn text, giữ icon */
.sidebar.sidebar-collapsed .sidebar-label,
.sidebar.sidebar-collapsed .sidebar-content,
.sidebar.sidebar-collapsed .sidebar-header h4 {
    display: none !important;
}

/* Đảm bảo icon luôn hiện khi collapsed, kể cả khi nằm trong span */
.sidebar.sidebar-collapsed .btn.btn-modern>span:first-child,
.sidebar.sidebar-collapsed .btn.btn-modern>i,
.sidebar.sidebar-collapsed .btn.btn-modern .bi {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 auto !important;
    font-size: 2rem !important;
    color: #fff !important;
    opacity: 1 !important;
    visibility: visible !important;
    width: 40px !important;
    height: 40px !important;
    padding: 0 !important;
}

.sidebar.sidebar-collapsed .btn.btn-modern {
    justify-content: center;
    align-items: center;
    padding: 10px 0 !important;
    width: 44px !important;
    height: 44px !important;
    margin: 0 auto 12px auto !important;
}

/* Khi sidebar collapsed, icon header và button luôn hiện to, căn giữa */
.sidebar.sidebar-collapsed .control-section h5 {
    justify-content: center !important;
    align-items: center !important;
    gap: 0 !important;
}

.sidebar.sidebar-collapsed .control-section h5 i {
    font-size: 2rem !important;
    margin: 0 auto !important;
    display: block !important;
    color: #fff !important;
}

.sidebar.sidebar-collapsed .btn.btn-modern {
    justify-content: center !important;
    align-items: center !important;
    padding: 10px 0 !important;
    width: 44px !important;
    height: 44px !important;
    margin: 0 auto 12px auto !important;
}

.sidebar.sidebar-collapsed .btn.btn-modern i,
.sidebar.sidebar-collapsed .btn.btn-modern .bi {
    display: block !important;
    margin: 0 auto !important;
    font-size: 2rem !important;
    color: #fff !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.sidebar.sidebar-collapsed .sidebar-label,
.sidebar.sidebar-collapsed .sidebar-header h4 {
    display: none !important;
}

/* Modern Toast Notification */
.modern-toast {
    position: fixed;
    top: 32px;
    right: 32px;
    min-width: 320px;
    max-width: 400px;
    background: #fff;
    color: #222;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18), 0 1.5px 6px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 28px 18px 18px;
    z-index: 99999;
    font-size: 1rem;
    animation: fadeIn 0.3s;
    transition: opacity 0.4s, transform 0.4s;
}

.modern-toast.hide {
    opacity: 0;
    transform: translateY(-30px);
}

.modern-toast-icon {
    font-size: 1.7rem;
    display: flex;
    align-items: center;
}

.modern-toast-success .modern-toast-icon {
    color: #4CAF50;
}

.modern-toast-error .modern-toast-icon {
    color: #d32f2f;
}

.modern-toast-warning .modern-toast-icon {
    color: #ff9800;
}

.modern-toast-info .modern-toast-icon {
    color: #2196f3;
}

.modern-toast-message {
    flex: 1;
    font-weight: 500;
    word-break: break-word;
}

.modern-toast-progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 4px;
    background: linear-gradient(90deg, #2196f3, #4CAF50);
    border-radius: 0 0 12px 12px;
    transition: width 4.5s linear;
}

.modern-toast-success .modern-toast-progress {
    background: linear-gradient(90deg, #4CAF50, #8bc34a);
}

.modern-toast-error .modern-toast-progress {
    background: linear-gradient(90deg, #d32f2f, #ff5252);
}

.modern-toast-warning .modern-toast-progress {
    background: linear-gradient(90deg, #ff9800, #ffc107);
}

.modern-toast-info .modern-toast-progress {
    background: linear-gradient(90deg, #2196f3, #03a9f4);
}

@media (max-width: 600px) {
    .modern-toast {
        right: 8px;
        left: 8px;
        min-width: unset;
        max-width: unset;
    }
}

@media (max-width: 768px) {
    .sidebar.sidebar-overlay.sidebar-collapsed {
        display: none !important;
    }

    .sidebar.sidebar-collapsed+.sidebar-toggle-btn {
        left: 30px !important;
        color: #023173 !important;
    }

    .sidebar.sidebar-hidden {
        display: none !important;
    }

    .sidebar-toggle-btn {
        left: 8px !important;
        z-index: 10001;
    }

    .map-controls {
        position: fixed !important;
        top: 16px;
        right: 16px;
        left: auto !important;
        z-index: 10000;
        flex-direction: column;
        gap: 10px;
        /* background: rgba(255, 255, 255, 0.95); */
        border-radius: 12px;
        /* box-shadow: 0 4px 16px rgba(0, 0, 0, 0.13); */
        padding: 8px 6px;
    }
}