@import url('https://fonts.googleapis.com/css2?family=VT323&family=Share+Tech+Mono&display=swap');

:root {
    --crt-light-bg: #eae9ff;
    --crt-dark-bg: #1f1d6b;
    --crt-accent: #582b9a;
    --crt-logo: #514ef5;
    --crt-neutral: #181928;
    --crt-terminal-bg: #0a0a12;
    --crt-terminal-glow: #00ff41;
    --crt-terminal-text: #33ff77;
    --crt-terminal-dim: #116622;
    --crt-scanline: rgba(0, 0, 0, 0.15);
    --crt-bezel: #2a2a3a;
    --crt-bezel-light: #4a4a5a;
    --crt-bezel-dark: #1a1a2a;
    --crt-segment-on: #ff3344;
    --crt-segment-off: rgba(255, 51, 68, 0.12);
    --crt-sticker-bg: #f5f4e8;
    --crt-sticker-border: #d8d6c4;
}

* {
    box-sizing: border-box;
    font-variant-ligatures: none;
}

/* html[data-bs-theme="dark"] {
    --page-bg: var(--crt-dark-bg);
    --page-text: #e0e0f0;
} */

html[data-bs-theme="light"] {
    --page-bg: var(--crt-light-bg);
    --page-text: var(--crt-neutral);
}

body {
    font-family: 'Share Tech Mono', 'Ubuntu Mono', 'Courier New', monospace;
    background: var(--page-bg);
    color: var(--page-text);
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

html, body {
    overscroll-behavior: contain;
}

.crt-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px 16px;
}

.crt-monitor {
    background: linear-gradient(
        180deg,
        #3d3d4d 0%,
        #2a2a3a 8%,
        #252535 50%,
        #1f1f2f 92%,
        #181828 100%
    );
    border-radius: 24px;
    padding: 24px;
    position: relative;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 8px 20px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -1px 0 rgba(0, 0, 0, 0.3);
}

.crt-monitor-badge {
    position: absolute;
    top: 6px;
    right: 48px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.35);
    text-decoration: none;
    letter-spacing: 0.5px;
    z-index: 5;
    transition: color 0.2s ease;
}

.crt-monitor-badge strong {
    color: hsla(242deg, 57%, 80%, 0.5);
    font-weight: normal;
    transition: color 0.2s ease;
}

.crt-monitor-badge:hover strong {
    color: hsla(242deg, 57%, 80%, 0.7);
}

.crt-monitor::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20px;
    right: 20px;
    height: 50%;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.06) 0%,
        transparent 100%
    );
    border-radius: 24px 24px 0 0;
    pointer-events: none;
}

.crt-monitor::after {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 6px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(80, 80, 100, 0.5) 20%,
        rgba(100, 100, 120, 0.6) 50%,
        rgba(80, 80, 100, 0.5) 80%,
        transparent 100%
    );
    border-radius: 3px;
}

.crt-screen-wrapper {
    background: linear-gradient(145deg, #0a0a0a 0%, #000000 100%);
    border-radius: 16px;
    padding: 6px;
    box-shadow: 
        inset 0 4px 20px rgba(0, 0, 0, 0.9),
        inset 0 0 0 1px rgba(0, 0, 0, 0.8),
        0 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
}

.crt-screen-wrapper::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
}

.crt-screen {
    background: radial-gradient(
        ellipse at center,
        #0d1a0d 0%,
        #0a0f0a 40%,
        #050805 100%
    );
    border-radius: 12px;
    padding: 28px;
    position: relative;
    overflow: hidden;
    min-height: 420px;
    box-shadow: inset 0 0 100px rgba(0, 255, 65, 0.03);
}

.crt-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        var(--crt-scanline) 2px,
        var(--crt-scanline) 4px
    );
    pointer-events: none;
    z-index: 10;
}

.crt-screen::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(
        ellipse at center,
        transparent 0%,
        rgba(0, 0, 0, 0.15) 60%,
        rgba(0, 0, 0, 0.4) 100%
    );
    pointer-events: none;
    z-index: 11;
}

.crt-content {
    position: relative;
    z-index: 5;
    font-family: 'VT323', monospace;
    color: var(--crt-terminal-text);
}

