/* Internal terminals should now take up all space inside the workspace */
#terminals {
    flex: 1;
    display: flex;
    position: relative;
    flex-direction: column;
    width: 100%;
    overflow: hidden !important;
    background: #fff;
}

/* Force the xterm-viewport (the actual scrollable area) to stay inside */
.xterm-viewport {
    border-radius: 0 0 12px 0;
    overflow-y: auto !important;
}

#guestTerminal {
    flex: 0 0 80%;
    width: 100%;
    min-height: 0;
    position: relative;
    overflow: hidden;
    background-color: #1e1e1e;
}

/* This is the div where xterm is injected */
#guestTerminal > div {
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    display: flex;
}

#guestTerminal .xterm {
    width: 100%;
    height: 100%;
    flex: 1;
}

.terminal.xterm {
    height: 100%;
    padding: 10px;
}

.xterm-screen {
    height: 100% !important;
}

#guestTerminalContainer {
    width: 100%;
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background-color: #1e1e1e;
}

/* Header Container */
#guestTerminalContainer .panel-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    height: 40px !important;
    padding: 0 10px !important;
    box-sizing: border-box !important;
    flex: 0 0 40px;
    background-color: var(--primary-color, #1e293b);
}

/* Controls Wrapper */
#terminalControls {
    display: flex !important;
    align-items: center !important;
    align-self: center !important;
    height: 26px !important;
    margin-left: 10px;
}

#guestTerminalTabs {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 6px;
    height: 26px !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* --- Guest Terminal Tab Buttons --- */
#guestTerminalTabs button {
    height: 26px !important;
    min-height: 26px !important;
    max-height: 26px !important;
    padding: 0 12px !important;
    margin: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    vertical-align: middle !important;
    box-sizing: border-box !important;
    background: rgba(255, 255, 255, 0.15) !important;
    color: rgba(255, 255, 255, 0.8) !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    border-radius: 4px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

#guestTerminalTabs button:hover {
    background: rgba(255, 255, 255, 0.28) !important;
    color: #ffffff !important;
}

/* Active Tab: High-contrast solid white pill with accent underline */
#guestTerminalTabs button.active-tab-style,
#guestTerminalTabs button.active {
    background: #ffffff !important;
    color: #0f172a !important; /* High contrast dark text */
    font-weight: 700 !important;
    border: 1px solid #ffffff !important;
    border-bottom: 3px solid var(--tertiary-color, #38bdf8) !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;
}

/* --- Panel Header Action Buttons --- */
.panel-header-actions {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    height: 26px !important;
}

.panel-header .terminal-action-btn {
    height: 26px !important;
    min-height: 26px !important;
    max-height: 26px !important;
    padding: 0 8px !important;
    box-sizing: border-box !important;
    background: rgba(255, 255, 255, 0.12) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    border-radius: 4px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    cursor: pointer;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    line-height: 1 !important;
    transition: all 0.15s ease-in-out;
}

.panel-header .terminal-action-btn:hover {
    filter: brightness(1.2);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25) !important;
}

.panel-header .terminal-action-btn:active {
    transform: translateY(1px);
}

.panel-header .terminal-action-btn i {
    font-size: 12px !important;
    line-height: 1 !important;
}

/* --- Specific Color Accents for Zoom Controls --- */

/* Zoom Out (Amber / Orange) */
.panel-header .btn-zoom-out {
    background: rgba(245, 158, 11, 0.25) !important;
    border-color: rgba(245, 158, 11, 0.5) !important;
    color: #fbbf24 !important;
}
.panel-header .btn-zoom-out:hover {
    background: rgba(245, 158, 11, 0.4) !important;
    color: #ffffff !important;
}

/* Zoom In (Emerald Green) */
.panel-header .btn-zoom-in {
    background: rgba(16, 185, 129, 0.25) !important;
    border-color: rgba(16, 185, 129, 0.5) !important;
    color: #34d399 !important;
}
.panel-header .btn-zoom-in:hover {
    background: rgba(16, 185, 129, 0.4) !important;
    color: #ffffff !important;
}

/* Reset Zoom (Cyan / Slate) */
.panel-header .btn-zoom-reset {
    background: rgba(14, 165, 233, 0.22) !important;
    border-color: rgba(14, 165, 233, 0.45) !important;
    color: #38bdf8 !important;
}
.panel-header .btn-zoom-reset:hover {
    background: rgba(14, 165, 233, 0.38) !important;
    color: #ffffff !important;
}
