﻿:root {
    --chat-height: 72px;
}

body {
    margin: 0;
    height: 100vh;
    background: #000;
    font-family: monospace;
    color: #cfeee3;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    transition: background-image 1s ease-in-out;
}

    body::before {
        content: "";
        position: fixed;
        inset: 0;
        background-position: center;
        background-repeat: no-repeat;
        /*background: url('../images/commando10.JPG') center center no-repeat;*/
        background-size: contain;
        opacity: 1;
        z-index: -1;
    }

/* ---------- General Buttons ---------- */
button {
    padding: 12px 22px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(90deg,#00ff9f22,#00b4ff22);
    color: #00ff9f;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

    button:hover {
        background: linear-gradient(90deg,#00ff9f33,#00b4ff33);
        transform: scale(1.05);
    }

/* ---------- Popup ---------- */
.popup {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0);
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    opacity: 0;
    pointer-events: none;
    transition: .3s ease;
}

    .popup.active {
        opacity: 1;
        pointer-events: auto;
    }

.popup-box {
    width: 280px;
    background: linear-gradient(180deg,rgba(255,255,255,0.02),rgba(255,255,255,0.01));
    border-radius: 12px;
    border: 1px solid rgba(0,255,159,0.12);
    box-shadow: 0 12px 40px rgba(0,0,0,0.7);
    backdrop-filter: blur(6px)saturate(120%);
    padding: 20px;
    z-index: 2;
    margin: 20px;
}

    .popup-box h2 {
        color: #00ff9f;
        margin-bottom: 14px;
        text-shadow: 0 0 8px rgba(0,255,159,0.4);
    }

    .popup-box p {
        color: rgba(255,255,255,0.7);
        font-size: 14px;
        margin-bottom: 14px;
    }

.close-btn {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: none;
    font-size: 20px;
    color: #00b4ff;
    cursor: pointer;
}

/* ---------- Scanlines ---------- */
.scanlines {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    mix-blend-mode: overlay;
    opacity: 0.08;
    background-image: linear-gradient(transparent 90%,rgba(0,0,0,0.12)95%);
    background-size: 100% 6px;
}

/* ---------- Menu ---------- */
.menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

    .menu li {
        margin: 8px 0;
        padding: 10px;
        border-radius: 8px;
        background: rgba(255,255,255,0.03);
        border: 1px solid rgba(0,255,159,0.1);
        color: #bfffe6;
        display: flex;
        align-items: center;
        gap: 10px;
        cursor: pointer;
        transition: all .2s;
    }

        .menu li:hover {
            background: rgba(0,255,159,0.08);
            transform: translateX(6px);
        }

    .menu .num {
        color: #00b4ff;
        font-weight: 700;
    }

    .menu li a {
        display: flex;
        align-items: center;
        gap: 10px;
        color: #bfffe6;
        text-decoration: none;
        width: 100%;
    }

/* ---------- Sub Popup ---------- */
.sub-popup {
    flex: 1;
    margin: 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    opacity: 0;
    pointer-events: none;
    transition: .3s ease;
    z-index: 2;
}

    .sub-popup.active {
        opacity: 1;
        pointer-events: auto;
    }

.sub-box {
    width: 500px;
    max-width: 92%;
    background: linear-gradient(180deg,rgba(255,255,255,0.03),rgba(255,255,255,0.015));
    border-radius: 12px;
    border: 1px solid rgba(0,180,255,0.25);
    box-shadow: 0 0 20px rgba(0,180,255,0.2), inset 0 0 10px rgba(0,180,255,0.05);
    backdrop-filter: blur(8px)saturate(120%);
    -webkit-backdrop-filter: blur(8px) saturate(120%);
    padding: 22px;
    position: relative;
    flex: 1;
}
    .sub-box::before {
        content: "";
        position: absolute;
        inset: 0;
        background: inherit;
        filter: blur(18px);
        z-index: -1;
        opacity: 0.7;
    }

    .sub-box h3 {
        color: #00b4ff;
        margin-bottom: 10px;
    }

    .sub-box p {
        color: rgba(255,255,255,0.75);
        font-size: 14px;
        line-height: 1.5;
    }

.close-sub {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: none;
    font-size: 20px;
    color: #00ff9f;
    cursor: pointer;
}

/* ---------- Chat ---------- */
.chat-wrapper {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--chat-height);
    display: flex;
    flex-direction: column;
    border-top: 1px solid rgba(0,255,159,0.3);
    background: rgba(0,0,0,0.7);
    z-index: 4;
}

.chat-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 14px;
    flex-wrap: nowrap;
}

    .chat-container input[type=text], #chat-input {
        flex: 1;
        padding: 10px 14px;
        border-radius: 6px;
        border: 1px solid rgba(0,255,159,0.2);
        background: rgba(255,255,255,0.05);
        color: #fff;
        font-size: 15px;
        min-width: 120px;
    }


    .chat-container button,
    .chat-container label {
        background: rgba(0,180,255,0.15);
        border: 1px solid rgba(0,180,255,0.3);
        color: #00ff9f;
        border-radius: 6px;
        padding: 8px 14px;
        cursor: pointer;
        font-size: 14px;
        flex-shrink: 0;
        white-space: nowrap;
    }

    .chat-container input[type=file] {
        display: none;
    }

