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

html {
    scroll-behavior: smooth;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #A6CFD5;
    color: #ffffff;
    min-height: 100vh;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

#app {
    min-height: 100vh;
    background:
        radial-gradient(circle at top right, rgba(0, 140, 255, 0.14), transparent 30%),
        radial-gradient(circle at bottom left, rgba(0, 255, 180, 0.08), transparent 30%),
        #A6CFD5;
}

.topbar {
    min-height: 82px;
    padding: 15px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    border-bottom: 1px solid #1d354d;
    background: rgba(5, 14, 26, 0.95);
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-icon {
    width: 50px;
    height: 50px;
    display: grid;
    place-items: center;
    border: 1px solid #2b82c9;
    border-radius: 12px;
    background: #0c2035;
    font-size: 26px;
}

.brand h1 {
    font-size: 20px;
    letter-spacing: 1px;
}

.brand p {
    margin-top: 5px;
    color: #8fa7bc;
    font-size: 12px;
}

.system-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.status {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #75f5a5;
    font-size: 12px;
    font-weight: bold;
}

#systemStatusIndicator,
#connectionDot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
    background: #ff4b4b;
}

#systemStatusIndicator {
    background: #62ef9c;
    box-shadow: 0 0 10px #62ef9c;
}

#connectionDot.connected {
    background: #62ef9c;
    box-shadow: 0 0 10px #62ef9c;
}

.mission-time {
    color: #8198ad;
    font-size: 10px;
    text-align: right;
}

.mission-time strong {
    display: block;
    margin-top: 4px;
    color: white;
    font-size: 15px;
    letter-spacing: 1px;
}

#settingsButton {
    width: 38px;
    height: 38px;
    border: 1px solid #29455e;
    border-radius: 8px;
    background: #0d1e31;
    color: white;
    font-size: 18px;
}

#settingsButton:hover {
    background: #15304a;
}

main {
    width: min(1450px, 94%);
    margin: auto;
    padding: 25px 0 50px;
}

.dashboard {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.card {
    padding: 20px;
    min-height: 105px;
    border: 1px solid #1d354d;
    border-radius: 12px;
    background: #0b1b2d;
}

.card span {
    display: block;
    color: #7891a7;
    font-size: 11px;
    letter-spacing: 1px;
}

.card strong {
    display: block;
    margin-top: 12px;
    font-size: 28px;
}

.satellites {
    margin-bottom: 25px;
}

.satellites h2,
.panel-header h2 {
    font-size: 17px;
}

.satellite-list {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}

.satellite-card {
    min-width: 150px;
    padding: 14px;
    border: 1px solid #1d354d;
    border-radius: 10px;
    background: #0b1b2d;
    color: white;
    text-align: left;
}

.satellite-card strong,
.satellite-card span {
    display: block;
}

.satellite-card span {
    margin-top: 5px;
    color: #7891a7;
    font-size: 11px;
}

.satellite-card:hover,
.satellite-card.active {
    border-color: #2999e8;
    background: #102943;
}

.main-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 18px;
    margin-bottom: 20px;
}

.map-panel,
.analysis-panel,
.observations-panel,
.alerts-panel,
.event-panel {
    border: 1px solid #1d354d;
    border-radius: 13px;
    background: #0b1b2d;
    overflow: hidden;
}

.panel-header {
    min-height: 65px;
    padding: 15px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    border-bottom: 1px solid #1d354d;
}

.panel-header p {
    margin-top: 5px;
    color: #7891a7;
    font-size: 11px;
}

#satelliteLiveBadge {
    padding: 6px 9px;
    border: 1px solid #276a91;
    border-radius: 6px;
    color: #67d8ff;
    background: #0b2739;
    font-size: 10px;
}

#earthMap {
    height: 510px;
    position: relative;
    background: #081725;
}

#mapLoading {
    position: absolute;
    z-index: 500;
    top: 15px;
    left: 15px;
    padding: 8px 12px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.75);
    color: white;
    font-size: 11px;
}

.map-controls {
    display: flex;
    gap: 10px;
    padding: 12px;
    border-top: 1px solid #1d354d;
}

.map-controls button,
#clearLogButton,
.mode-button,
.modal-buttons button,
#acknowledgeAlertButton {
    padding: 9px 14px;
    border: 1px solid #294a64;
    border-radius: 7px;
    background: #10263b;
    color: white;
}

