/* ============================== 
    global variables and reset
=============================== */
:root {
    --color-background: #0d1117;
    --color-background-terminal: #161b22;
    --color-background-title-bar: #21262d;
    --color-white: #c9d1d9;
    --color-gray: #8b949e;
    --color-red: #ff7b72;
    --color-orange: #f69d50;
    --color-yellow: #ffbd2e;
    --color-green: #7ee787;
    --color-blue: #79c0ff;
    --color-cyan: #43e8cc;
    --color-border: #30363d;
    --border-solid: 1px solid var(--color-border);
    --font-weight-bold: 500;
}

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

body {
    font-family: 'Menlo', 'Monaco', 'Consolas', 'Courier New', monospace;
    background-color: var(--color-background);
    color: var(--color-white);
    padding: 20px;
    min-height: calc(var(--vh, 1vh) * 100);
    /* min-height: 100vh; */
    overflow-x: hidden;
    line-height: 1.4;
    font-weight: var(--font-weight-bold);
}

/* ============================== 
    terminal shell container
=============================== */
.terminal {
    max-width: 800px;
    margin: 0 auto;
    border: var(--border-solid);
    border-radius: 6px;
    background: linear-gradient(145deg, var(--color-background-terminal), var(--color-background));
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.title-bar {
    display: flex;
    align-items: center;
    padding: 0 12px;
    height: 28px;
    gap: 12px;
    background: linear-gradient(90deg, var(--color-background-title-bar) 0%, var(--color-border) 50%, var(--color-background-title-bar) 100%);
    border-bottom: var(--border-solid);
    cursor: default;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -khtml-user-select: none;
    -ms-user-select: none;
    -webkit-touch-callout: none;
}

.window-buttons {
    display: flex;
    gap: 8px;
}

.button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: default;
    transition: transform 0.15s ease, filter 0.15s ease;
}

.button:hover {
    filter: brightness(1.3);
    transform: scale(1.05);
}

.button.close {
    background: var(--color-red);
}

.button.minimize {
    background: var(--color-yellow);
}

.button.maximize {
    background: var(--color-green);
}

.title-text {
    flex: 1;
    text-align: center;
    color: var(--color-gray);
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.terminal-content {
    padding: 40px;
}

/* ============================== 
    maximized states
=============================== */
.terminal.is-minimized {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 280px;
    height: 48px;
    margin: 0;
    max-width: none;
    z-index: 999;
}

.terminal.is-minimized .title-bar {
    height: 48px;
    border-radius: 6px;
    border-bottom: none;
    justify-content: flex-start;
    padding: 0 12px;
    gap: 16px;
}

.terminal.is-minimized .title-text {
    font-size: 12px;
    max-width: 160px;
}

.terminal.is-minimized .terminal-content {
    display: none;
}

.terminal.maximized {
    position: fixed;
    inset: 10px;
    max-width: none;
    z-index: 10;
}

.terminal.closed {
    animation: fadeOut 0.25s ease forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: scale(0.98);
    }
}

/* ============================== 
    terminal prompt style
=============================== */
.p10k-prompt {
    display: flex;
    align-items: flex-end;
    margin-bottom: 8px;
    min-height: 24px;
}

.p10k-user {
    color: var(--color-red);
}

.p10k-at {
    color: var(--color-gray);
    margin: 0 2px;
}

.p10k-host {
    color: var(--color-orange);
}

.p10k-prompt-segment {
    color: var(--color-white);
    margin: 0 2px;
}

.p10k-command {
    color: var(--color-white);
}

.p10k-time {
    color: var(--color-blue);
    margin-right: 4px;
}

.p10k-time-last {
    cursor: none;
    white-space: nowrap;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -khtml-user-select: none;
    -ms-user-select: none;
    -webkit-touch-callout: none;
}

.p10k-separator {
    flex: 1;
    height: 1px;
    margin: 0 8px;
    background: linear-gradient(90deg, transparent, var(--color-border), transparent);
    align-self: center;
}

.p10k-blink {
    color: var(--color-white);
    animation: blink 1s infinite;
    margin-left: 2px;
}

@keyframes blink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0;
    }
}

/* ============================== 
    output style
=============================== */
.output {
    margin-bottom: 24px;
    animation: type 0.6s ease-out;
    color: var(--color-white);
}

@keyframes type {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================== 
    ascii art style
=============================== */
.ascii-art {
    font-family: monospace;
    white-space: pre;
    font-size: 1px !important;
    line-height: 1;
}

/* ============================== 
    yaml style
=============================== */
.yaml-start {
    color: var(--color-white);
}

.yaml-key {
    color: var(--color-blue);
}

.yaml-value {
    color: var(--color-green);
}

/* ============================== 
    Links and icons
=============================== */
.link {
    color: var(--color-white);
    text-decoration: none;
    transition: text-shadow 0.3s;
}

.syamlink {
    color: var(--color-cyan);
}

.link:hover {
    text-shadow: 0 0 8px rgba(67, 232, 204, 0.5);
}

/* ============================== 
    Flex layout for info blocks
=============================== */
.flexbox-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-start;
}

.flexbox-item {
    flex: 0 1 auto;
}

/* ============================== 
    Responsive layout
=============================== */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .terminal {
        margin: 0 auto;
    }

    .title-bar {
        height: 25px;
        padding: 0 10px;
        gap: 10px;
    }

    .terminal-content {
        padding: 25px 20px;
    }

    .p10k-time,
    .p10k-separator {
        display: none !important;
    }

    .terminal.is-minimized {
        width: 240px;
    }

    .terminal.is-minimized .title-text {
        max-width: 140px;
    }
}
