/* --- Global Styles --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #000;
    color: #00ff9c;
    font-family: 'Fira Code', monospace;
    height: 100vh;
    text-shadow: 0 0 8px rgba(0, 255, 156, 0.4);
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    background: repeating-linear-gradient(to bottom,
            rgba(255, 255, 255, 0.03),
            rgba(255, 255, 255, 0.03) 1px,
            transparent 2px,
            transparent 4px);
    pointer-events: none;
}

/* --- Layout --- */
.layout {
    display: flex;
    gap: 30px;
    padding: 40px 60px;
    align-items: center;
    min-height: 100vh;
}

/* --- Terminal Styles --- */
.terminal {
    width: 60%;
    max-width: 900px;
    height: clamp(500px, 80vh, 900px);
    border: 1px solid #00ff9c;
    box-shadow: 0 0 25px #00ff9c;
    display: flex;
    flex-direction: column;
}

.terminal-header {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #111;
    padding: 8px 12px;
    border-bottom: 1px solid #00ff9c;
    flex-shrink: 0;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.red {
    background: #ff5f56;
}

.yellow {
    background: #ffbd2e;
}

.green {
    background: #27c93f;
}

.title {
    margin-left: auto;
    font-size: 13px;
    opacity: 0.8;
}

.output {
    padding: 16px;
    flex: 1;
    overflow-y: auto;             
}

.logo {
    white-space: pre;
    color: #00ffaa;
    font-size: 14px;
    text-shadow: 0 0 12px rgba(0, 255, 170, 0.8);
    margin-bottom: 12px;
}

.output div {
    margin-bottom: 6px;
    line-height: 1.6;
}

.command {
    color: #00eaff;
}

.input-line {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-top: 1px solid #00ff9c;
    flex-shrink: 0;
}

.prompt {
    margin-right: 8px;
}

input {
    background: transparent;
    border: none;
    outline: none;
    color: #00ff9c;
    font-family: inherit;
    font-size: 16px;
    width: 100%;
}

.cursor {
    margin-left: 4px;
    animation: blink 1s infinite;
}

@keyframes blink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0;
    }
}

/* --- Robot Panel --- */
.side-panel {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.robot {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: translateY(-30px);
}

.head {
    width: 180px;
    height: 120px;
    background: #111;
    border: 2px solid #00ff9c;
    border-radius: 20px;
    position: relative;
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.eye {
    width: 28px;
    height: 28px;
    background: #00ff9c;
    border-radius: 50%;
    position: relative;
    transition: transform 0.05s linear;
}

.body {
    width: 130px;
    height: 180px;
    background: #111;
    border: 2px solid #00ff9c;
    border-radius: 14px;
    margin-top: 14px;
}

.robot .head,
.robot .body {
    box-shadow: 0 0 20px rgba(0, 255, 156, 0.35);
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.robot {
    animation: float 4s ease-in-out infinite;
}

/* ===== Robot States ===== */

/* SUCCESS */
.robot.success .head,
.robot.success .body {
    box-shadow: 0 0 30px rgba(0, 255, 156, 0.9);
}

/* ERROR */
.robot.error .eye {
    background: #ff3b3b;
}

.robot.error {
    animation: shake 0.4s;
}

/* THINKING */
.robot.thinking .eye {
    animation: pulse 1s infinite;
}

/* ANIMATIONS */
@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    50% { transform: translateX(6px); }
    75% { transform: translateX(-6px); }
    100% { transform: translateX(0); }
}

@keyframes pulse {
    0% { opacity: 0.4; }
    50% { opacity: 1; }
    100% { opacity: 0.4; }
}

/* --- Hide Scrollbar but Keep Scrolling --- */
.output {
    overflow-y: auto;

    /* Firefox */
    scrollbar-width: none;

    /* Internet Explorer / Edge (legacy) */
    -ms-overflow-style: none;
}

/* Chrome, Safari, Edge */
.output::-webkit-scrollbar {
    display: none;
}

/* Fade effect at top when content overflows */
.output::before {
    content: "";
    position: sticky;
    top: 0;
    display: block;
    height: 12px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent);
    pointer-events: none;
}
