* {
    box-sizing: border-box;
}

body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
}

.container {
    width: 100%;
    max-width: 480px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#connectButton {
    margin-bottom: 20px;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    width: 100%;
    max-width: 320px;
}

.form-section {
    width: 100%;
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.form-section h2 {
    margin: 0 0 12px 0;
    font-size: 20px;
    font-weight: bold;
    color: #333;
    text-align: center;
}

.form-instructions {
    font-size: 14px;
    color: #555;
    text-align: center;
    margin-bottom: 16px;
    line-height: 1.4;
}

.form-section form > div {
    margin-bottom: 1.25rem; /* spacing between controls */
}

.form-section label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.form-section input,
.form-section select {
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #fff;
}

.form-section input,
.form-section select {
    width: 100%;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #fff;
    box-sizing: border-box;
    padding: 0.55rem 0.6rem;
    font-size: 1rem;
}

.form-section .small {
    display: block;
    margin-top: 0.25rem;
    color: #666;
}

.form-section input:focus,
.form-section select:focus {
    outline: none;
    border-color: #007BFF;
    box-shadow: 0 0 0 1px rgba(0, 123, 255, 0.3);
}

/* Optional styling for hover tooltip */
.agent-form-card {
    display: block;
    padding: 12px;
    margin-bottom: 8px;
    border: 1px solid #ccc;
    border-radius: 6px;
    text-decoration: none;
    color: #000;
    transition: background 0.2s;
}
.agent-form-card:hover {
    background: #f0f0f0;
}

.logo {
    margin-bottom: 20px;
    text-align: center;
}

.logo img {
    width: 100%;
    max-width: 200px;
    display: block;
    margin: 0 auto;
}

.user-bar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    margin-bottom: 16px;
}

.user-row {
    display: flex;
    align-items: center;
    width: 100%;
}

/* Top row: username */
.top-row {
    justify-content: flex-start;
}

.user-name {
    font-weight: bold;
    color: #007BFF;
    text-decoration: none;
}

/* Bottom row: account + logout */
.bottom-row {
    justify-content: space-between;
    gap: 8px;
}

.left-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-name:hover {
    text-decoration: underline;
}

.user-bar form {
    margin: 0;
}

/* Tool buttons */
.tool-group {
    display: flex;               /* horizontal row */
    justify-content: center;     /* center row inside container */
    gap: 10px;                   /* spacing between tool icons */
    margin-top: 10px;
}

.tool-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    width: 50px;
    height: 50px;
    background-color: #e6e6e6;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.tool-icon:hover {
    background-color: #d0d0d0;
}

/* Login form (keep existing styles) */
.login-form {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.login-form input {
    margin-bottom: 10px;
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.login-form button {
    padding: 10px;
    font-size: 16px;
    color: #fff;
    background-color: #007BFF;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.login-form button:hover {
    background-color: #0056b3;
}

.forgot-password {
    margin: 14px 0 18px 0;
    text-align: center;
}

.forgot-password a {
    font-size: 14px;
    color: #007BFF;
    text-decoration: none;
}

.forgot-password a:hover {
    text-decoration: underline;
}

/* Video container */
#videoContainer {
    position: relative;
    width: 100%;
    max-width: 320px;
    aspect-ratio: 2 / 3;
    background-color: black;
    border-radius: 8px;
    overflow: hidden;
    visibility: hidden;
}

#videoContainer.visible {
    visibility: visible;
}

#jocfCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

#consoleOverlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 10px;
    font-family: monospace;
    font-size: 14px;
    color: #00ff00;
    background-color: rgba(0, 0, 0, 0.5);
    overflow-y: auto;
    white-space: pre-wrap;
    pointer-events: none;
    z-index: 10;
}

.back-link {
    text-decoration: none;
    font-size: 14px;
    color: #007BFF;
}

.back-link:hover {
    text-decoration: underline;
}

.profile-section {
    margin-top: 20px;
    width: 100%;
}

.profile-row {
    display: block;
    margin-bottom: 16px;
}

.profile-row label {
    display: block;
    font-weight: bold;
    margin-bottom: 4px;
    color: #555;
}

.profile-value {
    word-break: break-word; /* Wrap long contents */
    color: #333;
}

.password-form .form-row {
    margin-bottom: 16px;
}

.password-form label {
    display: block;
    font-weight: bold;
    margin-bottom: 6px;
}

.password-form input {
    width: 100%;
    padding: 8px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.password-form button {
    padding: 10px 20px;
    font-size: 16px;
    background-color: #007BFF;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.password-form button:hover {
    background-color: #0056b3;
}

.form-error {
    color: red;
    font-size: 13px;
    margin-top: 4px;
}

.form-success {
    color: green;
    font-size: 14px;
    margin-bottom: 12px;
}

.reset-form {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.reset-form input {
    margin-bottom: 10px;
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.reset-form button {
    padding: 10px;
    font-size: 16px;
    color: #fff;
    background-color: #007BFF;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.reset-form button:hover {
    background-color: #0056b3;
}

.back-link {
    text-decoration: none;
    font-size: 14px;
    color: #007BFF;
}

.back-link:hover {
    text-decoration: underline;
}

.flash-message {
    margin: 1rem 0 1.5rem 0;  /* top | sides | bottom */
    padding: 0.75rem 1rem;
    border-radius: 4px;
}

/* Account selector */

.account-bar {
    width: 100%;
    margin-bottom: 20px; /* visual separation from page content */
}

.account-form {
    margin: 0;
    flex: 1; /* allow it to shrink properly */
}

.account-selector {
    width: 100%;
    max-width: 100%;
    padding: 6px 8px;
    font-size: 14px;
    border-radius: 4px;
}

.account-selector select {
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.account-selector:focus {
    outline: none;
    border-color: #007BFF;
    background-color: #fff;
}

/* Optional label above selector */
.account-label {
    display: block;
    font-size: 12px;
    font-weight: bold;
    color: #555;
    margin-bottom: 4px;
}

/* Slight divider feel */
.account-divider {
    width: 100%;
    height: 1px;
    background-color: #e0e0e0;
    margin: 16px 0;
}

/* Toast-style flash messages */
.flash-message.success {
    background-color: #e6f4ea;
    border: 1px solid #b7dfc2;
}

.flash-message.error {
    background-color: #fdecea;
    border: 1px solid #f5c2c0;
}

.form-section {
    max-width: 400px;
    margin: 0 auto;
}

.form-row {
    margin-bottom: 12px;
}

label {
    display: block;
    font-weight: bold;
    margin-bottom: 4px;
}

input {
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
}

button {
    padding: 8px 16px;
    cursor: pointer;
}