/* ---------- Chat Message Popup ---------- */
.msg-popup {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(var(--chat-height) + 14px);
    max-height: calc(100vh - var(--chat-height) - 160px);
    overflow: hidden;
    background: rgba(0,0,0,0.85);
    border: 1px solid rgba(0,255,159,0.3);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.8);
    width: 92%;
    max-width: 92%;
    display: none;
    flex-direction: column;
    gap: 0;
    z-index: 5;
}

    .msg-popup.active {
        display: flex;
    }

.msg-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(0,255,159,0.08);
    background: linear-gradient(90deg,rgba(0,255,159,0.03),transparent);
}

    .msg-header h4 {
        margin: 0;
        color: #00ff9f;
        font-size: 15px;
    }

    .msg-header button {
        background: none;
        border: none;
        color: #00b4ff;
        font-size: 18px;
        cursor: pointer;
    }

.msg-body {
    padding: 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scrollbar-width: thin;
    scrollbar-color: #00ff99 #0a0f0a;
}

    .msg-body::-webkit-scrollbar-track {
        background: #0a0f0a;
        border-radius: 4px;
    }

    .msg-body::-webkit-scrollbar-thumb {
        background-color: #00ff99;
        border-radius: 4px;
    }

.chat-message {
    margin: 6px 0;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    max-width: 85%;
}

    .chat-message.user {
        align-self: flex-end;
        background: rgba(0,255,159,0.08);
        border: 1px solid rgba(0,255,159,0.25);
        color: #bfffe6;
    }

    .chat-message.ai {
        align-self: flex-start;
        background: rgba(0,180,255,0.08);
        border: 1px solid rgba(0,180,255,0.25);
        color: #aee3ff;
    }

/* ---------- Responsive Layout ---------- */
@media (max-width: 1024px) {
    .popup-box, .sub-box {
        width: 40%;
        margin: 10px;
    }

    .menu li {
        font-size: 14px;
        padding: 8px;
    }
    .chat-container {
        padding: 10px;
        gap: 8px;
    }

        .chat-container input[type=text], #chat-input {
            font-size: 14px;
        }

        .chat-container button,
        .chat-container label {
            font-size: 13px;
            padding: 7px 12px;
        }
}

@media (max-width: 768px) {
    body {
        font-size: 14px;
    }

    button {
        padding: 10px 16px;
        font-size: 13px;
    }

    .chat-container {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
        padding: 8px 10px;
    }

        .chat-container input[type=text], #chat-input {
            width: 100%;
            font-size: 14px;
            padding: 9px 12px;
        }

        .chat-container button,
        .chat-container label {
            width: calc(50% - 8px);
            text-align: center;
            padding: 8px;
            font-size: 13px;
        }

    .msg-popup {
        width: 95%;
        bottom: calc(var(--chat-height) + 10px);
    }
}

@media (max-width: 480px) {
    ::root {
        --chat-height: 72px;
    }

    .chat-container {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        padding: 8px;
    }

        .chat-container input[type=text], #chat-input {
            width: 100%;
            font-size: 13px;
            padding: 10px 10px;
        }

        .chat-container button,
        .chat-container label {
            width: 100%;
            padding: 10px 0;
            font-size: 13px;
        }

    .msg-popup {
        width: 94%;
        left: 50%;
        transform: translateX(-50%);
    }

    .popup-box, .sub-box {
        width: 95%;
        padding: 16px;
    }

        .popup-box h2 {
            font-size: 18px;
        }

        .sub-box h3 {
            font-size: 16px;
        }
}


:root {
    --bg: #02040a;
    --panel: #071028;
    --accent: #58f0ff;
    --accent-2: #8b5cff;
    --glass: rgba(255,255,255,0.04);
    --glass-2: rgba(255,255,255,0.02);
    --text: #0ff907;
    --muted: #9fb8c8;
    --radius: 18px;
}

