/* Retro terminal aesthetic */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Courier New', monospace;
    background: #0a0a0a;
    color: #00ff00;
    line-height: 1.6;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Header */
.header {
    border: 2px solid #00ff00;
    padding: 20px;
    margin-bottom: 20px;
    background: #000;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-icon {
    width: 48px;
    height: 48px;
    filter: drop-shadow(0 0 5px #00ff00);
}

.header h1 {
    font-size: 24px;
    text-align: center;
    letter-spacing: 2px;
}

.header .subtitle {
    text-align: center;
    color: #00aa00;
    font-size: 14px;
    margin-top: 5px;
}

/* Login form */
.login-container {
    border: 2px solid #00ff00;
    padding: 30px;
    max-width: 500px;
    margin: 50px auto;
    background: #000;
}

.login-container h2 {
    margin-bottom: 20px;
    color: #00ff00;
}

.login-container button {
    display: block;
    margin: 30px auto 0; /* Center the login button with more spacing */
    min-width: 200px; /* Wider button */
}

.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    color: #00aa00;
}

input[type="email"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 8px;
    background: #000;
    border: 1px solid #00ff00;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #00ff00;
    box-shadow: 0 0 5px #00ff00;
}

button {
    padding: 10px 20px;
    background: #000;
    border: 2px solid #00ff00;
    color: #00ff00;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    margin-right: 10px;
}

button:hover {
    background: #00ff00;
    color: #000;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Custom checkbox styling */
input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #00ff00;
    background: #000;
    cursor: pointer;
    position: relative;
    margin: 0;
}

input[type="checkbox"]:checked::before {
    content: '✓';
    position: absolute;
    color: #00ff00;
    font-size: 14px;
    font-weight: bold;
    left: 2px;
    top: -2px;
}

input[type="checkbox"]:hover {
    box-shadow: 0 0 5px #00ff00;
}

/* Chat interface */
.chat-container {
    display: none;
}

.chat-controls {
    border: 2px solid #00ff00;
    padding: 15px;
    margin-bottom: 20px;
    background: #000;
    display: grid;
    grid-template-columns: 1fr 1fr; /* 2 equal columns */
    gap: 15px;
}

.control-cell {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-cell label {
    margin-bottom: 0;
    color: #00aa00;
    font-size: 14px; /* Larger label text */
    font-weight: bold;
}

.control-cell select {
    width: 100%; /* Fill cell width */
    flex: 1;
}

/* Buttons cell - horizontal layout */
.control-buttons {
    flex-direction: row;
    align-items: flex-end;
    gap: 10px;
    justify-content: flex-start;
}

.control-buttons button {
    margin-right: 0;
    padding: 8px 16px; /* Compact buttons */
    font-size: 12px;
    min-width: 80px; /* Narrow buttons */
}

/* RAG toggle label */
.rag-label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.rag-label input {
    cursor: pointer;
}

/* Status indicator */
.status-indicator {
    display: none;
    padding: 15px;
    color: #00aa00;
    font-size: 12px;
    border-top: 1px solid #00ff00;
}

/* Error message - hidden by default */
.error {
    display: none;
}

.error:not(:empty) {
    display: block;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .chat-controls {
        gap: 8px;
        padding: 10px;
    }

    .chat-controls select {
        max-width: 150px;
        font-size: 14px;
    }

    .chat-controls button {
        font-size: 14px;
        padding: 8px 12px;
    }

    /* Hide separator pipes on mobile */
    .separator {
        display: none;
    }
}


.chat-messages {
    border: 2px solid #00ff00;
    height: 500px;
    overflow-y: auto;
    padding: 15px;
    margin-bottom: 20px;
    background: #000;
}

.message {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #003300;
}

.message:last-child {
    border-bottom: none;
}

.message-header {
    color: #00aa00;
    font-weight: bold;
    margin-bottom: 5px;
}

.message-content {
    color: #00ff00;
    white-space: pre-wrap;
}

.user-message .message-header {
    color: #00ffff;
}

.user-message .message-content {
    color: #00ffff;
}

.sources {
    margin-top: 10px;
    padding: 10px;
    border: 1px solid #003300;
    background: #001100;
    font-size: 12px;
}

.sources summary {
    cursor: pointer;
    color: #00aa00;
    margin-bottom: 5px;
}

.source-item {
    margin: 5px 0;
    padding-left: 15px;
}

.chat-input-container {
    border: 2px solid #00ff00;
    padding: 15px;
    background: #000;
}

.chat-input {
    display: flex;
    gap: 10px;
}

textarea {
    flex: 1;
    resize: vertical;
    min-height: 60px;
}

.error {
    color: #ff0000;
    border-color: #ff0000;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ff0000;
    background: #110000;
}

.error:empty {
    display: none;
    padding: 0;
    margin: 0;
    border: none;
}

.success {
    color: #00ff00;
    padding: 10px;
    margin: 10px 0;
}

/* Scanline effect */
@keyframes scanline {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100vh); }
}

.scanline {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: rgba(0, 255, 0, 0.1);
    animation: scanline 6s linear infinite;
    pointer-events: none;
}
