﻿/* —— Terminal demo modal —— */
.terminal-demo-modal {
    position: fixed;
    inset: 0;
    z-index: 10050;
    background: rgba(4, 10, 22, 0.92);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s;
}

.terminal-demo-modal.active {
    opacity: 1;
    visibility: visible;
}

.terminal-demo-shell {
    width: min(1100px, 100%);
    max-height: min(92vh, 820px);
    display: grid;
    grid-template-columns: 1fr min(340px, 42%);
    gap: 1.5rem;
    align-items: center;
}

@media (max-width: 860px) {
    .terminal-demo-shell {
        grid-template-columns: 1fr;
        max-height: 95vh;
        overflow-y: auto;
    }
}

.terminal-demo-info {
    padding: 0.5rem 1rem;
}

.terminal-demo-info h2 {
    font-size: clamp(1.4rem, 3vw, 1.85rem);
    margin-bottom: 0.75rem;
    background: linear-gradient(90deg, #fff, #6bd4ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.terminal-demo-steps {
    list-style: none;
    padding: 0;
    margin: 1rem 0 1.25rem;
}

.terminal-demo-steps li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.75);
    opacity: 0.45;
    transition: opacity 0.35s ease, color 0.35s ease;
}

.terminal-demo-steps li.on {
    opacity: 1;
    color: #fff;
}

