:root {
    /* Catppuccin Mocha Palette */
    --bg-base: #1e1e2e;
    --bg-mantle: #181825;
    --bg-crust: #11111b;
    --text: #cdd6f4;
    --subtext: #a6adc8;
    --overlay: #585b70;
    --surface: #313244;
    --border: #45475a;
    
    --green: #a6e3a1;
    --red: #f38ba8;
    --peach: #fab387;
    --blue: #89b4fa;
    --lavender: #b4befe;
    --yellow: #f9e2af;
    --mauve: #cba6f7;
    
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

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

body {
    background-color: var(--bg-crust);
    color: var(--text);
    font-family: var(--font-mono);
    line-height: 1.5;
    padding: 2rem 1rem;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Terminal Window container */
.terminal-window {
    width: 100%;
    max-width: 1350px;
    background-color: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Title Bar */
.title-bar {
    background-color: var(--bg-mantle);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--surface);
    font-size: 0.85rem;
    user-select: none;
}

.window-controls {
    display: flex;
    gap: 0.5rem;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.dot-red { background-color: var(--red); }
.dot-yellow { background-color: var(--yellow); }
.dot-green { background-color: var(--green); }

.window-title {
    color: var(--subtext);
    font-weight: 500;
}

.window-meta {
    color: var(--overlay);
}

/* Tmux/TUI Grid Layout */
.tui-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 700px; /* Increased from 640px */
    border-bottom: 1px solid var(--surface);
}

@media (max-width: 820px) {
    .tui-layout {
        grid-template-columns: 1fr;
    }
}

/* Left Panel - Navigation / Hook List */
.tui-sidebar {
    background-color: var(--bg-mantle);
    border-right: 1px solid var(--surface);
    display: flex;
    flex-direction: column;
    padding: 1rem 0;
    overflow-y: auto;
}

@media (max-width: 820px) {
    .tui-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--surface);
        max-height: 250px;
    }
}

.sidebar-header {
    padding: 0.5rem 1.25rem;
    font-size: 0.75rem;
    color: var(--overlay);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}

.hook-item {
    padding: 0.6rem 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
    color: var(--subtext);
}

.hook-item:hover {
    background-color: var(--surface);
    color: var(--text);
}

.hook-item.active {
    background-color: rgba(180, 190, 254, 0.08);
    border-left-color: var(--lavender);
    color: var(--lavender);
    font-weight: bold;
}

.hook-item .icon {
    font-size: 1rem;
}

.hook-item .badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--green);
}
.hook-item.post-use .badge-dot {
    background-color: var(--peach);
}

/* Main Workspace Panel */
.tui-workspace {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow-y: auto;
}

/* Banner section */
.banner {
    border: 1px dashed var(--overlay);
    padding: 1rem;
    border-radius: 4px;
    background-color: rgba(137, 180, 250, 0.03);
}

.banner-title {
    color: var(--blue);
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.banner-text {
    color: var(--subtext);
    font-size: 0.85rem;
}

/* Two pane division inside workspace */
.workspace-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    flex-grow: 1;
}

@media (max-width: 650px) {
    .workspace-grid {
        grid-template-columns: 1fr;
    }
}

/* Install Block */
.install-section {
    grid-column: 1 / -1;
    background-color: var(--bg-mantle);
    border: 1px solid var(--surface);
    border-radius: 6px;
    padding: 1rem;
}

.install-title {
    font-size: 0.8rem;
    color: var(--peach);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.install-cmd-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--bg-crust);
    border: 1px solid var(--surface);
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    gap: 1rem;
}

.install-cmd {
    color: var(--green);
    font-size: 0.85rem;
    word-break: break-all;
}

.btn-action {
    background-color: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 0.35rem 0.75rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.1s ease;
    white-space: nowrap;
}

.btn-action:hover {
    background-color: var(--border);
    border-color: var(--overlay);
}

.btn-action:active {
    transform: scale(0.98);
}

/* Hook details description panel */
.details-panel {
    border: 1px solid var(--surface);
    border-radius: 6px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background-color: rgba(17, 17, 27, 0.3);
    height: 360px; /* Increased from 300px to prevent layout shift */
    overflow-y: auto;
}

.details-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px dashed var(--surface);
    padding-bottom: 0.75rem;
}

.details-title {
    color: var(--lavender);
    font-size: 1.1rem;
    font-weight: 700;
}

.details-type-badge {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    text-transform: uppercase;
    font-weight: 700;
    background-color: rgba(166, 227, 161, 0.1);
    color: var(--green);
    border: 1px solid rgba(166, 227, 161, 0.2);
}

.details-type-badge.post {
    background-color: rgba(250, 179, 135, 0.1);
    color: var(--peach);
    border: 1px solid rgba(250, 179, 135, 0.2);
}

.details-desc {
    font-size: 0.85rem;
    color: var(--subtext);
    line-height: 1.6;
}

.details-meta-list {
    margin-top: auto;
    font-size: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    color: var(--overlay);
    border-top: 1px solid var(--surface);
    padding-top: 0.75rem;
}

.details-meta-item span {
    color: var(--text);
}

/* Simulator Console Screen */
.simulator-panel {
    background-color: var(--bg-crust);
    border: 1px solid var(--surface);
    border-radius: 6px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    font-size: 0.8rem;
    height: 360px; /* Increased from 300px to match details panel */
    position: relative;
}

.simulator-header {
    display: flex;
    justify-content: space-between;
    color: var(--overlay);
    font-size: 0.7rem;
    text-transform: uppercase;
    border-bottom: 1px solid var(--surface);
    padding-bottom: 0.5rem;
    margin-bottom: 0.75rem;
}

.simulator-output {
    flex-grow: 1;
    overflow-y: auto;
    white-space: pre-wrap;
    font-family: var(--font-mono);
    line-height: 1.4;
    height: calc(100% - 30px);
}

/* Terminal Prompt animation */
.term-prompt {
    color: var(--mauve);
}

.term-cmd {
    color: var(--text);
}

.cursor {
    display: inline-block;
    width: 8px;
    height: 15px;
    background-color: var(--text);
    animation: blink 1s step-start infinite;
    vertical-align: middle;
    margin-left: 2px;
}

@keyframes blink {
    50% { opacity: 0; }
}

/* TMUX Bottom Status Bar */
.tmux-status {
    background-color: var(--bg-crust);
    padding: 0.35rem 1rem;
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--overlay);
    user-select: none;
}

.tmux-left {
    display: flex;
    gap: 1rem;
}

.tmux-session {
    color: var(--green);
    font-weight: 700;
}

.tmux-window-active {
    color: var(--text);
    background-color: var(--surface);
    padding: 0 0.4rem;
    border-radius: 2px;
}

.tmux-right {
    display: flex;
    gap: 1rem;
}

.tmux-time {
    color: var(--peach);
}

/* Highlight classes for simulated console output */
.ansi-red { color: var(--red); }
.ansi-green { color: var(--green); }
.ansi-yellow { color: var(--yellow); }
.ansi-blue { color: var(--blue); }
.ansi-cyan { color: var(--lavender); }
.ansi-dim { color: var(--overlay); }

/* Styled Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--surface);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border);
}

