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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #1a1a1a;
    color: #fff;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.chat-container {
    width: 100%;
    max-width: 600px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: #242424;
}

.chat-header {
    padding: 16px;
    background: #2d2d2d;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
}

.chat-header h1 {
    font-size: 18px;
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.status {
    font-size: 12px;
    color: #888;
}

.status.connected {
    color: #4caf50;
}

.status.error {
    color: #f44336;
}

.login-btn, .logout-btn, .settings-btn {
    padding: 6px 12px;
    border-radius: 12px;
    background: #0084ff;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
}

.login-btn:hover, .logout-btn:hover, .settings-btn:hover {
    background: #0073e6;
}

.logout-btn {
    background: #f44336;
}

.logout-btn:hover {
    background: #d32f2f;
}

.settings-btn {
    background: #3a3a3a;
}

.settings-btn:hover {
    background: #4a4a4a;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.message {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 18px;
    word-wrap: break-word;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.user {
    align-self: flex-end;
    background: #0084ff;
    color: #fff;
}

.message.assistant {
    align-self: flex-start;
    background: #3a3a3a;
    color: #fff;
}

.message.system {
    align-self: center;
    background: transparent;
    color: #888;
    font-size: 12px;
}

.typing-indicator {
    padding: 12px 16px;
    display: flex;
    gap: 4px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #666;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) {
    animation-delay: 0s;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-6px);
        opacity: 1;
    }
}

.chat-input {
    padding: 12px;
    background: #2d2d2d;
    display: flex;
    gap: 8px;
    border-top: 1px solid #333;
}

.chat-input textarea {
    flex: 1;
    padding: 10px 14px;
    border: none;
    border-radius: 20px;
    background: #3a3a3a;
    color: #fff;
    font-size: 14px;
    resize: none;
    outline: none;
    font-family: inherit;
    max-height: 120px;
}

.chat-input textarea::placeholder {
    color: #888;
}

.chat-input button {
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    background: #0084ff;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.chat-input button:hover {
    background: #0073e6;
}

.chat-input button:disabled {
    background: #555;
    cursor: not-allowed;
}

/* Scrollbar styling */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Auth container styles */
.auth-container {
    max-width: 400px;
    margin: 0 auto;
    padding: 40px 20px;
    text-align: center;
}

.auth-container h1 {
    font-size: 32px;
    margin-bottom: 30px;
    color: #fff;
}

.auth-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    justify-content: center;
}

.auth-tab {
    padding: 10px 24px;
    border: none;
    background: #3a3a3a;
    color: #888;
    font-size: 14px;
    font-weight: 600;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-tab.active {
    background: #0084ff;
    color: #fff;
}

.auth-form {
    background: #2d2d2d;
    padding: 30px;
    border-radius: 16px;
}

.auth-form.hidden {
    display: none;
}

.auth-form h2 {
    font-size: 20px;
    margin-bottom: 20px;
    color: #fff;
}

.auth-form input {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 12px;
    border: none;
    border-radius: 12px;
    background: #3a3a3a;
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    outline: none;
}

.auth-form input::placeholder {
    color: #888;
}

.auth-form button {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 12px;
    background: #0084ff;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 10px;
}

.auth-form button:hover {
    background: #0073e6;
}

.auth-error {
    margin-top: 15px;
    padding: 10px;
    border-radius: 8px;
    background: rgba(244, 67, 54, 0.1);
    color: #f44336;
    font-size: 14px;
    min-height: 20px;
}

.auth-info {
    margin-top: 15px;
    padding: 10px;
    border-radius: 8px;
    background: rgba(76, 175, 80, 0.1);
    color: #4caf50;
    font-size: 14px;
}

.auth-warning {
    margin-top: 15px;
    padding: 10px;
    border-radius: 8px;
    background: rgba(255, 152, 0, 0.1);
    color: #ff9800;
    font-size: 14px;
}

.auth-divider {
    margin: 24px 0;
    text-align: center;
    position: relative;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #3a3a3a;
}

.auth-divider span {
    position: relative;
    background: #2d2d2d;
    padding: 0 16px;
    color: #888;
    font-size: 14px;
}

.btn-oidc {
    width: 100%;
    padding: 12px;
    border: 1px solid #3a3a3a;
    border-radius: 12px;
    background: transparent;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-oidc:hover {
    background: #3a3a3a;
    border-color: #4a4a4a;
}

.btn-oidc svg {
    flex-shrink: 0;
}

/* Settings page styles */
.settings-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.settings-section {
    background: #2d2d2d;
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.settings-section h2 {
    font-size: 18px;
    margin-bottom: 16px;
    color: #fff;
}

.settings-description {
    color: #888;
    font-size: 14px;
    margin-bottom: 16px;
}

.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #3a3a3a;
}

.settings-item:last-child {
    border-bottom: none;
}

.settings-item label {
    color: #888;
    font-size: 14px;
    font-weight: 600;
}

.settings-item span {
    color: #fff;
    font-size: 14px;
}

.settings-item input {
    flex: 1;
    max-width: 300px;
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    background: #3a3a3a;
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    outline: none;
}

.settings-item input::placeholder {
    color: #888;
}

.btn-primary, .btn-secondary, .btn-danger {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 16px;
}

.btn-primary {
    background: #0084ff;
    color: #fff;
}

.btn-primary:hover {
    background: #0073e6;
}

.btn-secondary {
    background: #3a3a3a;
    color: #fff;
}

.btn-secondary:hover {
    background: #4a4a4a;
}

.btn-danger {
    background: #f44336;
    color: #fff;
}

.btn-danger:hover {
    background: #d32f2f;
}

.back-btn {
    padding: 6px 12px;
    border-radius: 12px;
    background: #3a3a3a;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s;
}

.back-btn:hover {
    background: #4a4a4a;
}