.crt-header {
    border-bottom: 1px solid var(--crt-terminal-dim);
    padding-bottom: 12px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.crt-title {
    font-size: 20px;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-shadow: 0 0 8px var(--crt-terminal-glow);
}

.crt-status {
    font-size: 18px;
    color: var(--crt-terminal-dim);
}

.crt-status .online {
    color: var(--crt-terminal-glow);
    animation: blink-soft 2s infinite;
}

@keyframes blink-soft {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.crt-form-group {
    margin-bottom: 16px;
}

.crt-label {
    display: block;
    font-size: 18px;
    color: var(--crt-terminal-dim);
    margin-bottom: 4px;
    transition: color 0.15s;
}

.crt-form-group:focus-within .crt-label {
    color: var(--crt-terminal-glow);
    text-shadow: 0 0 8px rgba(0, 255, 65, 0.4);
}

.crt-form-box {
    border: 1px solid var(--crt-terminal-dim);
    margin-bottom: 16px;
    position: relative;
}

.crt-form-header {
    background: rgba(0, 20, 10, 0.5);
    border-bottom: 1px solid var(--crt-terminal-dim);
    padding: 6px 12px;
    font-size: 18px;
    color: var(--crt-terminal-dim);
}

.crt-form-box .crt-row {
    padding: 12px 12px 0;
}

.crt-input,
.crt-select {
    width: 100%;
    background: rgba(0, 15, 8, 0.8);
    border: 1px solid var(--crt-terminal-dim);
    border-left: 2px solid var(--crt-terminal-dim);
    color: var(--crt-terminal-text);
    font-family: 'VT323', monospace;
    font-size: 18px;
    padding: 8px 12px;
    border-radius: 0;
    outline: none;
    transition: border-color 0.15s, background 0.15s;
}

.crt-input:focus,
.crt-select:focus {
    border-color: var(--crt-terminal-glow);
    border-left-color: var(--crt-terminal-glow);
    background: rgba(0, 25, 12, 0.9);
}

.crt-input::placeholder {
    color: var(--crt-terminal-dim);
    opacity: 0.7;
}

.crt-dropdown {
    position: relative;
    width: 100%;
}

.crt-dropdown-selected {
    width: 100%;
    background: rgba(0, 15, 8, 0.8);
    border: 1px solid var(--crt-terminal-dim);
    border-left: 2px solid var(--crt-terminal-dim);
    color: var(--crt-terminal-text);
    font-family: 'VT323', monospace;
    font-size: 18px;
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: border-color 0.15s, background 0.15s;
    outline: none;
}

.crt-dropdown-selected:focus,
.crt-dropdown.open .crt-dropdown-selected {
    border-color: var(--crt-terminal-glow);
    border-left-color: var(--crt-terminal-glow);
    background: rgba(0, 25, 12, 0.9);
}

.crt-dropdown-arrow {
    font-size: 12px;
    color: var(--crt-terminal-dim);
    transition: transform 0.15s, color 0.15s;
}

.crt-dropdown.open .crt-dropdown-arrow {
    transform: rotate(180deg);
    color: var(--crt-terminal-glow);
}

.crt-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #060a06;
    border: 1px solid var(--crt-terminal-glow);
    border-top: none;
    z-index: 100;
    display: none;
}

.crt-dropdown.open .crt-dropdown-menu {
    display: block;
    box-shadow: rgba(0, 255, 65, 0.15) 8px 8px 0 0;
}

.crt-dropdown-item {
    padding: 8px 1em;
    padding-left: 2em;
    font-family: 'VT323', monospace;
    font-size: 18px;
    color: var(--crt-terminal-text);
    cursor: pointer;
    line-height: 1.2;
    border-left: 2px solid transparent;
    transition: all 0.1s;
}

.crt-dropdown-item:hover {
    background: rgba(0, 255, 65, 0.1);
    border-left-color: var(--crt-terminal-glow);
}

.crt-dropdown-menu:not(:hover) > .crt-dropdown-item.active {
    background: rgba(0, 255, 65, 0.15);
    border-left-color: var(--crt-terminal-glow);
}

.crt-dropdown-menu:not(:hover) > .crt-dropdown-item.active::before,
.crt-dropdown-item:hover::before {
    display: inline-block;
    content: '►';
    color: var(--crt-terminal-glow);
    width: 1em;
    margin-left: -1em;
}

.crt-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.crt-col {
    flex: 1;
    min-width: 200px;
}

.crt-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px;
    padding-top: 8px;
}

.crt-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--crt-terminal-dim);
    font-size: 16px;
    cursor: pointer;
}

.crt-checkbox input {
    accent-color: var(--crt-terminal-glow);
    width: 16px;
    height: 16px;
}

.crt-checkbox a {
    color: var(--crt-terminal-text);
}

.crt-btn {
    background: transparent;
    border: 1px solid var(--crt-terminal-glow);
    color: var(--crt-terminal-glow);
    font-family: 'VT323', monospace;
    font-size: 18px;
    padding: 8px 20px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.15s;
    margin-left: auto;
    border-radius: 0;
}

.crt-btn:hover {
    background: var(--crt-terminal-glow);
    color: #000;
    text-shadow: none;
}

.crt-btn:active {
    background: #00cc33;
}

