* {
    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%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

header p {
    opacity: 0.9;
    font-size: 1.1em;
}

main {
    padding: 30px;
}

.upload-section {
    margin-bottom: 30px;
}

.upload-area {
    border: 3px dashed #bdc3c7;
    border-radius: 10px;
    padding: 40px 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    border-color: #3498db;
    background: #f8f9fa;
}

.upload-area.dragover {
    border-color: #2ecc71;
    background: #d5f4e6;
}

.upload-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.upload-content h3 {
    margin-bottom: 10px;
    color: #2c3e50;
}

.upload-content p {
    color: #7f8c8d;
    margin-bottom: 20px;
}

.btn-primary, .btn-detect, .btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 5px;
}

.btn-primary {
    background: #3498db;
    color: white;
}

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

.btn-detect {
    background: #2ecc71;
    color: white;
}

.btn-detect:hover:not(:disabled) {
    background: #27ae60;
}

.btn-detect:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.selected-file {
    margin-top: 20px;
    padding: 15px;
    background: #ecf0f1;
    border-radius: 8px;
}

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

.btn-remove {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    cursor: pointer;
    font-size: 14px;
}

.controls {
    text-align: center;
    margin: 30px 0;
}

.results-section {
    margin: 30px 0;
}

.result-card {
    border: 2px solid #ecf0f1;
    border-radius: 10px;
    padding: 20px;
    background: #f8f9fa;
}

.result-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    font-size: 1.2em;
    font-weight: 600;
}

.result-header span:first-child {
    font-size: 1.5em;
    margin-right: 10px;
}

.confidence-meter {
    display: flex;
    align-items: center;
    margin: 15px 0;
}

.confidence-label {
    width: 100px;
    font-weight: 600;
}

.confidence-bar {
    flex: 1;
    height: 20px;
    background: #ecf0f1;
    border-radius: 10px;
    overflow: hidden;
    margin: 0 15px;
}

.confidence-fill {
    height: 100%;
    background: linear-gradient(90deg, #e74c3c, #f39c12, #2ecc71);
    border-radius: 10px;
    transition: width 0.5s ease;
    width: 0%;
}

.confidence-value {
    width: 50px;
    text-align: right;
    font-weight: 600;
}

.probabilities {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 15px 0;
}

.prob-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    border-left: 4px solid #3498db;
}

.audio-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 15px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid #ecf0f1;
}

.batch-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #ecf0f1;
}

.batch-upload {
    margin: 20px 0;
}

#batchCount {
    margin-left: 15px;
    color: #7f8c8d;
}

.batch-results {
    margin-top: 20px;
}

.batch-result-item {
    padding: 10px 15px;
    margin: 5px 0;
    background: white;
    border-radius: 6px;
    border-left: 4px solid #3498db;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

footer {
    background: #34495e;
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: 40px;
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

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

/* Responsive design */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        border-radius: 10px;
    }
    
    main {
        padding: 20px;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    .probabilities, .audio-info {
        grid-template-columns: 1fr;
    }
}

/* Threshold Controls */
.threshold-section {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 2px solid #e9ecef;
}

.threshold-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.threshold-slider {
    flex: 1;
}

.threshold-slider label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #2c3e50;
}

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

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.threshold-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    font-size: 0.8em;
    color: #7f8c8d;
}

.threshold-presets {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-preset {
    padding: 8px 16px;
    border: 2px solid #3498db;
    background: white;
    color: #3498db;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.btn-preset:hover {
    background: #3498db;
    color: white;
}

.btn-preset.active {
    background: #3498db;
    color: white;
}

/* Update result display for threshold info */
.threshold-info {
    margin-top: 10px;
    padding: 8px 12px;
    background: #e8f4fd;
    border-radius: 6px;
    border-left: 4px solid #3498db;
    font-size: 0.9em;
}

.visualization-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.visualization-section h4 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

#localization-plot {
    width: 100%;
    height: 500px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
}

.visualization-info {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 5px;
}

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-color {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: 1px solid #ccc;
}

.localization-info {
    margin-top: 1rem;
    padding: 1rem;
    background: #e8f4fd;
    border-radius: 5px;
    border-left: 4px solid #3498db;
}

