@import url('https://fonts.googleapis.com/css2?family=Electrolize&display=swap');

body {
    background: #222;
    color: #99ff99;
    font-family: 'Courier New', monospace;
    text-align: center;
    margin: 0;
    padding: 0;
    overflow: hidden;
    height: 100vh;
}

#backgroundCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: none;
    z-index: -1;
    background-color: transparent !important;
}

#background-mars-art {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    color: #008000;
    font-family: 'Courier New', monospace;
    white-space: pre;
    pointer-events: none;
    overflow: hidden;
    opacity: 0.8;
    font-size: 0.6vw;
    line-height: 0.7;
    text-align: left;
}

#page-content-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 60px);
    padding-bottom: 200px;
    box-sizing: border-box;
}

.container {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
}

.map-area {
    width: 55%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.map-container {
    position: relative;
    width: 100%;
    max-width: 720px;
    aspect-ratio: 1 / 1;
    background: radial-gradient(circle, rgba(50,50,50,0.8) 20%, #111 100%);
    border: 2px solid #008800;
    box-shadow: 0px 0px 10px #008800;
    border-radius: 50%;
    overflow: hidden;
}

#stationCanvas {
    display: block;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

.side-panel {
    position: fixed;
    top: 60px;
    right: 10px;
    width: 45%;
    max-width: calc(100% - 55% - 20px - 10px);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0 20px;
    box-sizing: border-box;
    z-index: 500;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #0f0 #222;
}
.side-panel::-webkit-scrollbar { width: 8px; }
.side-panel::-webkit-scrollbar-track { background-color: #222; border-radius: 10px; }
.side-panel::-webkit-scrollbar-thumb { background-color: #0f0; border-radius: 10px; border: 2px solid #222; }
.side-panel::-webkit-scrollbar-thumb:hover { background-color: #00bb00; }

.side-panel-title {
    text-align: center;
    padding: 0;
    margin: 0;
    width: 100%;
}

.side-panel-title h1 {
    font-size: 0.6em;
    line-height: 0.7;
    margin: 0;
    padding: 0;
    color: #0f0;
    text-shadow: 0 0 10px #0f0;
    font-family: 'Courier New', monospace;
    white-space: pre;
    width: 100%;
    overflow-wrap: normal;
}

#status-report {
    min-height: 45px;
}

.info-panel-container {
    border: 2px solid #008800;
    background-color: #000 !important;
    box-shadow: 0px 0px 5px #008800;
    border-radius: 10px;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    position: relative;
    overflow: hidden;
}

.zones-box, .info-box, .status-box, .video-box {
    padding: 15px;
    margin-bottom: 10px;
    border: 1px solid #008800;
    background-color: #000;
    box-shadow: 0px 0px 5px #008800;
    border-radius: 5px;
    box-sizing: border-box;
    width: 100%;
    margin-left: 5px;
    margin-right: 5px;
    position: relative;
    z-index: 2;
}

.button-container {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin: 10px 5px 20px 5px;
    flex-wrap: nowrap;
    gap: 10px;
    position: relative;
    z-index: 2;
}

.info-box, .status-box {
    flex-grow: 0;
}

.info-box {
    margin-top: 2px;
    margin-bottom: 5px;
    padding-top: 5px;
    padding-bottom: 5px;
    padding-left: 10px;
    padding-right: 10px;
    border: 1px solid #008800;
    border-radius: 5px;
    background-color: #000;
    box-shadow: 0px 0px 5px #008800;
    box-sizing: border-box;
    overflow-x: hidden;
    font-weight: bold;
}

.status-box {
    margin-top: 5px;
    margin-bottom: 10px;
    padding-top: 5px;
    padding-bottom: 5px;
    padding-left: 10px;
    padding-right: 10px;
    border: 1px solid #008800;
    border-radius: 5px;
    background-color: #000;
    box-shadow: 0px 0px 5px #008800;
    overflow-y: auto;
    overflow-x: hidden;
    word-wrap: break-word;
    scrollbar-width: thin;
    scrollbar-color: #0f0 #222;
    box-sizing: border-box;
    font-weight: bold;
    line-height: 1.4;
    max-height: 150px;
}

.video-box {
    padding: 5px;
    margin-left: 5px;
    margin-right: 5px;
    margin-bottom: 10px;
    border: 1px solid #008800;
    background-color: #000;
    box-shadow: 0px 0px 5px #008800;
    border-radius: 5px;
    box-sizing: border-box;
    width: 100%;
    height: 180px;
    display: flex;
    align-items: stretch;
    overflow: hidden;
}

.status-box::-webkit-scrollbar { width: 8px; }
.status-box::-webkit-scrollbar-track { background-color: #222; border-radius: 10px; }
.status-box::-webkit-scrollbar-thumb { background-color: #0f0; border-radius: 10px; border: 2px solid #222; }
.status-box::-webkit-scrollbar-thumb:hover { background-color: #00bb00; }

.info-box h2, .status-box h2 {
    color: #99ff99;
    margin-top: 0px;
    margin-bottom: 5px;
    font-size: 1.2em;
    position: relative;
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding-right: 10px;
    padding-left: 10px;
    font-family: 'Electrolize', monospace;
}

.info-box h2::after, .status-box h2::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    bottom: -5px;
    height: 2px;
    background-color: #008800;
}

.legend {
    text-align: left;
    padding-top: 5px;
    padding-bottom: 0px;
}

.legend-item {
    display: flex;
    align-items: center;
    position: relative;
    margin-bottom: 2px;
    cursor: pointer;
    transition: background-color 0.2s;
    padding: 5px;
    border-radius: 3px;
    width: 100%;
    box-sizing: border-box;
}
.legend-item:hover, .legend-item.highlighted-legend {
    background-color: rgba(0, 255, 0, 0.1);
}

.legend-text-wrapper {
    margin-right: auto;
    text-align: right;
    padding-right: 10px;
    position: relative;
}

.color-bar {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    height: 10px;
    left: 0;
    border: 1px solid #0f0;
    animation: color-bar-glow-pulse 2s linear infinite;
}

.green  { color: #00ff00; }
.yellow { color: #ffff00; }
.red    { color: #ff0000; }
.white  { color: #ffffff; }
.blue   { color: #00c3fe; }
.purple { color: #800080; }
.gray   { color: #a9a9a9; }

.bar-green  { background: #00ff00; }
.bar-yellow { background: #ffff00; }
.bar-red    { background: #ff0000; }
.bar-white  { background: #ffffff; }
.bar-blue   { background: #00c3fe; }
.bar-purple { background: #800080; }
.bar-gray   { background: #a9a9a9; }

@keyframes color-bar-glow-pulse {
    0%   { box-shadow: 0 0 5px rgba(0, 255, 0, 0.6); }
    50%  { box-shadow: 0 0 15px rgba(0, 255, 0, 0.75); }
    100% { box-shadow: 0 0 5px rgba(0, 255, 0, 0.6); }
}

.matrix-rain-button, .spin-button, .scan-button {
    display: inline-block;
    padding: 1px 15px;
    background-color: rgba(0, 0, 0, 0.8);
    color: #99ff99;
    border: 2px solid #008800;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.2);
    text-transform: uppercase;
    letter-spacing: 1px;
    box-sizing: border-box;
    text-align: center;
    flex: 1 0 auto;
    min-width: 100px;
    white-space: nowrap;
}
.scan-button:disabled {
    color: #558855;
    border-color: #558855;
    cursor: not-allowed;
    background-color: rgba(0, 0, 0, 0.6);
    box-shadow: none;
}
.scan-button:disabled:hover {
    background-color: rgba(0, 0, 0, 0.6);
    box-shadow: none;
}

.matrix-rain-button:hover, .spin-button:hover, .scan-button:hover {
    background-color: rgba(0, 255, 0, 0.2);
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.4);
}

.matrix-rain-button:active, .spin-button:active, .scan-button:active {
    transform: scale(0.98);
}

#ascii-art-bottom-left {
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 10;
    font-family: 'Courier New', monospace;
    color: #00ff00;
    white-space: pre;
    font-size: 0.3vw;
    line-height: 0.7;
    opacity: 0.8;
    pointer-events: none;
    padding: 10px;
}

.split-animation-wrapper {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: 100%;
    gap: 5px;
}

.split-animation-container {
    flex: 1;
    height: 100%;
    overflow: hidden;
    border: 1px solid #008800;
    box-sizing: border-box;
    position: relative;
    background-color: #111;
}

.split-animation-container canvas,
.split-animation-container svg {
    display: block;
    width: 100%;
    height: 100%;
}

.split-animation-container svg {
    shape-rendering: optimizeSpeed;
    image-rendering: optimizeSpeed;
}

.toggle-animations-button {
    display: inline-block;
    padding: 1px 15px;
    background-color: rgba(0, 0, 0, 0.8);
    color: #99ff99;
    border: 2px solid #008800;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.2);
    text-transform: uppercase;
    letter-spacing: 1px;
    box-sizing: border-box;
    text-align: center;
    flex: 1 1 auto;
    min-width: 100px;
    white-space: nowrap;
}

.toggle-animations-button:hover {
    background-color: rgba(0, 255, 0, 0.2);
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.4);
}

.toggle-animations-button:active {
    transform: scale(0.98);
}

@keyframes sweep-shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.your-shine-target::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, transparent 30%, rgba(0, 255, 65, 0.08) 50%, transparent 70%);
    opacity: 0;
    z-index: 1;
    pointer-events: none;
    will-change: transform, opacity;
    backface-visibility: hidden;
}

.your-shine-target.is-shining::after {
    opacity: 1;
    animation: sweep-shine 2.4s infinite linear;
}

@media (max-width: 1200px) {
    .side-panel {
        position: static;
        width: 90%;
        max-width: none;
        margin-right: 0;
        margin-top: 20px;
    }
    .map-area, .side-panel {
        width: 90%;
        margin-right: 0;
    }
}

@media (max-width: 900px) {
    .container {
        flex-direction: column;
        align-items: center;
    }
    .map-area {
        width: 90%;
        max-width: 720px;
        margin: 0 auto 20px auto;
    }
    .side-panel {
        width: 90%;
        margin: 0 auto;
        position: static;
        max-width: none;
    }
    .button-container {
        flex-direction: column;
    }
    .button-container button {
        width: 100%;
        margin-bottom: 10px;
    }
    #ascii-art-bottom-left {
        font-size: 1.1vw;
    }
}

@media (max-width: 768px) {
    .button-container {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    .button-container button {
        width: 48%;
        margin-bottom: 10px;
    }
    #ascii-art-bottom-left {
        font-size: 1.1vw;
    }
}