.terminal-demo-steps li .step-n {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 8px;
    background: rgba(107, 212, 255, 0.15);
    border: 1px solid rgba(107, 212, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: #6bd4ff;
}

.terminal-demo-steps li.on .step-n {
    background: linear-gradient(135deg, #6bd4ff, #6b8bff);
    color: #0a1628;
    border-color: transparent;
}

.terminal-demo-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 2;
    transition: background 0.2s;
}

.terminal-demo-close:hover { background: rgba(255, 255, 255, 0.12); }

/* Tablet frame */
.terminal-device {
    position: relative;
    margin: 0 auto;
    width: min(320px, 100%);
    padding: 14px 10px 18px;
    border-radius: 28px;
    background: linear-gradient(160deg, #2a3f5f, #1a2840);
    border: 3px solid #3d5a80;
    box-shadow:
        0 40px 80px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(107, 212, 255, 0.2),
        inset 0 0 30px rgba(107, 212, 255, 0.05);
    transform: perspective(800px) rotateY(-4deg) rotateX(2deg);
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.terminal-demo-modal.active .terminal-device {
    animation: tabletFloat 4s ease-in-out infinite;
}

@keyframes tabletFloat {
    0%, 100% { transform: perspective(800px) rotateY(-4deg) rotateX(2deg) translateY(0); }
    50% { transform: perspective(800px) rotateY(-2deg) rotateX(1deg) translateY(-6px); }
}

.terminal-device-notch {
    width: 80px;
    height: 6px;
    background: #0d1a30;
    border-radius: 0 0 8px 8px;
    margin: 0 auto 8px;
}

.terminal-screen {
    background: #0d1a30;
    border-radius: 14px;
    min-height: 420px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(107, 212, 255, 0.15);
}

.terminal-screen-view {
    position: absolute;
    inset: 0;
    padding: 12px;
    opacity: 0;
    visibility: hidden;
    transform: translateX(12px);
    transition: opacity 0.4s ease, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.4s;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.terminal-screen-view.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.t-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 10px;
}

.t-status .online {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #4fd1a0;
}

.t-status .online::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4fd1a0;
    box-shadow: 0 0 8px #4fd1a0;
    animation: blink 1.5s ease infinite;
}

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

.t-login h4 { font-size: 1rem; color: #fff; margin: 2rem 0 0.5rem; text-align: center; }
.t-login input {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 8px;
    border-radius: 10px;
    border: 1px solid rgba(107, 212, 255, 0.25);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 0.85rem;
}

.t-btn {
    width: 100%;
    padding: 11px;
    margin-top: 8px;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    background: linear-gradient(90deg, #6b8bff, #6bd4ff);
    color: #0a1628;
    transition: transform 0.15s, box-shadow 0.2s;
}

.t-btn:active { transform: scale(0.97); }

.t-tables {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    flex: 1;
}

.t-table {
    aspect-ratio: 1;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.25s ease;
}

.t-table.free { background: rgba(79, 209, 160, 0.15); color: #4fd1a0; }
.t-table.busy { background: rgba(255, 122, 107, 0.15); color: #ff7a6b; opacity: 0.7; }
.t-table.selected {
    border-color: #6bd4ff;
    box-shadow: 0 0 20px rgba(107, 212, 255, 0.4);
    transform: scale(1.05);
}

.t-table small { font-size: 0.55rem; font-weight: 500; margin-top: 2px; }

.t-chips {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 8px;
}

.t-chip {
    flex-shrink: 0;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
    background: rgba(107, 212, 255, 0.12);
    border: 1px solid rgba(107, 212, 255, 0.25);
    color: #a9e6ff;
    cursor: pointer;
}

.t-chip.on {
    background: linear-gradient(90deg, #6b8bff, #6bd4ff);
    color: #0a1628;
    border-color: transparent;
}

.t-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    margin-bottom: 6px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.t-menu-item:hover {
    background: rgba(107, 212, 255, 0.1);
    border-color: rgba(107, 212, 255, 0.25);
}

.t-menu-item.in-cart {
    border-color: rgba(107, 212, 255, 0.5);
    background: rgba(107, 212, 255, 0.08);
}

.t-menu-item strong { font-size: 0.82rem; color: #fff; display: block; }
.t-menu-item span { font-size: 0.72rem; color: #6bd4ff; }

.t-badge-ok {
    font-size: 0.58rem;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(79, 209, 160, 0.2);
    color: #4fd1a0;
    border: 1px solid rgba(79, 209, 160, 0.4);
    flex-shrink: 0;
}

.t-badge-no {
    font-size: 0.58rem;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(255, 122, 107, 0.14);
    color: #ff7a6b;
    border: 1px solid rgba(255, 122, 107, 0.4);
    flex-shrink: 0;
}

.t-menu-item--out {
    opacity: 0.72;
    cursor: not-allowed;
    background: rgba(255, 122, 107, 0.06);
    border-color: rgba(255, 122, 107, 0.2);
}

.t-menu-item--out strong {
    color: #8b95a5;
}

.t-menu-item--out span {
    color: #6b7280 !important;
}

.t-btn-cart {
    margin-top: auto;
    flex-shrink: 0;
}

.t-cart-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.9);
}

.t-chip-ing {
    display: inline-block;
    font-size: 0.6rem;
    padding: 2px 6px;
    margin: 2px 2px 0 0;
    border-radius: 4px;
    background: rgba(79, 209, 160, 0.15);
    color: #4fd1a0;
}

.t-chip-ing.off {
    background: rgba(255, 122, 107, 0.15);
    color: #ff7a6b;
    text-decoration: line-through;
}

.t-send-success {
    text-align: center;
    padding: 1.25rem 0.5rem 0.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.t-sent-meta {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.55);
    margin: 0.35rem 0 0.65rem;
}

.t-sent-hint {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 0.65rem;
    line-height: 1.4;
}

.t-sent-summary {
    text-align: left;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(107, 212, 255, 0.22);
    border-radius: 10px;
    padding: 10px 12px;
    margin: 0 2px;
    max-height: 140px;
    overflow-y: auto;
}

.t-sent-summary .t-sent-line {
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.78rem;
    color: #fff;
}

.t-sent-summary .t-sent-line:last-child {
    border-bottom: none;
}

.t-sent-summary .t-sent-line strong {
    display: block;
    font-size: 0.82rem;
}

.t-sent-summary .t-sent-line .mods {
    font-size: 0.65rem;
    color: #ff9a8c;
    margin-top: 2px;
}

.t-sent-summary .t-sent-total {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(107, 212, 255, 0.2);
    font-weight: 700;
    color: #6bd4ff;
    font-size: 0.85rem;
    text-align: right;
}

.t-send-success .pulse-ring {
    width: 72px;
    height: 72px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    border: 3px solid #4fd1a0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #4fd1a0;
    animation: ringPop 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes ringPop {
    from { transform: scale(0.3); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.t-fly-letter {
    position: absolute;
    width: 36px;
    height: 28px;
    left: 50%;
    top: 40%;
    margin-left: -18px;
    z-index: 20;
    pointer-events: none;
    opacity: 0;
}

.t-fly-letter.go {
    animation: letterFlyOut 1.2s cubic-bezier(0.45, 0, 0.55, 1) forwards;
}

@keyframes letterFlyOut {
    0% { opacity: 1; transform: translate(0, 0) rotate(0); }
    100% { opacity: 0; transform: translate(-120px, -80px) rotate(-25deg) scale(0.5); }
}

.terminal-demo-nav {
    display: flex;
    gap: 8px;
    margin-top: 1rem;
}

.terminal-demo-nav button {
    flex: 1;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}

.terminal-demo-nav button.primary {
    background: linear-gradient(90deg, #6b8bff, #6bd4ff);
    color: #0a1628;
    border: none;
}

/* Virtual demo: Terminal nav item highlight */
#navbarDemo .nav-link.nav-terminal {
    background: rgba(107, 139, 255, 0.2);
    border-radius: 8px;
    border: 1px solid rgba(107, 139, 255, 0.35);
}