.localization-info .info-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

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

/* Responsive design */
@media (max-width: 768px) {
    #localization-plot {
        height: 400px;
    }
    
    .legend {
        flex-direction: column;
        gap: 0.5rem;
    }
}

.analysis-options {
    margin: 1rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 5px;
}

.analysis-options h3 {
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-bottom: 0.5rem;
}

.checkbox-label input {
    margin-right: 0.5rem;
}

.option-help {
    margin-left: 1.5rem;
    color: #666;
}

.segment-info {
    border-top: 1px solid #eee;
    padding-top: 0.5rem;
    margin-top: 0.5rem;
}

/* Monitoring styles */
.monitoring-section {
    margin-bottom: 2rem;
}

.monitoring-card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-left: 4px solid #3498db;
}

.map-section {
    margin: 2rem 0;
}

.map-container {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

#drone-map {
    height: 500px;
    width: 100%;
}

.map-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.map-btn {
    background: white;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.map-btn:hover {
    background: #f8f9fa;
}

.map-scale {
    background: white;
    padding: 5px 10px;
    border-radius: 5px;
    border: 1px solid #ccc;
    font-size: 12px;
}

.drone-marker {
    text-align: center;
    font-size: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

/* Rest of your existing styles remain the same */
.monitoring-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 1.1em;
}

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

.status-dot.active {
    background-color: #28a745;
    box-shadow: 0 0 10px rgba(40, 167, 69, 0.5);
}

.status-dot.inactive {
    background-color: #dc3545;
}

.monitoring-controls {
    display: flex;
    gap: 1rem;
}

.btn-monitor {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1em;
}

.btn-start {
    background: #28a745;
    color: white;
}

.btn-start:hover:not(:disabled) {
    background: #218838;
    transform: translateY(-2px);
}

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

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

.btn-monitor:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
}

.monitoring-info {
    margin: 1.5rem 0;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.info-label {
    font-weight: 600;
    color: #495057;
}

.info-value {
    font-weight: 700;
    color: #007bff;
}

.alerts-section {
    margin-top: 1.5rem;
}

.alerts-container {
    max-height: 300px;
    overflow-y: auto;
}

.alert-item {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    animation: highlight 2s ease-in-out;
}

.alert-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.alert-icon {
    font-size: 1.3em;
}

.alert-time {
    margin-left: auto;
    font-size: 0.9em;
    color: #666;
}

.alert-details {
    font-size: 0.95em;
    color: #856404;
}

.system-info {
    margin-top: 2rem;
}

.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.info-card {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
}

.info-card h4 {
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.info-card p {
    color: #666;
    line-height: 1.5;
}

@keyframes highlight {
    0% { 
        background-color: #ffeb3b;
        transform: scale(1.02);
    }
    100% { 
        background-color: #fff3cd;
        transform: scale(1);
    }
}

@media (max-width: 768px) {
    .monitoring-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .monitoring-controls {
        width: 100%;
        justify-content: space-between;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .info-cards {
        grid-template-columns: 1fr;
    }

    #drone-map {
        height: 300px;
    }
}

/* Mode Detector */
.mode-indicator {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: bold;
    margin-left: 10px;
}

.real-mode {
    background: #28a745;
    color: white;
}

.simulation-mode {
    background: #ffc107;
    color: black;
}

.inactive-mode {
    background: #6c757d;
    color: white;
}

.alert-item.real-detection {
    border-left: 4px solid #28a745;
}

.alert-item.simulation-detection {
    border-left: 4px solid #ffc107;
}

.alert-item.false-positive {
    border-left: 4px solid #dc3545;
    background: #f8d7da;
}

.alert-item.hardware-alert {
    border-left: 4px solid #17a2b8;
    background: #d1ecf1;
}

.alert-item.error-alert {
    border-left: 4px solid #dc3545;
    background: #f8d7da;
}

.alert-mode {
    background: #6c757d;
    color: white;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 0.7em;
    margin-left: 8px;
}

.drone-marker.real-marker {
    font-size: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.drone-marker.simulation-marker {
    font-size: 18px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    opacity: 0.8;
}

.loading-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
/* End of Monitoring styles */