.crt-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: transparent;
    color: var(--crt-terminal-dim);
    border-color: var(--crt-terminal-dim);
}

.crt-terminal {
    border: 1px solid var(--crt-terminal-dim);
    position: relative;
}

.crt-terminal-header {
    background: rgba(0, 20, 10, 0.5);
    border-bottom: 1px solid var(--crt-terminal-dim);
    padding: 6px 12px;
    font-size: 18px;
    color: var(--crt-terminal-dim);
}

.crt-terminal-output {
    margin: 0;
    padding: 12px;
    font-family: 'VT323', monospace;
    font-size: 17px;
    color: var(--crt-terminal-text);
    white-space: pre-wrap;
    word-break: break-all;
    height: 200px;
    overflow-y: auto;
    background: rgba(0, 8, 4, 0.6);
}

.crt-terminal-output:empty::before {
    content: 'Waiting for command...';
    color: var(--crt-terminal-dim);
    opacity: 0.5;
}

.crt-alert {
    background: rgba(255, 30, 30, 0.12);
    border: 1px solid #cc2233;
    border-left: 2px solid #ff3344;
    color: #ff6666;
    padding: 6px 10px;
    margin-top: 10px;
    font-size: 16px;
}

.crt-info-panel {
    background: linear-gradient(
        180deg,
        #353545 0%,
        #2a2a3a 20%,
        #252535 80%,
        #202030 100%
    );
    border-radius: 12px;
    margin-top: 12px;
    padding: 20px 24px 20px 245px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
    min-height: 120px;
}

.crt-sticker {
    background: 
        linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%),
        linear-gradient(180deg, #faf9f0 0%, #f0efe4 40%, #e8e7da 100%);
    border: none;
    border-radius: 2px;
    padding: 10px 12px;
    width: 156px;
    aspect-ratio: 1 / 1;
    position: absolute;
    left: 20px;
    top: 12px;
    transform: rotate(-2.4deg);
    box-shadow: 
        3px 4px 10px rgba(0, 0, 0, 0.4),
        1px 2px 3px rgba(0, 0, 0, 0.25),
        inset 0 0 0 1px rgba(255, 255, 255, 0.4);
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: center;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 100% 100%, 0 100%);
    transition: clip-path 0.2s ease;
}

.crt-sticker::before {
    content: '';
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 0;
    height: 0;
    background: linear-gradient(
        315deg,
        #d0cec0 0%,
        #e0ded0 100%
    );
    box-shadow: -2px -2px 3px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
    z-index: 15;
    transform: rotate(0deg);
}

.crt-sticker::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        repeating-linear-gradient(
            90deg,
            transparent 0px,
            transparent 2px,
            rgba(0, 0, 0, 0.01) 2px,
            rgba(0, 0, 0, 0.01) 4px
        );
    pointer-events: none;
    border-radius: 2px;
}

.crt-sticker-item {
    position: relative;
    z-index: 1;
}

.crt-sticker-item + .crt-sticker-item {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed rgba(0, 0, 0, 0.12);
}

.crt-logo-emblem {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
    flex: 1;
    min-width: 100px;
    text-align: center;
}

.crt-logo-img {
    width: 55px;
    height: auto;
    opacity: 0.85;
    filter: 
        drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3))
        drop-shadow(0 0 1px rgba(0, 0, 0, 0.2));
    user-select: none;
    margin-bottom: 8px;
    transition: filter 0.2s ease;
}

.crt-logo-text {
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1.4;
    display: flex;
    flex-direction: column;
}

.crt-logo-text span:first-child {
    color: rgba(255, 255, 255, 0.6);
}

.crt-logo-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    transition: 450ms;
}

.crt-logo-link:hover {
    filter: 
        drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5))
        drop-shadow(0 0 8px rgba(81, 78, 245, 0.3))
        saturate(1.25);
}

.crt-sticker:hover {
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%);
}

.crt-sticker:hover::before {
    width: 20px;
    height: 20px;
    border-top-left-radius: 2px;
    box-shadow: -2px -2px 4px rgba(0, 0, 0, 0.25);
    transform: rotate(-5deg);
}

.crt-sticker-title {
    font-family: 'Share Tech Mono', monospace;
    font-size: 8px;
    text-transform: uppercase;
    color: #666;
    letter-spacing: 1px;
    margin-bottom: 4px;
    position: relative;
    z-index: 1;
}

.crt-sticker-value {
    font-family: 'Share Tech Mono', monospace;
    font-size: 10px;
    color: #2a2a2a;
    word-break: break-all;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    line-height: 1.3;
}

.crt-sticker-value.ip4 {
    color: var(--crt-accent);
    font-weight: 700;
}

