* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #1e1e1e;
    color: #cccccc;
    font-family: 'Segoe UI', sans-serif;
    height: 100vh;
    overflow: hidden;
}

/* Login */
#login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
}

.login-box {
    background: #2d2d2d;
    padding: 40px;
    border-radius: 8px;
    width: 360px;
}

.login-box h1 {
    text-align: center;
    margin-bottom: 24px;
    color: #ffffff;
    font-size: 24px;
}

.login-box input {
    width: 100%;
    padding: 12px;
    margin-bottom: 16px;
    background: #3c3c3c;
    border: 1px solid #555;
    border-radius: 4px;
    color: #fff;
    font-size: 14px;
}

.login-box input:focus {
    outline: none;
    border-color: #007acc;
}

.login-box button {
    width: 100%;
    padding: 12px;
    background: #007acc;
    border: none;
    border-radius: 4px;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
}

.login-box button:hover {
    background: #005f9e;
}

.login-box button:disabled {
    background: #555;
    cursor: not-allowed;
}

.error {
    color: #f44;
    text-align: center;
    margin-top: 12px;
    min-height: 20px;
}

/* Terminal */
#terminal-container {
    height: 100vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
}

#terminal {
    flex: 1;
    width: 100%;
    min-height: 0;
    overflow: hidden;
}

#terminal-toolbar {
    display: flex;
    gap: 6px;
    padding: 6px 8px;
    background: #1a1a1a;
    border-top: 1px solid #333;
    flex-shrink: 0;
}

#terminal-toolbar button {
    padding: 6px 12px;
    background: #333;
    border: 1px solid #555;
    border-radius: 4px;
    color: #ccc;
    font-family: Consolas, monospace;
    font-size: 13px;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

#terminal-toolbar button:hover {
    background: #444;
    border-color: #007acc;
    color: #fff;
}

#terminal-toolbar button:active {
    background: #007acc;
}

#sessions-btn {
    margin-left: auto;
    background: #2a4a6b !important;
    border-color: #007acc !important;
}

/* Directory Selection */
#dir-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
}

.dir-box {
    background: #2d2d2d;
    padding: 40px;
    border-radius: 8px;
    width: 560px;
    max-height: 80vh;
    overflow-y: auto;
}

.dir-box h1 {
    text-align: center;
    margin-bottom: 24px;
    color: #ffffff;
    font-size: 24px;
}

.dir-input-group {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.dir-input-group input {
    flex: 1;
    padding: 12px;
    background: #3c3c3c;
    border: 1px solid #555;
    border-radius: 4px;
    color: #fff;
    font-size: 14px;
}

.dir-input-group input:focus {
    outline: none;
    border-color: #007acc;
}

.dir-input-group button {
    padding: 12px 24px;
    background: #007acc;
    border: none;
    border-radius: 4px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
}

.dir-input-group button:hover {
    background: #005f9e;
}

#dir-list {
    margin-bottom: 16px;
}

.dir-item {
    padding: 12px 16px;
    background: #3c3c3c;
    border: 1px solid #444;
    border-radius: 4px;
    margin-bottom: 8px;
    cursor: pointer;
    color: #ccc;
    font-family: Consolas, monospace;
    font-size: 13px;
    word-break: break-all;
    transition: background 0.15s, border-color 0.15s;
}

.dir-item:hover {
    background: #4a4a4a;
    border-color: #007acc;
    color: #fff;
}

/* Directory Browser */
#dir-browser {
    background: #252525;
    border: 1px solid #444;
    border-radius: 4px;
    padding: 12px;
    margin-bottom: 16px;
}

.dir-breadcrumb {
    padding: 8px 0;
    margin-bottom: 8px;
    font-size: 13px;
    font-family: Consolas, monospace;
    color: #888;
    word-break: break-all;
}

.breadcrumb-item {
    color: #4fc3f7;
    cursor: pointer;
}

.breadcrumb-item:hover {
    color: #fff;
    text-decoration: underline;
}

.breadcrumb-sep {
    color: #666;
}

.dir-browser-list {
    max-height: 240px;
    overflow-y: auto;
    margin-bottom: 12px;
}

.dir-browser-item {
    padding: 8px 12px;
    background: #3c3c3c;
    border: 1px solid #444;
    border-radius: 4px;
    margin-bottom: 4px;
    cursor: pointer;
    color: #ccc;
    font-family: Consolas, monospace;
    font-size: 13px;
    transition: background 0.15s, border-color 0.15s;
}

.dir-browser-item:hover {
    background: #4a4a4a;
    border-color: #007acc;
    color: #fff;
}

.dir-browser-empty {
    padding: 12px;
    text-align: center;
    color: #666;
    font-size: 13px;
}

.dir-browser-actions {
    display: flex;
    gap: 8px;
}

.dir-browser-actions button {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 4px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
}

#dir-confirm-btn {
    background: #007acc;
}

#dir-confirm-btn:hover {
    background: #005f9e;
}

.dir-close {
    background: #555;
}

.dir-close:hover {
    background: #666;
}

.dir-default {
    width: 100%;
    padding: 10px;
    background: transparent;
    border: 1px solid #555;
    border-radius: 4px;
    color: #888;
    font-size: 14px;
    cursor: pointer;
    margin-top: 8px;
}

.dir-default:hover {
    border-color: #007acc;
    color: #ccc;
}

/* Session List */
.session-list-header {
    font-size: 13px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    margin-top: 4px;
}

#session-list {
    margin-bottom: 16px;
}

.session-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #3c3c3c;
    border: 1px solid #444;
    border-radius: 4px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.session-item:hover {
    background: #4a4a4a;
    border-color: #007acc;
}

.session-item-active {
    border-color: #007acc;
    background: #2a3a4a;
}

.session-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.session-item-name {
    color: #ddd;
    font-family: Consolas, monospace;
    font-size: 13px;
    word-break: break-all;
}

.session-item-time {
    color: #777;
    font-size: 11px;
}

.session-item-badge {
    display: inline-block;
    background: #007acc;
    color: #fff;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 3px;
    margin-top: 2px;
    width: fit-content;
}

.session-item-actions {
    display: flex;
    gap: 6px;
    margin-left: 12px;
    flex-shrink: 0;
}

.session-connect-btn {
    padding: 5px 12px;
    background: #007acc;
    border: none;
    border-radius: 3px;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
}

.session-connect-btn:hover {
    background: #005f9e;
}

.session-delete-btn {
    padding: 5px 12px;
    background: #555;
    border: none;
    border-radius: 3px;
    color: #ccc;
    font-size: 12px;
    cursor: pointer;
}

.session-delete-btn:hover {
    background: #c44;
    color: #fff;
}

/* Session Overlay */
#session-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.session-overlay-box {
    background: #2d2d2d;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 24px;
    width: 480px;
    max-height: 70vh;
    overflow-y: auto;
}

.session-overlay-box h2 {
    color: #fff;
    font-size: 18px;
    margin-bottom: 16px;
}

#session-overlay-list {
    margin-bottom: 16px;
}

#session-overlay-close {
    width: 100%;
    padding: 8px;
    border: none;
    border-radius: 4px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
}
