/* Layer chứa các terminal trôi nổi */
#floating-terminals-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    z-index: 10000;
}

/* Style cho từng cửa sổ terminal */
.floating-terminal {
    position: absolute;
    width: 600px;
    height: 400px;
    background: #1e1e1e;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border: 1px solid #333;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    resize: both;
    min-width: 300px;
    min-height: 200px;
    transition: height 0.2s ease, width 0.2s ease;
}

/* Header */
.terminal-header {
    background: #252526;
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: grab;
    border-bottom: 1px solid #333;
    user-select: none;
    height: 36px;
    flex-shrink: 0;
}

.terminal-header:active { cursor: grabbing; }

.terminal-title-group {
    display: flex; align-items: center; gap: 8px;
    color: #ccc; font-family: monospace; font-size: 12px; font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.terminal-controls { display: flex; gap: 6px; }

.term-btn {
    width: 12px; height: 12px; border-radius: 50%; border: none;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    padding: 0; font-size: 8px; color: rgba(0,0,0,0.5);
}
.term-btn:hover { color: rgba(0,0,0,0.8); }
.term-btn.close { background: #FF5F56; }
.term-btn.minimize { background: #FFBD2E; }
.term-btn.maximize { background: #27C93F; }

/* Body Xterm */
.terminal-body {
    flex: 1;
    position: relative;
    padding: 5px 5px 0 5px; /* Bottom padding 0 để dính với input */
    background: #1e1e1e;
    overflow: hidden;
}

/* Scrollbar customization */
.xterm-viewport::-webkit-scrollbar { width: 8px; }
.xterm-viewport::-webkit-scrollbar-thumb { background: #424242; border-radius: 4px; }

/* --- NEW: SEPARATE INPUT ROW --- */
.terminal-input-row {
    display: flex;
    align-items: center;
    padding: 4px 8px;
    background: #252526; /* Slightly lighter than body */
    border-top: 1px solid #333;
    height: 32px;
    flex-shrink: 0;
}

.terminal-prompt {
    color: #34C759; /* Green prompt */
    font-family: 'Menlo', 'Monaco', monospace;
    font-weight: bold;
    margin-right: 8px;
    user-select: none;
    font-size: 14px;
}

.terminal-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    font-family: 'Menlo', 'Monaco', monospace;
    font-size: 13px;
    outline: none;
    padding: 0;
}

.terminal-input::placeholder {
    color: #666;
}

/* Minimized State */
.floating-terminal.minimized {
    height: 36px !important;
    min-height: 36px !important;
    width: 200px !important;
    resize: none;
}
.floating-terminal.minimized .terminal-body,
.floating-terminal.minimized .terminal-input-row {
    display: none;
}