.crt-sticker-value.ip6 {
    color: var(--crt-logo);
    font-weight: 700;
}

.crt-segment-panel {
    background: linear-gradient(
        180deg,
        #1f1f1f 0%,
        #151515 50%,
        #101010 100%
    );
    border-radius: 8px;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 190px;
    box-shadow: 
        inset 0 2px 8px rgba(0, 0, 0, 0.6),
        inset 0 0 0 1px rgba(255, 255, 255, 0.03),
        0 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
}

.crt-segment-panel::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
}

.crt-segment-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.crt-segment-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 9px;
    text-transform: uppercase;
    color: #555;
    letter-spacing: 1.5px;
    min-width: 55px;
}

.seven-segment {
    font-family: 'VT323', monospace;
    font-size: 24px;
    color: var(--crt-segment-on);
    text-shadow: 
        0 0 10px var(--crt-segment-on),
        0 0 20px rgba(255, 51, 68, 0.5),
        0 0 30px rgba(255, 51, 68, 0.3);
    letter-spacing: 2px;
    background: linear-gradient(180deg, #0a0a0a 0%, #050505 100%);
    padding: 6px 12px;
    border-radius: 4px;
    border: 1px solid #222;
    box-shadow: 
        inset 0 1px 3px rgba(0, 0, 0, 0.5),
        0 1px 0 rgba(255, 255, 255, 0.03);
}

.seven-segment.ip {
    font-size: 13px;
    color: #00ddff;
    text-shadow: 
        0 0 8px #00ddff,
        0 0 16px rgba(0, 221, 255, 0.5);
}

.seven-segment.latency {
    min-width: 75px;
    text-align: right;
}

.seven-segment .unit {
    font-size: 11px;
    opacity: 0.7;
    margin-left: 2px;
}


.crt-footer {
    text-align: center;
    padding: 24px 16px;
    font-size: 13px;
    color: rgba(128, 128, 160, 0.7);
}

.crt-footer a {
    color: var(--crt-logo);
    text-decoration: none;
}

.crt-footer a:hover {
    text-decoration: underline;
}

@keyframes cursor-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.crt-cursor {
    display: inline-block;
    width: 10px;
    height: 18px;
    background: var(--crt-terminal-glow);
    animation: cursor-blink 1s step-end infinite;
    vertical-align: middle;
    margin-left: 4px;
}

.crt-copy-btn {
    background: linear-gradient(180deg, #f8f8f0 0%, #e8e8e0 100%);
    border: 1px solid #c0c0b0;
    color: #555;
    font-family: 'Share Tech Mono', monospace;
    font-size: 9px;
    padding: 4px 0;
    width: 44px;
    cursor: pointer;
    border-radius: 2px;
    margin-top: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.15s;
    box-shadow: 
        0 1px 2px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    position: relative;
    z-index: 2;
    flex-shrink: 0;
}

.crt-copy-btn:hover {
    background: linear-gradient(180deg, var(--crt-accent) 0%, #4a2080 100%);
    border-color: var(--crt-accent);
    color: #fff;
    box-shadow: 
        0 2px 4px rgba(88, 43, 154, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.crt-copy-btn:active {
    transform: translateY(1px);
    box-shadow: 
        0 1px 2px rgba(0, 0, 0, 0.15),
        inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

@media (max-width: 700px) {
    html {
        background-color: #181828;
    }

    .crt-container {
        padding: 0;
    }

    .crt-monitor {
        padding: 16px;
        padding-top: 24px;
        border-radius: 0;
        box-shadow: none;
    }

    .crt-monitor::before {
        left: 0;
        right: 0;
        border-radius: 0;
        background: linear-gradient(180deg, #181828 0%, rgba(255, 255, 255, 0.06) 15%, transparent 100%);
    }
    
    .crt-monitor::after {
        opacity: 0.5;
    }

    .crt-screen {
        padding: 16px;
        min-height: 320px;
    }
    
    .crt-title {
        font-size: 18px;
    }
    
    .crt-row {
        flex-direction: column;
    }
    
    .crt-col {
        min-width: 100%;
    }
    
    .crt-info-panel {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 20px 24px;
    }
    
    .crt-logo-emblem {
        order: 0;
        padding: 10px;
        align-items: flex-start;
        text-align: left;
    }
    
    .crt-logo-img {
        width: 64px;
    }

    .crt-logo-text {
        margin-top: 4px;
        font-size: 13px;
    }

    .crt-segment-panel {
        margin-top: 10px;
    }
    
    .crt-sticker {
        transform: rotate(2.9deg);
        margin: 0;
        min-width: auto;
        right: 12px;
        left: auto;
    }
    
    .crt-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .crt-btn {
        margin-left: 0;
        text-align: center;
    }
}
