/* ---------- terminal tabs ---------- */
.terminal-tabs {
    display: flex;
    flex-direction: column;
    margin-top: auto;
}

/* tab bar */
.terminal-tabs-nav {
    display: flex;
    gap: .1rem;
    margin-left: .3em;
}

.tab-btn {
    background: #1e1e1e;
    color: #d1d5db;
    font-family: monospace;
    padding: .4rem .8rem;
    border: none;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    opacity: .6;
    transition: opacity .15s ease;
    min-width: 128px;
}

.tab-btn.active,
.tab-btn:hover {
    opacity: 1;
}

.tab-btn.active {
    border-bottom: 2px solid #22c55e;
}

/* panels reuse your existing `.terminal` look */
.terminal-tabs-content .terminal {
    display: none;
}

.terminal-tabs-content .terminal.active {
    display: flex;
}

.terminal-tabs-content .install-terminal {
    display: none;
}

.terminal-tabs-content .install-terminal.active {
    display: flex;
}






















/* ─── Terminal typewriter animation ───────────────────────── */
.terminal {
    background: #1e1e1e;
    color: #d1d5db;
    font-family: monospace;
    font-size: 0.9rem;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    display: flex;
    align-content: center;
    align-items: center;
    margin-bottom: 0.75rem;
    margin-top: auto;
}

.terminal::before {
    content: "$ ";
    margin-right: .5rem;
    color: #22c55e;
}




.terminal-large {
    background: #1e1e1e;
    color: #eee;
    font-family: monospace;
    font-size: 0.9rem;
    padding: 1rem 1.25rem;
    border-radius: 6px;
    line-height: 1.4;
    overflow-y: auto;
    min-width: 800px;
    min-height: 600px;
}

.terminal-small {
    background: #1e1e1e;
    color: #eee;
    font-family: monospace;
    font-size: 0.9rem;
    padding: 1rem 1.25rem;
    border-radius: 6px;
    line-height: 1.4;
    overflow-y: auto;
    width: 100%;
    height: 250px
}


.term-line {
    display: flex;
}

.term-prompt {
    flex-shrink: 0;
    margin-right: 0.5ch;

    color: #22c55e;
    /* ← make the prompt green */
}

.term-text {
    white-space: pre-wrap;
    word-break: break-all;
}

.cursor {
    display: inline-block;
    width: 0.6ch;
    background: #eee;
    margin-left: 1px;
    animation: blink 1s step-end infinite;
}

.loader-percentage {
    margin-left: 5px;
}

@keyframes blink {

    from,
    to {
        background: transparent;
    }

    50% {
        background: #eee;
    }
}

















/* install terminal and copy */



.install-terminal {
    background: #1e1e1e;
    color: #eee;
    font-family: monospace;
    font-size: 0.9rem;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    display: flex;
    align-content: center;
    align-items: center;
    margin-bottom: 0.75rem;
    margin-top: auto;
}

.install-terminal::before {
    content: "$ ";
    margin-right: .5rem;
    color: #22c55e;
}



.copy {
    /* button */
    --button-bg: #353434;
    --button-hover-bg: #464646;
    --button-text-color: #CCCCCC;
    --button-hover-text-color: #8bb9fe;
    --button-border-radius: 10px;
    --button-diameter: 36px;
    --button-outline-width: 1px;
    --button-outline-color: rgb(141, 141, 141);
    /* tooltip */
    --tooltip-bg: #f4f3f3;
    --toolptip-border-radius: 4px;
    --tooltip-font-family: Menlo, Roboto Mono, monospace;
    /* 👆 this field should not be empty */
    --tooltip-font-size: 12px;
    /* 👆 this field should not be empty */
    --tootip-text-color: rgb(50, 50, 50);
    --tooltip-padding-x: 7px;
    --tooltip-padding-y: 7px;
    --tooltip-offset: 8px;
    /* --tooltip-transition-duration: 0.3s; */
    /* 👆 if you need a transition, 
  just remove the comment,
  but I didn't like the transition :| */
    margin-left: auto;
}

.copy {
    box-sizing: border-box;
    width: var(--button-diameter);
    height: var(--button-diameter);
    border-radius: var(--button-border-radius);
    background-color: var(--button-bg);
    color: var(--button-text-color);
    border: none;
    cursor: pointer;
    position: relative;
    outline: none;
}


.copy svg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.checkmark {
    display: none;
}

