@keyframes text-glitch {
    0% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
    100% { transform: translate(0); }
}

@keyframes scanline {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(100%);
    }
}

@keyframes text-flicker {
    0%, 100% {
        opacity: 1;
        text-shadow: 0 0 8px #00FF00, 0 0 10px #00FF00;
    }
    50% {
        opacity: 0.7;
        text-shadow: 0 0 12px #39FF14, 0 0 15px #39FF14;
    }
}

@keyframes border-flow {
    0% {
        box-shadow: 0 0 25px rgba(0, 255, 0, 0.6), inset 0 0 10px rgba(0, 255, 0, 0.4);
    }
    50% {
        box-shadow: 0 0 35px rgba(57, 255, 20, 0.8), inset 0 0 15px rgba(57, 255, 20, 0.6);
    }
    100% {
        box-shadow: 0 0 25px rgba(0, 255, 0, 0.6), inset 0 0 10px rgba(0, 255, 0, 0.4);
    }
}

@keyframes fade-in-stagger {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes marker-pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes flash-red {
    0%, 100% {
        color: #FF4136;
        text-shadow: 0 0 10px #FF4136, 0 0 15px #FF4136;
        border-color: #FF4136;
    }
    50% {
        color: #fff;
        text-shadow: none;
        border-color: #fff;
    }
}

html, body {
    max-width: 100vw;
    overflow-x: hidden;
    height: auto;
    min-height: 100%;
    margin: 0;
    padding: 0;
}

body {
    background-color: #000;
    color: #00FF00;
    font-family: 'VT323', monospace;
    display: flex;
    justify-content: center;
    align-items: center;
    text-shadow: 0 0 8px #00FF00, 0 0 10px #00FF00;
    overflow-y: auto;
}

body::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(
        rgba(0, 0, 0, 0.75),
        rgba(0, 0, 0, 0.75)
    ), url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAAXNSR0IArs4c6QAAABNJREFUGFdjZGBg+M+ACdAABQACsAFbHVTGlAAAAABJRU5ErkJggg==');
    background-size: auto, 8px 8px;
    opacity: 0.1;
    pointer-events: none;
    z-index: 1000;
}

body::after {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(to bottom, rgba(18, 16, 16, 0) 50%, rgba(0, 255, 0, 0.25) 50%);
    background-size: 100% 4px;
    z-index: 1001;
    pointer-events: none;
    animation: scanline 10s linear infinite;
}

#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1; /* Position behind everything */
}

::-webkit-scrollbar {
    width: 8px;
    max-width: 1100px; /* Increased max-width for wider layout */
    backdrop-filter: blur(2px);
    z-index: 10;
    animation: border-flow 4s ease-in-out infinite;
    display: none; /* Hide until boot is complete */
}

::-webkit-scrollbar-track {
    background: #0a0a0a;
}

::-webkit-scrollbar-thumb {
    background: #00FF00;
    box-shadow: 0 0 5px #00FF00;
}

.container {
    text-align: center;
    background-color: rgba(10, 10, 10, 0.8);
    padding: 30px;
    border: 2px solid #00FF00;
    box-shadow: 0 0 25px rgba(0, 255, 0, 0.6);
    width: 90%;
    max-width: 1100px;
    backdrop-filter: blur(2px);
    z-index: 10;
    animation: border-flow 4s ease-in-out infinite;
}

h1 {
    margin-top: 0;
    margin-bottom: 25px;
    font-size: 2.5em;
    letter-spacing: 5px;
    text-transform: uppercase;
    animation: text-flicker 3s ease-in-out infinite;
}

.main-content {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
}

.info-grid {
    flex-basis: 50%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    text-align: left;
}

.info-item {
    background-color: #111;
    padding: 12px;
    border: 1px dashed #00FF00;
    font-size: 1.2em;
    overflow-wrap: break-word;
    opacity: 0;
    animation: fade-in-stagger 0.5s ease-out forwards;
    text-shadow: none;
}

.info-item strong {
    color: #fff;
    text-shadow: none;
    background-color: #111;
}

#copy-btn {
    padding: 10px 20px;
    background-color: transparent;
    color: #00FF00;
    border: 2px solid #00FF00;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, text-shadow 0.2s;
    font-family: 'VT323', monospace;
    font-size: 1.2em;
    margin-top: 10px;
    text-shadow: 0 0 8px #00FF00;
}

#copy-btn:hover {
    background-color: #00FF00;
    color: #000;
    text-shadow: none;
    animation: text-glitch 0.2s;
}

#map {
    flex-basis: 50%;
    height: auto;
    min-height: 400px;
    border: 2px solid #00FF00;
    background-color: #111;
}

.leaflet-tile-pane {
    /* This filter will brighten the dark map to reveal details */
    filter: brightness(1.7) contrast(0.9) grayscale(0.4);
}

.leaflet-popup-content-wrapper, .leaflet-popup-tip {
    background: #0a0a0a;
    color: #00FF00;
    border: 1px solid #00FF00;
    box-shadow: 0 0 10px #00FF00;
}

.leaflet-popup-content {
    font-family: 'VT323', monospace;
    font-size: 1.1em;
    text-shadow: 0 0 5px #00FF00;
}

.leaflet-marker-icon.pulsing-marker {
    animation: marker-pulse 2s infinite;
}

@media (max-width: 800px) {
    .main-content {
        flex-direction: column;
    }

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

#boot-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'VT323', monospace;
    color: #00FF00;
    font-size: 1.5em;
    text-shadow: 0 0 8px #00FF00;
    opacity: 1;
    transition: opacity 1s ease-in-out;
}