.map-controls button:hover,
#clearLogButton:hover,
.mode-button:hover,
.modal-buttons button:hover,
#acknowledgeAlertButton:hover {
    background: #173854;
}

.analysis-panel {
    padding-bottom: 18px;
}

.analysis-status {
    padding: 25px 20px;
}

.analysis-status > span,
.priority-box > span,
.telemetry span {
    color: #7891a7;
    font-size: 10px;
    letter-spacing: 1px;
}

.analysis-status strong {
    display: block;
    margin-top: 8px;
    font-size: 25px;
}

.analysis-status p {
    margin-top: 10px;
    color: #a9bbca;
    line-height: 1.5;
    font-size: 13px;
}

.priority-box {
    margin: 0 20px 20px;
    padding: 17px;
    border: 1px solid #1d354d;
    border-radius: 9px;
    background: #091625;
}

.priority-box strong {
    display: block;
    margin-top: 7px;
    color: #ffd34e;
    font-size: 22px;
}

.telemetry {
    padding: 0 20px;
}

.telemetry h3 {
    margin-bottom: 12px;
    font-size: 14px;
}

.telemetry-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.telemetry-grid > div {
    padding: 13px;
    border: 1px solid #1d354d;
    border-radius: 8px;
    background: #091625;
}

.telemetry strong {
    display: block;
    margin-top: 7px;
    font-size: 17px;
}

.observations-panel,
.alerts-panel,
.event-panel {
    margin-bottom: 20px;
}

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 13px 15px;
    border-bottom: 1px solid #182f44;
    text-align: left;
    font-size: 12px;
    white-space: nowrap;
}

th {
    color: #7891a7;
    font-size: 10px;
    text-transform: uppercase;
}

td {
    color: #d8e5ef;
}

#alertsContainer {
    padding: 15px;
}

.alert-item {
    padding: 14px;
    margin-bottom: 10px;
    border-left: 3px solid #ff9d00;
    border-radius: 6px;
    background: #151f29;
}

.alert-item strong {
    color: #ffbd45;
    font-size: 12px;
}

.alert-item p {
    margin: 7px 0;
    color: #dce7ef;
    font-size: 12px;
}

.alert-item small {
    color: #70879a;
}

#eventLog {
    max-height: 300px;
    overflow-y: auto;
    padding: 10px 15px;
}

.log-entry {
    display: grid;
    grid-template-columns: 80px 65px 1fr;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid #142a3e;
    color: #b9c9d6;
    font-size: 11px;
}

.log-entry strong {
    color: #69cfff;
}

.mission-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.mode-button.active {
    border-color: #3aa8ee;
    background: #16466a;
}

.connection {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #8198ad;
    font-size: 11px;
}

.connection strong {
    color: white;
}

footer {
    padding: 20px;
    border-top: 1px solid #1d354d;
    text-align: center;
    color: #60798f;
    font-size: 10px;
    letter-spacing: 1px;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.72);
}

.modal.open {
    display: flex;
}

.modal-content {
    width: min(430px, 100%);
    padding: 22px;
    border: 1px solid #2b4c66;
    border-radius: 12px;
    background: #0b1b2d;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
}

.modal-header h2 {
    font-size: 18px;
}

.modal-header button {
    border: 0;
    background: transparent;
    color: white;
    font-size: 25px;
}

.modal-content label {
    display: block;
    margin: 16px 0;
    color: #b5c7d6;
    font-size: 13px;
}

.modal-content input[type="number"] {
    width: 100%;
    margin-top: 7px;
    padding: 10px;
    border: 1px solid #29455e;
    border-radius: 7px;
    outline: none;
    background: #081522;
    color: white;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

#saveSettingsButton {
    background: #145b85;
}

.leaflet-container {
    background: #081725;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
    background: #0b1b2d;
    color: white;
}

.leaflet-control-zoom a {
    background: #0b1b2d !important;
    color: white !important;
    border-color: #29455e !important;
}

@media (max-width: 1000px) {

    .dashboard {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .analysis-panel {
        min-height: auto;
    }
}


@media (max-width: 650px) {

    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .system-info {
        width: 100%;
        justify-content: space-between;
    }

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

    .satellite-list {
        overflow-x: auto;
    }

    .satellite-card {
        min-width: 130px;
    }

    #earthMap {
        height: 400px;
    }

    .connection {
        width: 100%;
        margin-left: 0;
    }

    .log-entry {
        grid-template-columns: 70px 55px 1fr;
    }
}
body {
    background: #A6CFD5;
}
