body {
    margin: 0;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f5f5f5;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    position: relative;
    overflow: hidden; /* Prevent page scroll */
}

#token-manager-container,
#mock-container {
    position: fixed;
    left: 20px;
    width: 300px;
    z-index: 100;
}

#token-manager-container {
    top: 40px;
    transform: none;
}

#mock-container {
    top: 50%;
    transform: translateY(20%); /* Move down by half the height */
}

.config-panel,
.mock-panel {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    width: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.config-panel:hover,
.mock-panel:hover {
    transform: translateX(5px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

#chat-container {
    display: flex;
    flex-direction: column;
    height: 600px;
    width: 500px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#chat-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

#messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background-color: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.message {
    margin: 8px 0;
    padding: 8px 12px;
    border-radius: 8px;
    max-width: 80%;
    word-wrap: break-word;
    white-space: pre-wrap;
    line-height: 1.4;
    position: relative;
}

.message.user {
    background-color: #007bff;
    color: white;
    margin-left: auto;
    margin-right: 8px; /* Add some space from the right edge */
}

.message.assistant {
    background-color: #f0f0f0;
    color: black;
    margin-right: auto;
    margin-left: 8px; /* Add some space from the left edge */
}

.message.system {
    background-color: #e9ecef;
    color: #495057;
    margin: 16px auto;
    text-align: center;
    font-style: italic;
    max-width: 90%;
}

.message.error {
    background-color: #dc3545;
    color: white;
}

.message.sending {
    opacity: 0.7;
}

.message.sending::after {
    content: '...';
    position: absolute;
    right: -20px;
    animation: ellipsis 1.5s infinite;
}

@keyframes ellipsis {
    0% { content: '.'; }
    33% { content: '..'; }
    66% { content: '...'; }
    100% { content: '.'; }
}

.error-message {
    background-color: #ff4444;
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    margin: 8px;
    text-align: center;
    animation: fadeOut 3s forwards;
}

@keyframes fadeOut {
    0% { opacity: 1; }
    70% { opacity: 1; }
    100% { opacity: 0; }
}

.input-container {
    display: flex;
    gap: 10px;
    padding: 15px;
    background-color: white;
    border-top: 1px solid #dee2e6;
    border-radius: 0 0 8px 8px;
    position: relative;
    z-index: 1;
}

#message-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    font-size: 16px;
    outline: none;
    caret-color: #007bff;
    color: #333;
    background: white;
    position: relative;
    z-index: 2;
}

#message-input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
    outline: none;
}

#message-input::placeholder {
    color: #6c757d;
    opacity: 1;
}

#send-button {
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.2s;
}

#send-button:hover {
    background-color: #0056b3;
}

.welcome-message {
    white-space: nowrap;
    overflow: hidden;
    animation: typing 3s steps(40, end), fadeIn 0.3s ease-in forwards;
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

.token-container {
    display: none; /* Hide old token container */
}

.token-input-container {
    display: flex;
    gap: 8px;
    width: 100%;
    position: relative;
    z-index: 1;
    align-items: center;
}

.token-input-container input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    color: #333;
    caret-color: #000;
    caret-width: 2px;
}

.token-input-container input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
    background: #fff;
    color: #333;
    caret-color: #000;
    caret-width: 2px;
}

.token-input-container input::placeholder {
    color: #6c757d;
}

.reveal-button {
    background: none;
    border: none;
    padding: 4px 8px;
    cursor: pointer;
    color: #6c757d;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    transition: background-color 0.2s;
    z-index: 3;
    flex-shrink: 0;
}

.reveal-button:hover {
    background-color: #f8f9fa;
}

.reveal-button:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.token-save-button {
    padding: 8px 12px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.token-save-button:hover {
    background-color: #0056b3;
}

.token-message {
    padding: 8px 12px;
    border-radius: 4px;
    margin-top: 8px;
    text-align: center;
    font-size: 14px;
}

.token-message.success {
    background-color: #28a745;
    color: white;
}

.token-message.error {
    background-color: #dc3545;
    color: white;
}

.config-panel h3 {
    margin: 0 0 15px 0;
    color: #2c3e50;
}

.config-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 16px;
}

.config-section label {
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
}

.config-section input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 14px;
    outline: none;
    min-height: 36px;
    color: #333;
}

.button-group {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.save-button, .reset-button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.save-button {
    background: #007bff;
    color: white;
}

.save-button:hover {
    background: #0056b3;
}

.reset-button {
    background: #6c757d;
    color: white;
}

.reset-button:hover {
    background: #5a6268;
}

/* Add cursor styles for all input fields */
input {
    caret-color: #000;
    caret-width: 2px;
}

/* Ensure cursor is visible in password fields */
input[type="password"] {
    caret-color: #000;
    caret-width: 2px;
    -webkit-text-security: none; /* Remove default password dots */
    text-security: none;
}

.config-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.config-group label {
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.config-group input[type="url"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    color: #333;
    caret-color: #000;
    caret-width: 2px;
    box-sizing: border-box;
}

.config-group input[type="url"]:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.config-group input[type="url"]::placeholder {
    color: #6c757d;
}

.config-form,
.mock-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.9rem;
    color: #666;
}

.form-group input,
.form-group textarea {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

button {
    padding: 0.5rem 1rem;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

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