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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

.container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 30px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

h1 {
    color: #2c3e50;
}

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

select, button {
    padding: 12px 18px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

button {
    background-color: #3498db;
    color: white;
    cursor: pointer;
    transition: background-color 0.2s;
}

button:hover {
    background-color: #2980b9;
}

button:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

.main-content {
    display: flex;
    gap: 30px;
    height: calc(100vh - 140px);
}

.sidebar {
    width: 450px;
    background: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow-y: auto;
}

.map-container {
    flex: 1;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

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

.vehicle-list, .target-info {
    margin-bottom: 30px;
}

.vehicle-list h3, .target-info h3 {
    margin-bottom: 15px;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 7px;
}

.vehicle-item {
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 4px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: background-color 0.2s;
}

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

.vehicle-item.active {
    background-color: #e3f2fd;
    border-color: #3498db;
}

.vehicle-name {
    font-weight: bold;
}

.position-header, .target-header {
    font-size: 12px;
    font-weight: bold;
    color: #666;
    margin-top: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.vehicle-address, .target-address {
    font-size: 14px;
    margin-top: 6px;
}

.vehicle-coords {
    font-size: 11px;
    color: #888;
    font-family: monospace;
    margin-top: 3px;
}

.vehicle-status {
    font-size: 12px;
    color: #666;
    margin-top: 6px;
}

.target-coords {
    font-size: 11px;
    color: #888;
    font-family: monospace;
    margin-top: 3px;
}

.target-marker {
    color: red;
    font-size: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
}

.arrow-head {
    color: red;
    font-size: 16px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vehicle-marker {
    font-size: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
}

.vehicle-marker {
    font-size: 18px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Vehicle PNG marker styling */
.vehicle-png-marker {
    border: none !important;
    background: none !important;
}

/* Water source marker styling */
.water-source-marker {
    border: none !important;
    background: none !important;
}

/* Ereignis marker styling */
.ereignis-marker {
    filter: drop-shadow(0 0 6px rgba(220, 38, 38, 0.8));
    animation: ereignis-pulse 2s infinite;
}

@keyframes ereignis-pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
    100% {
        opacity: 1;
    }
}

/* Kroki button styles */
#kroki-controls {
    display: flex;
    align-items: center;
}

#kroki-back-btn:hover, #cancel-kroki-btn:hover, #create-kroki-btn:hover, #show-last-kroki-btn:hover {
    background-color: #2980b9;
}

/* Kroki log column styles */
.kroki-image-column {
    flex: 1;
    position: relative;
}

#kroki-image {
    height: 100%;
    width: 100%;
    object-fit: contain;
}

.kroki-log-column {
    width: 600px;
    background-color: #f8f9fa;
    border-left: 1px solid #dee2e6;
    display: flex;
    flex-direction: column;
}

.kroki-log-header {
    padding: 15px;
    background-color: #e9ecef;
    border-bottom: 1px solid #dee2e6;
    font-weight: bold;
    color: #495057;
    text-align: center;
}

.kroki-log-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.kroki-log-entry {
    padding: 15px;
    margin-bottom: 12px;
    background-color: white;
    border-radius: 6px;
    border-left: 4px solid #007bff;
    font-size: 14px;
    line-height: 1.5;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: left;
}

.kroki-log-entry.current-entry {
    background-color: #fff3cd;
    border-left-color: #ffc107;
    box-shadow: 0 2px 4px rgba(255,193,7,0.2);
}

.kroki-log-entry.history-entry {
    border-left-color: #6c757d;
}

/* New log entry structure */
.log-einsatzdauer {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
}

.log-einsatzdauer .log-value {
    font-weight: bold;
    font-size: 16px;
    color: #2c3e50;
}

.log-eintrag {
    font-size: 16px;
    font-weight: 500;
    color: #2c3e50;
    margin: 12px 0 15px 0;
    line-height: 1.4;
}

.log-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    margin-top: 8px;
}

