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

body {
    font-family: 'Segoe UI', sans-serif;
    background: #0a0f1e;
    color: white;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    background: #0f212e;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #00a8ff;
    flex-wrap: wrap;
    gap: 8px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.logo { font-size: 1.4rem; font-weight: bold; }

.weather-header {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #1e3a4d;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
}

.weather-header img { width: 32px; height: 32px; }

.pulse-widget {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #1a3a2a, #1e3a4d);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    border: 1px solid #2ecc71;
    cursor: pointer;
}

.pulse-score {
    font-size: 18px;
    font-weight: bold;
    color: #2ecc71;
}

.nav { display: flex; flex-wrap: wrap; gap: 6px; }

.nav button {
    background: #1e3a4d;
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 13px;
}

.nav button.active { background: #00a8ff; }

.main { flex: 1; position: relative; overflow: hidden; }

.tab { display: none; width: 100%; height: 100%; position: relative; }
.tab.active { display: block; }

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

.info-panel {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    padding: 14px;
    border-radius: 16px;
    width: 320px;
    z-index: 1000;
    border-left: 3px solid #00a8ff;
    max-height: 70vh;
    overflow-y: auto;
}

.info-panel h4 { margin: 0 0 8px 0; color: #00a8ff; }

#weatherInfo {
    font-size: 13px;
    background: #1e3a4d;
    padding: 8px;
    border-radius: 12px;
    margin-top: 8px;
}

.weather-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin-top: 6px;
    font-size: 11px;
    color: #aaa;
}

.map-controls {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}

.loc-btn, .route-btn, .report-btn {
    border: none;
    padding: 8px 12px;
    border-radius: 30px;
    cursor: pointer;
    width: 100%;
    font-size: 13px;
    color: white;
}

.loc-btn { background: #00a8ff; }
.route-btn { background: #9b59b6; }
.route-btn.active { background: #e74c3c; }
.report-btn { background: #e67e22; }
.report-btn.active { background: #c0392b; }

#mediaViewer img {
    max-width: 100%;
    border-radius: 12px;
    margin-top: 8px;
}

.route-instructions {
    font-size: 12px;
    color: #ccc;
    margin-top: 8px;
    max-height: 120px;
    overflow-y: auto;
}

.route-instructions li { margin: 4px 0; }

.chat-box {
    max-width: 700px;
    margin: 20px auto;
    background: #1e2a3a;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: calc(100% - 40px);
}

.chat-msgs {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bot {
    background: #2c3e50;
    align-self: flex-start;
    padding: 8px 14px;
    border-radius: 20px;
    max-width: 85%;
    white-space: pre-wrap;
}

.user {
    background: #00a8ff;
    align-self: flex-end;
    padding: 8px 14px;
    border-radius: 20px;
    max-width: 85%;
}

.chat-hints {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 15px;
    background: #162030;
}

.chat-hints button {
    background: #2c3e50;
    border: 1px solid #3d5a73;
    color: #ccc;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 11px;
    cursor: pointer;
}

.chat-hints button:hover { background: #3d5a73; color: white; }

.chat-input {
    display: flex;
    padding: 10px;
    background: #0f212e;
    gap: 8px;
}

.chat-input input {
    flex: 1;
    padding: 10px;
    border-radius: 30px;
    border: none;
    background: #2c3e50;
    color: white;
}

.chat-input button {
    background: #00a8ff;
    border: none;
    padding: 0 20px;
    border-radius: 30px;
    cursor: pointer;
    color: white;
}

.chat-input button:disabled { opacity: 0.5; cursor: not-allowed; }

.legend {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    z-index: 500;
}

.pulse-legend {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 14px;
    border-radius: 12px;
    font-size: 11px;
    z-index: 500;
}

.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
}

.modal-content {
    position: relative;
    margin: 5% auto;
    padding: 0;
    width: 90%;
    height: 85%;
}

.close-modal {
    position: absolute;
    right: 0; top: -30px;
    color: #fff;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.report-modal .modal-inner {
    background: #1e2a3a;
    margin: 15% auto;
    padding: 24px;
    width: 90%;
    max-width: 400px;
    border-radius: 16px;
}

.report-modal h3 { margin-bottom: 12px; color: #00a8ff; }

.report-modal select,
.report-modal textarea {
    width: 100%;
    padding: 10px;
    margin: 8px 0;
    border-radius: 8px;
    border: none;
    background: #2c3e50;
    color: white;
}

.report-modal .modal-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.report-modal button {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: white;
}

.report-modal .btn-submit { background: #00a8ff; }
.report-modal .btn-cancel { background: #555; }

.marker-start, .marker-end {
    background: transparent;
    border: none;
}

@media (max-width: 700px) {
    .info-panel { width: 260px; bottom: 10px; right: 10px; }
    .header { padding: 8px 12px; }
    .logo { font-size: 1.1rem; }
}
