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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #1e1e1e;
    color: #ffffff;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    background: #252526;
    padding: 1rem 2rem;
    border-bottom: 1px solid #3c3c3c;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 500;
}

.container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.sidebar {
    width: 300px;
    background: #252526;
    border-right: 1px solid #3c3c3c;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid #3c3c3c;
    font-weight: 600;
}

.instrument-list {
    flex: 1;
    overflow-y: auto;
}

.instrument-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #3c3c3c;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.instrument-item:hover {
    background: #2a2a2a;
}

.instrument-item.active {
    background: #094771;
}

.instrument-status {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
}

.instrument-status.online { 
    background: #4caf50; 
}

.instrument-status.offline { 
    background: #666; 
}

.instrument-shell {
    font-size: 0.7rem;
    color: #888;
    margin-top: 0.25rem;
    font-family: 'Courier New', monospace;
}

.instrument-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-restart {
    padding: 0.25rem 0.5rem;
    background: #d32f2f;
    border: none;
    color: white;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.75rem;
}

.btn-restart:hover { 
    background: #b71c1c; 
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #1e1e1e;
}

.terminal-container {
    flex: 1;
    padding: 1rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#terminal {
    flex: 1;
    background: #1e1e1e;
    overflow: hidden;
}

/* Xterm.js specific styles */
.xterm {
    height: 100%;
    padding: 0.5rem;
}

.xterm-viewport {
    background-color: #1e1e1e !important;
}

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

.no-device {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #888;
    font-size: 1.2rem;
}

.terminal-info {
    padding: 0.5rem 1rem;
    background: #252526;
    border-bottom: 1px solid #3c3c3c;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-disconnect {
    padding: 0.5rem 1rem;
    background: #666;
    border: none;
    color: white;
    border-radius: 3px;
    cursor: pointer;
}

.btn-disconnect:hover { 
    background: #555; 
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #252526;
    border: 1px solid #3c3c3c;
    border-radius: 6px;
    padding: 1.5rem;
    min-width: 400px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.modal-content h3 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 500;
}

.modal-body {
    margin-bottom: 1.5rem;
}

.modal-body label {
    display: block;
    margin-bottom: 0.5rem;
    color: #ccc;
    font-size: 0.9rem;
}

.shell-select {
    width: 100%;
    padding: 0.5rem;
    background: #1e1e1e;
    color: #fff;
    border: 1px solid #3c3c3c;
    border-radius: 3px;
    font-size: 1rem;
    font-family: 'Courier New', monospace;
    cursor: pointer;
}

.shell-select:focus {
    outline: none;
    border-color: #007acc;
}

.shell-info {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #888;
    font-style: italic;
}

.modal-actions {
    display: flex;
    gap: 0.5rem;
    justify-Content: flex-end;
}

.btn-cancel, .btn-connect {
    padding: 0.5rem 1.5rem;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-cancel {
    background: #666;
    color: white;
}

.btn-cancel:hover {
    background: #555;
}

.btn-connect {
    background: #007acc;
    color: white;
}

.btn-connect:hover {
    background: #005a9e;
}