.log-table th {
    background-color: #f8f9fa;
    color: #666;
    font-weight: 600;
    padding: 4px 6px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Darker yellow header for current entries */
.kroki-log-entry.current-entry .log-table th {
    background-color: #ede4b2;
}

.log-table td {
    padding: 8px;
    border-bottom: 1px solid #f0f0f0;
    color: #2c3e50;
    font-weight: 500;
}

.log-table tr:last-child td {
    border-bottom: none;
}

/* Mobile responsiveness */
@media (max-width: 1152px) {
    .container {
        padding: 15px;
    }

    header {
        flex-direction: column;
        align-items: stretch;
    }

    .controls {
        justify-content: center;
    }

    .main-content {
        flex-direction: column;
        height: calc(100vh - 140px);
    }

    .sidebar {
        display: none; /* Hide sidebar on mobile */
    }

    .map-container {
        order: 1;
        height: 70vh; /* Give more space to map on mobile */
    }

    select, button {
        flex: 1;
        min-width: 0;
    }

    #kroki-controls {
        flex-direction: column;
        width: 100%;
    }
}

@media (max-width: 720px) {
    .controls {
        flex-direction: column;
    }

    button {
        width: 100%;
    }
}

/* Debug tool styles */
.debug-panel {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.debug-panel h2 {
    margin-bottom: 15px;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 7px;
}

.refresh-btn, .test-btn, .load-btn, .clear-btn {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 10px;
    margin-bottom: 10px;
}

.refresh-btn:hover, .test-btn:hover, .load-btn:hover {
    background-color: #2980b9;
}

.clear-btn {
    background-color: #e74c3c;
}

.clear-btn:hover {
    background-color: #c0392b;
}

.results-area {
    margin-top: 15px;
    background-color: #f8f9fa;
    border-radius: 4px;
    padding: 10px;
    font-family: monospace;
    white-space: pre-wrap;
}

.results-area pre {
    margin: 0;
    font-size: 12px;
}

.log-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.log-display {
    max-height: 400px;
    overflow-y: auto;
    background-color: #f8f9fa;
    border-radius: 4px;
    padding: 10px;
}

.log-entries {
    max-height: 300px;
    overflow-y: auto;
    background-color: #f8f9fa;
    border-radius: 4px;
    padding: 10px;
    font-family: monospace;
    font-size: 12px;
}

.log-entry {
    margin-bottom: 5px;
    padding: 5px;
    border-radius: 3px;
}

.log-entry.info {
    background-color: #d4edda;
    color: #155724;
}

.log-entry.error {
    background-color: #f8d7da;
    color: #721c24;
}

.timestamp {
    color: #666;
    font-weight: bold;
}

.message {
    margin-left: 10px;
}

.loading {
    color: #666;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

.no-data {
    color: #666;
    text-align: center;
    padding: 20px;
}

/* MQTT Topics specific styles */
.mqtt-topic {
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 10px;
}

.topic-name {
    font-weight: bold;
    color: #2c3e50;
}

.topic-messages {
    color: #666;
    font-size: 12px;
}

.topic-last-message {
    font-size: 11px;
    color: #888;
    margin-top: 5px;
    font-family: monospace;
}

/* Einsatz Log specific styles */
.log-entry.current-entry {
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
}

.log-entry.history-entry {
    background-color: white;
    border-left: 4px solid #6c757d;
}

.log-type {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 5px;
}

.log-timestamp {
    color: #666;
    font-size: 12px;
    margin-bottom: 10px;
}

.log-details {
    font-size: 12px;
}

.log-field {
    margin-bottom: 3px;
}

.log-field strong {
    color: #495057;
}

/* Media message styles */
.log-message-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
}

.log-message-table td {
    padding: 8px;
    vertical-align: top;
}

.message-text {
    width: 80%;
    word-wrap: break-word;
}

.message-media {
    width: 20%;
    text-align: center;
}

.audio-icon, .image-icon {
    font-size: 24px;
    cursor: pointer;
    transition: transform 0.2s;
}

.audio-icon:hover, .image-icon:hover {
    transform: scale(1.2);
}

.log-entry {
    background-color: #e8f4fd;
    padding: 8px;
    border-radius: 4px;
    margin-bottom: 10px;
    font-weight: bold;
}



/* Media overlay styles */
.media-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.overlay-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.close-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #333;
    z-index: 10001;
}

.close-button:hover {
    color: #e74c3c;
}

.overlay-content audio {
    width: 100%;
    max-width: 400px;
}

.overlay-content img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    cursor: pointer;
}