/* /home/css/style.css */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,400;0,700;1,400&display=swap');

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    background: #0f172a url('https://images.unsplash.com/photo-1618005182384-a83a8bd57fbe?q=80&w=1920&auto=format&fit=crop') no-repeat center center fixed;
    background-size: cover;
    color: #0f172a;
    font-family: 'JetBrains Mono', monospace;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

body::before {
    content: "";
    position: absolute;
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: rgba(15, 23, 42, 0.75);
    z-index: 0;
}

.terminal-container {
    width: 92vw;
    max-width: 960px;
    height: 70vh;
    background: rgba(30, 41, 59, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(88, 166, 255, 0.25);
    border-radius: 8px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    z-index: 10;
}

.window-header {
    height: 36px;
    background-color: rgba(22, 30, 46, 0.95);
    border-bottom: 1px solid rgba(48, 54, 61, 0.8);
    display: flex;
    align-items: center;
    padding: 0 14px;
    position: relative;
    user-select: none;
    flex-shrink: 0;
}

.window-dots {
    display: flex;
    gap: 8px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.red { background-color: #ff5f56; }
.dot.yellow { background-color: #ffbd2e; }
.dot.green { background-color: #27c93f; }

.window-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    color: #8b949e;
    letter-spacing: 0.5px;
}

#output {
    flex: 1 1 auto;
    padding: 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: break-word;
    color: #c9d1d9;
}

#output::-webkit-scrollbar {
    width: 6px;
}
#output::-webkit-scrollbar-track {
    background: transparent;
}
#output::-webkit-scrollbar-thumb {
    background: rgba(88, 166, 255, 0.3);
    border-radius: 3px;
}

.input-line {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    background-color: rgba(22, 30, 46, 0.95);
    border-top: 1px solid rgba(48, 54, 61, 0.8);
    flex-shrink: 0;
}

.prompt {
    color: #50fa7b;
    font-weight: bold;
    margin-right: 8px;
    white-space: nowrap;
}

.prompt-echo {
    color: #8b949e;
}

#command-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #f0f6fc;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    outline: none;
    min-width: 0;
}

.ansi-green-bold { color: #50fa7b; font-weight: bold; }
.ansi-cyan-bold { color: #79c0ff; font-weight: bold; }
.ansi-yellow-bold { color: #f2cc60; font-weight: bold; }
.ansi-red-bold { color: #ff7b72; font-weight: bold; }
.ansi-white-bold { color: #ffffff; font-weight: bold; }
.ansi-gray { color: #8b949e; }
.ansi-white { color: #c9d1d9; }
.ansi-green { color: #50fa7b; }

.dino-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(13, 17, 23, 0.9);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.dino-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.dino-modal {
    background: #161b22;
    border: 1px solid rgba(88, 166, 255, 0.3);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
    font-family: 'JetBrains Mono', monospace;
    max-width: 520px;
    width: 90%;
}

.dino-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: #ff7b72;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
}

.dino-target-info {
    color: #50fa7b;
}

.canvas-wrapper {
    background: #0d1117;
    border: 1px solid rgba(48, 54, 61, 0.8);
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    justify-content: center;
}

#dinoCanvas {
    display: block;
    width: 100%;
    max-width: 480px;
    height: 150px;
}

.dino-footer {
    margin-top: 12px;
    font-size: 11px;
    color: #8b949e;
    text-align: center;
    line-height: 1.4;
}

.key-badge {
    background: #21262d;
    border: 1px solid #30363d;
    padding: 2px 6px;
    border-radius: 4px;
    color: #c9d1d9;
    font-weight: bold;
}

.terminal-media-container {
    margin: 15px 0;
    border: 1px solid rgba(88, 166, 255, 0.3);
    border-radius: 6px;
    background: rgba(16, 22, 34, 0.95);
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    white-space: pre-wrap;
    word-break: break-word;
    box-sizing: border-box;
}

.media-window-header {
    background: rgba(22, 30, 46, 0.95);
    padding: 8px 12px;
    font-size: 11px;
    color: #8b949e;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(48, 54, 61, 0.8);
}

.close-media {
    color: #ff7b72;
    cursor: pointer;
    font-weight: bold;
}
.close-media:hover { color: #ffa198; }

.media-body { padding: 12px; }
.media-iframe-wrapper { position: relative; width: 100%; padding-bottom: 56.25%; height: 0; }
.media-iframe-wrapper iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.media-img-wrapper img { width: 100%; height: auto; border-radius: 4px; display: block; }
.media-audio-wrapper audio { width: 100%; outline: none; }

/* Tablet & Standard Mobile (max-width: 768px) */
@media screen and (max-width: 768px) {
    html, body {
        width: 100%;
        height: 100%;
        margin: 0;
        padding: 0;
        overflow: hidden;
        background-color: #0b0c10;
    }

    body {
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .terminal-container {
        position: relative !important;
        width: 100vw !important;
        height: 100vh !important;
        max-width: 100% !important;
        max-height: 100% !important;
        border-radius: 0 !important;
        border: none !important;
        display: flex !important;
        flex-direction: column !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    #output {
        white-space: pre-wrap;
        word-break: break-word;
        overflow-wrap: break-word;
        box-sizing: border-box;
        padding: 12px;
        font-size: 12px;
    }

    .window-header {
        font-size: 11px;
    }

    .input-line {
        padding: 10px 12px;
    }

    .media-iframe-wrapper {
        padding-bottom: 75%;
    }

    .terminal-media-container {
        margin: 10px 0;
        white-space: pre-wrap;
        word-break: break-word;
        box-sizing: border-box;
    }
}

/* Compact Smartphones (iPhone SE, Galaxy Fold outer screen - max-width: 380px) */
@media screen and (max-width: 380px) {
    #output {
        padding: 8px;
        font-size: 11px;
        line-height: 1.4;
    }

    .window-header {
        height: 30px;
        padding: 0 8px;
    }

    .window-title {
        font-size: 10px;
        letter-spacing: 0px;
    }

    .dot {
        width: 9px;
        height: 9px;
    }

    .window-dots {
        gap: 5px;
    }

    .input-line {
        padding: 8px 10px;
    }

    .prompt {
        font-size: 11px;
        margin-right: 5px;
    }

    #command-input {
        font-size: 11px;
    }

    .dino-modal {
        padding: 12px;
        width: 95%;
    }

    #dinoCanvas {
        height: 120px;
    }
}

/* Ultra-Compact / Foldable Devices Inner/Outer Cover (max-width: 320px) */
@media screen and (max-width: 320px) {
    #output {
        padding: 6px;
        font-size: 10px;
    }

    .window-header {
        height: 26px;
        padding: 0 6px;
    }

    .window-title {
        display: none; /* Sembunyikan judul window jika layar terlalu sempit agar tidak nabrak titik window control */
    }

    .input-line {
        padding: 6px 8px;
    }

    .prompt {
        font-size: 10px;
    }

    #command-input {
        font-size: 10px;
    }
}