:root {
    --bg-color: #080808;
    --text-primary: #e5e5e5;
    --text-secondary: #888888;
    --border-color: rgba(255, 255, 255, 0.15);
    --accent-color: #ffffff;
    --accent-glow: rgba(255, 255, 255, 0.3);
    
    --font-main: 'Inter', sans-serif;
    --font-mono: 'Space Mono', monospace;
    
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

html, body {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    height: 100vh;
    overflow: hidden;
    line-height: 1.5;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    background-position: center center;
}

/* Layout Grid */
.layout-grid {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 40px;
    width: 100%;
    margin: 0 auto;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

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

.logo-icon {
    width: 24px;
    height: 24px;
    background: var(--text-primary);
    position: relative;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

h1 {
    font-family: var(--font-mono);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 2px;
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-item {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
}

.pulse {
    width: 8px;
    height: 8px;
    background-color: #00ff00;
    border-radius: 50%;
    box-shadow: 0 0 10px #00ff00;
    animation: pulse 2s infinite;
}

.pulse.error {
    background-color: #ff0000;
    box-shadow: 0 0 10px #ff0000;
}

@keyframes pulse {
    0% { transform: scale(0.95); opacity: 0.7; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.7; }
}

/* Main Content Grid */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    flex-grow: 1;
    overflow: hidden;
}

.left-column {
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow: hidden;
    height: 100%;
}

.left-column .grid-box {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.grid-box {
    border: 1px solid var(--border-color);
    padding: 20px;
    position: relative;
    background: rgba(8, 8, 8, 0.7);
    backdrop-filter: blur(10px);
}

.grid-box::before, .grid-box::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--text-primary);
}

.grid-box::before { top: -3px; left: -3px; }
.grid-box::after { bottom: -3px; right: -3px; }

.section-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
    letter-spacing: 1px;
}

/* IP Section */
.ip-display-container {
    margin-bottom: 20px;
}

.ip-title {
    font-size: 1rem;
    font-weight: 300;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.ip-value {
    font-family: var(--font-mono);
    font-size: clamp(1.8rem, 3.5vw, 3.5rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 15px;
    word-break: break-all;
    overflow-wrap: break-word;
}

.action-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 24px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.action-btn::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 0%; height: 100%;
    background: var(--text-primary);
    z-index: -1;
    transition: var(--transition);
}

.action-btn:hover {
    color: var(--bg-color);
    border-color: var(--text-primary);
}

.action-btn:hover::before {
    width: 100%;
}

.action-btn.success {
    background: var(--text-primary);
    color: var(--bg-color);
}

/* Connection Details & Geo Grid */
.connection-details {
    display: flex;
    gap: 30px;
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
}

.geo-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.detail-box, .geo-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.detail-label, .geo-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.detail-value, .geo-value {
    font-family: var(--font-mono);
    font-size: 1rem;
}

/* Visualization Section */
.visual-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    overflow: hidden;
}

/* Map specific styling to match theme */
.leaflet-container {
    background: #080808 !important;
    font-family: var(--font-mono);
}

.leaflet-popup-content-wrapper {
    background: rgba(8, 8, 8, 0.9) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color);
    border-radius: 0;
    backdrop-filter: blur(10px);
}

.leaflet-popup-tip {
    background: rgba(8, 8, 8, 0.9) !important;
    border: 1px solid var(--border-color);
}

/* Footer */
.footer {
    text-align: center;
    padding-top: 15px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Responsive */
@media (max-width: 900px) {
    html, body {
        height: auto;
        overflow: auto;
        overflow-x: hidden;
    }
    .layout-grid {
        height: auto;
        width: 100%;
        max-width: 100vw;
        padding: 15px;
        overflow-x: hidden;
    }
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    .nav-links {
        width: 100%;
        justify-content: space-between;
    }
    .main-content {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        overflow: visible;
    }
    .left-column {
        overflow-y: visible;
    }
    .visual-section {
        min-height: 400px;
        order: -1;
    }
    .ip-value {
        font-size: 2.5rem;
    }
}

/* Jumping Dots Animation */
.jumping-dots::after {
    content: '.';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { color: rgba(0,0,0,0); text-shadow: .25em 0 0 rgba(0,0,0,0), .5em 0 0 rgba(0,0,0,0); }
    40% { color: inherit; text-shadow: .25em 0 0 rgba(0,0,0,0), .5em 0 0 rgba(0,0,0,0); }
    60% { text-shadow: .25em 0 0 inherit, .5em 0 0 rgba(0,0,0,0); }
    80%, 100% { text-shadow: .25em 0 0 inherit, .5em 0 0 inherit; }
}
