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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #0B2E65 0%, #1a4d99 100%);
    color: #333;
    line-height: 1.6;
}

.container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

/* Login Page Styles */
.login-box {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    width: 100%;
}

.login-box h1 {
    text-align: center;
    color: #0B2E65;
    margin-bottom: 10px;
    font-size: 2rem;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #F47A20;
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background: #F47A20;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: #d66817;
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-secondary {
    padding: 8px 16px;
    background: white;
    color: #0B2E65;
    border: 2px solid #0B2E65;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-left: 10px;
}

.btn-secondary:hover {
    background: #0B2E65;
    color: white;
}

.error-message {
    background: #fee;
    color: #c33;
    padding: 12px;
    border-radius: 8px;
    margin-top: 15px;
    border-left: 4px solid #c33;
}

.info-box {
    margin-top: 30px;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 8px;
}

.info-box h3 {
    margin-bottom: 10px;
    color: #0B2E65;
}

.info-box ul {
    list-style: none;
}

.info-box li {
    padding: 5px 0;
    font-size: 14px;
}

/* Chat Page Styles */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: white;
}

.chat-header {
    background: #0B2E65;
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-left h1 {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.user-info {
    font-size: 0.9rem;
    opacity: 0.9;
}

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

.conversation-info {
    margin-right: 15px;
    font-size: 0.9rem;
    opacity: 0.9;
}

.chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f5f5f5;
}

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

.welcome-message {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.welcome-message h2 {
    color: #0B2E65;
    margin-bottom: 15px;
}

.message {
    margin-bottom: 20px;
    display: flex;
    animation: fadeIn 0.3s ease-in;
}

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

.message.user {
    justify-content: flex-end;
}

.message.assistant {
    justify-content: flex-start;
}

.message-content {
    max-width: 70%;
    padding: 15px 20px;
    border-radius: 12px;
    position: relative;
}

.message.user .message-content {
    background: #F47A20;
    color: white;
    border-bottom-right-radius: 4px;
}

.message.assistant .message-content {
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.message-role {
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 5px;
    opacity: 0.8;
}

.message-text {
    white-space: pre-wrap;
    word-wrap: break-word;
}

.typing-indicator {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    background: white;
    border-radius: 12px;
    max-width: 100px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #F47A20;
    border-radius: 50%;
    margin: 0 3px;
    animation: typing 1.4s infinite;
}

.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.5; }
    30% { transform: translateY(-10px); opacity: 1; }
}

.chat-footer {
    background: white;
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.message-form {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.message-form textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 60px;
    max-height: 150px;
}

.message-form textarea:focus {
    outline: none;
    border-color: #F47A20;
}

.message-form button {
    width: 100%;
    padding: 12px 30px;
}

.status-message {
    max-width: 900px;
    margin: 10px auto 0;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.9rem;
    text-align: center;
}

.status-message.error {
    background: #fee;
    color: #c33;
}

.status-message.info {
    background: #e3f2fd;
    color: #1976d2;
}

/* Scrollbar Styles */
.chat-body::-webkit-scrollbar {
    width: 8px;
}

.chat-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chat-body::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

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

/* Responsive */
@media (max-width: 768px) {
    .chat-header {
        flex-direction: column;
        gap: 10px;
    }

    .header-right {
        width: 100%;
        justify-content: space-between;
    }

    .message-content {
        max-width: 85%;
    }

    .message-form {
        flex-direction: column;
    }

    .message-form button {
        width: 100%;
    }
}