#boot-text {
    white-space: pre;
    text-align: left;
}

#status-panel {
    border: 2px dashed #00FF00;
    padding: 10px;
    margin-bottom: 20px;
    font-size: 1.5em;
    text-align: center;
    transition: all 0.5s ease;
}

#status-panel.secure {
    color: #00FF00;
    text-shadow: 0 0 8px #00FF00;
    border-color: #00FF00;
}

#status-panel.notice {
    color: #FFDC00; /* Amber */
    text-shadow: 0 0 8px #FFDC00;
    border-color: #FFDC00;
}

#status-panel.alert {
    animation: flash-red 1.5s infinite;
}

#console {
    margin-bottom: 20px;
}

#trace-form {
    display: flex;
}

#target-input {
    flex-grow: 1;
    background-color: #0a0a0a;
    border: 2px solid #00FF00;
    color: #00FF00;
    font-family: 'VT323', monospace;
    font-size: 1.3em;
    padding: 8px;
    text-shadow: 0 0 5px #00FF00;
}

#target-input::placeholder {
    color: #00FF00;
    opacity: 0.5;
}

#trace-btn {
    background: transparent;
    border: 2px solid #00FF00;
    color: #00FF00;
    font-family: 'VT323', monospace;
    font-size: 1.3em;
    padding: 8px 15px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

#trace-btn:hover {
    background-color: #00FF00;
    color: #000;
}

#locate-self-btn {
    background-color: #00FF00;
    color: #000;
    border: 2px solid #00FF00;
    text-shadow: none;
}

#locate-self-btn:hover {
    background-color: transparent;
    color: #00FF00;
    text-shadow: 0 0 8px #00FF00;
}

.controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
    animation: text-glitch 0.2s;
}

h1 {
    font-size: 1.2em;
    text-shadow: 0 0 8px #00FF00;
}

#copy-btn:hover, #locate-self-btn:hover {
    background-color: #00FF00;
    color: #000;
    text-shadow: none;
    animation: text-glitch 0.2s;
}

path.leaflet-interactive.trace-route {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: draw-line 2s ease-in-out forwards;
}

path.leaflet-interactive.trace-route.finished {
    animation: glow-pulse 2s infinite ease-in-out;
}

@keyframes glow-pulse {
    0% {
        stroke: #00FF00;
        filter: drop-shadow(0 0 2px #00FF00);
    }
    50% {
        stroke: #39FF14;
        filter: drop-shadow(0 0 5px #39FF14);
    }
    100% {
        stroke: #00FF00;
        filter: drop-shadow(0 0 2px #00FF00);
    }
}

@keyframes area-pulse {
    0% {
        stroke-opacity: 0.7;
        fill-opacity: 0.2;
    }
    50% {
        stroke-opacity: 1;
        fill-opacity: 0.4;
    }
    100% {
        stroke-opacity: 0.7;
        fill-opacity: 0.2;
    }
}

@keyframes draw-line {
    to {
        stroke-dashoffset: 0;
    }
}

.accuracy-circle {
    animation: area-pulse 3s infinite ease-in-out;
}

#main-container, .container, .boot-sequence, .ip-lookup, #map-container {
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    display: block !important;
}

@media (max-width: 600px) {
    html, body {
        max-width: 100vw;
        overflow-x: hidden;
        height: auto;
        min-height: 100%;
        margin: 0;
        padding: 0;
        background-size: cover;
        overscroll-behavior-y: contain;
    }
    body {
        overflow-y: auto;
    }
    #main-container, .container, .boot-sequence, .ip-lookup, #map-container {
        width: 100vw !important;
        max-width: 100vw !important;
        min-width: 0 !important;
        height: auto !important;
        min-height: 0 !important;
        box-sizing: border-box;
        padding: 0.5em 0.2em;
        margin: 0 auto;
        border-radius: 0;
        overflow: visible !important;
        display: block !important;
    }
    #map-container {
        display: flex !important;
        justify-content: center;
        align-items: center;
        width: 100vw !important;
        max-width: 100vw !important;
        height: auto !important;
        min-height: 0 !important;
        padding: 0;
        overflow: visible !important;
    }
    #map {
        width: 90vw !important;
        height: 90vw !important;
        max-width: 400px;
        max-height: 400px;
        min-width: 120px;
        min-height: 120px;
        aspect-ratio: 1 / 1;
        margin: 0 auto;
        border-radius: 0;
        box-sizing: border-box;
        display: block;
    }
    .ip-info {
        flex-direction: column;
        align-items: stretch;
        gap: 0.3em;
        font-size: 0.95em;
    }
    .ip-info > div {
        width: 100%;
        word-break: break-all;
        padding: 0.2em 0;
    }
    .input-group, .ip-lookup input, .ip-lookup button {
        width: 100% !important;
        font-size: 1.1em;
        margin-bottom: 0.5em;
        min-height: 44px;
        border-radius: 6px;
    }
    .ip-lookup button {
        background: #00ff00;
        color: #111;
        font-weight: bold;
        border: none;
        margin-top: 0.2em;
        min-height: 44px;
        border-radius: 6px;
    }
    .boot-sequence {
        font-size: 0.95em;
        padding: 0.5em 0.2em;
        border-radius: 0;
    }
    h1, h2, h3 {
        font-size: 1.1em;
        margin: 0.3em 0;
        text-align: center;
    }
    canvas {
        max-width: 100vw !important;
        height: 120px !important;
        display: block;
    }
    .decorative, .sci-fi-border, .extra-bg {
        display: none !important;
    }
} 