/* centered popup container */
.popup-wrap2 {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    padding: 24px;
}

.popup2 {
    width: min(720px, 94vw);
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
    border-radius: var(--radius);
    border: 1px solid rgba(88,240,255,0.07);
    box-shadow: 0 20px 60px rgba(2,4,10,0.6), inset 0 1px 0 rgba(255,255,255,0.02);
    padding: 28px;
    position: relative;
    z-index: 60;
    overflow: hidden;
    display: flex;
    gap: 18px;
    align-items: flex-start;
    backdrop-filter: blur(8px) saturate(1.2);
}

    /* left glowing bar */
    .popup2::before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 6px;
        border-top-left-radius: var(--radius);
        border-bottom-left-radius: var(--radius);
        background: linear-gradient(180deg, var(--accent), var(--accent-2));
        box-shadow: 0 0 18px rgba(88,240,255,0.12);
    }

/* close button */
.close-btn2 {
    position: absolute;
    right: 12px;
    top: 12px;
    background: transparent;
    border: none;
    color: var(--muted);
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    letter-spacing: 1px;
    font-size: 14px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 10px;
    transition: all .18s ease;
    backdrop-filter: blur(6px);
}

    .close-btn2:hover {
        transform: translateY(-2px);
        color: var(--text);
        box-shadow: 0 6px 22px rgba(88,240,255,0.06), 0 0 24px rgba(139,92,255,0.03)
    }

.popup-left2 {
    width: 110px;
    min-width: 90px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    padding-top: 6px
}

.logo-circle2 {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(88,240,255,0.12), rgba(139,92,255,0.08));
    border: 1px solid rgba(255,255,255,0.03);
    box-shadow: 0 8px 30px rgba(88,240,255,0.04)
}

    .logo-circle2 svg {
        width: 44px;
        height: 44px;
        filter: drop-shadow(0 6px 20px rgba(88,240,255,0.06))
    }

.badge {
    font-family: 'Orbitron', sans-serif;
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase
}

.popup-body2 {
    flex: 1;
    min-width: 0
}

.title2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 20px;
    margin: 0 0 8px 0;
    letter-spacing: 0.6px
}

.subtitle2 {
    margin: 0 0 18px 0;
    color: var(--muted);
    font-size: 13px
}

/* typing area */
.typing-box2 {
    background: linear-gradient(180deg, rgba(255,255,255,0.015), rgba(255,255,255,0.01));
    border-radius: 12px;
    padding: 18px;
    font-size: 15px;
    line-height: 1.5;
    min-height: 86px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(88,240,255,0.03)
}

.typed-text2 {
    font-family: 'Roboto Mono', monospace;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--text);
    display: inline-block;
    /* give neon glow */
    text-shadow: 0 1px 0 rgba(255,255,255,0.02), 0 6px 18px rgba(88,240,255,0.06);
}

/* blinking caret */
.caret2 {
    display: inline-block;
    width: 10px;
    height: 22px;
    vertical-align: bottom;
    margin-left: 6px;
    border-radius: 3px;
    background: linear-gradient(180deg, var(--accent), var(--accent-2));
    box-shadow: 0 6px 18px rgba(88,240,255,0.12);
    animation: blink 1s steps(2,end) infinite;
}

@keyframes blink {
    50% {
        opacity: 0.06
    }
}

/* small controls */
.controls2 {
    margin-top: 12px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap
}

.btn2 {
    border: 1px solid rgba(255,255,255,0.04);
    padding: 8px 12px;
    border-radius: 10px;
    background: var(--glass);
    font-family: 'Orbitron', sans-serif;
    font-size: 13px;
    cursor: pointer
}

    .btn2:focus {
        outline: 2px solid rgba(88,240,255,0.12)
    }

/* responsive tweaks */
@media (max-width:520px) {
    .popup2 {
        padding: 18px;
        gap: 12px
    }

    .logo-circle2 {
        width: 60px;
        height: 60px
    }

    .title2 {
        font-size: 18px
    }

    .typing-box2 {
        padding: 14px;
        min-height: 72px
    }

    .close-btn2 {
        right: 8px;
        top: 8px;
        padding: 6px 8px;
        font-size: 12px
    }
}

/* accessibility: reduce motion */
@media (prefers-reduced-motion: reduce) {
    .bg-grid, .popup2::before, .close-btn2, .caret2, .popup2 {
        transition: none;
        animation: none
    }
}