/* actions */



.copy:focus:not(:focus-visible) .clipboard {
    display: none;
}

.copy:focus:not(:focus-visible) .checkmark {
    display: block;
}

.copy:hover,
.copy:focus {
    background-color: var(--button-hover-bg);
}

.copy:active {
    outline: var(--button-outline-width) solid var(--button-outline-color);
}

.copy:hover svg {
    color: var(--button-hover-text-color);
}

/* code  editor */


.editor-window {
    border: 1px solid #888;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    /* adjust as needed */
}

/* The title-bar */
.editor-window-header {
    display: flex;
    align-items: center;
    background: #f5f5f5;
    padding: 4px 8px;
    height: 32px;
    user-select: none;
}

/* The three “traffic-light” buttons */
.editor-btn {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

.editor-btn.close {
    background: #ff5f56;
}

.editor-btn.minimize {
    background: #ffbd2e;
}

.editor-btn.maximize {
    background: #27c93f;
}

/* Title text (centered) */
.editor-title {
    flex: 1;
    text-align: center;
    font-family: "Space Mono", monospace;
    font-size: 0.9rem;
    color: #333;
}


.editor {
    background: #fff;
    /* light grey background */
    color: #333;
    /* dark text for contrast */
    font-family: monospace;
    font-size: 0.9rem;
    padding: 1rem 1.25rem;

    border-top: solid 1px #888;

    line-height: 1.4;
    overflow-y: auto;
    counter-reset: line-number;
    width: 100%;
    height: 250px
}

.editor .term-line {
    display: flex;
    counter-increment: line-number;
    /* bump counter on each line */
}

.editor .term-line::before {
    content: counter(line-number);
    /* display the line number */
    flex-shrink: 0;
    width: 2ch;
    /* reserve space for up to 2 digits */
    margin-right: 0.5ch;
    text-align: right;
    color: #888;
    /* muted number color */
}

/* reuse your existing prompt/text styling */
.editor .term-prompt {
    flex-shrink: 0;
    margin-right: 0.5ch;
    color: #22c55e;
    /* keep the green prompt */
}

.editor .term-text {
    white-space: pre-wrap;
    word-break: break-all;
}





/* ─── Responsive overrides ──────────────────────────────────────────── */
/* 1.  “Tablet” and down  ( ≤ 768 px ) */
@media (max-width: 768px) {

    /* — Terminal tabs — */
    .terminal-tabs-nav {
        flex-wrap: wrap;
        /* allow wrapping */
        gap: .3rem;
        margin-left: 0;
    }

    .tab-btn {
        flex: 1 1 auto;
        /* let buttons share the row */
        min-width: 0;
        /* remove hard floor */
        font-size: 0.8rem;
        padding: .35rem .6rem;
    }

    /* — Terminals — */
    .terminal,
    .terminal-large,
    .terminal-small {
        font-size: 0.85rem;
        padding: .85rem 1rem;
    }

    /* the “big” demo window should shrink instead of overflowing */
    .terminal-large {
        min-width: 100%;
        min-height: 420px;
    }

    /* — Code editor — */
    .editor,
    .editor-window {
        font-size: 0.85rem;
    }

    /* give the editor a little more vertical room on tablets */
    .editor,
    .terminal-small {
        height: 220px;
    }

    .image-container {
        width: 95%;
    }

}

/* 2.  “Phone” and down  ( ≤ 480 px ) */
@media (max-width: 480px) {

    /* stack tab buttons in a scrollable row if they no longer fit */
    .terminal-tabs-nav {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        /* Firefox */
    }

    .terminal-tabs-nav::-webkit-scrollbar {
        display: none;
    }

    /* Chrome/Safari */

    .tab-btn {
        font-size: 0.75rem;
        padding: .3rem .55rem;
    }

    /* slightly tighter body copy */
    .terminal,
    .terminal-large,
    .terminal-small,
    .editor {
        font-size: 0.8rem;
    }

    /* shrink fixed-height panes */
    .terminal-small,
    .editor {
        height: 190px;
    }
}

/* 3.  “Tiny” screens  ( ≤ 360 px )  — last-resort tweaks                */
@media (max-width: 360px) {
    .tab-btn {
        padding: .25rem .45rem;
    }

    .terminal,
    .editor {
        padding: .7rem .9rem;
    }

    .terminal-small,
    .editor {
        height: 170px;
    }
}