/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');
body {
    font-family: "Inter", sans-serif;
    background: #F1F5F9;
    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: #336699;
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background: #336699;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: #10315A;
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-secondary {
    padding: 10px 16px;
    background: white;
    color: #334155;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    margin-left: 10px;
    display: flex;
    justify-content: center;
}

.btn-secondary:hover {
    background: #0B2E65;
    color: white;
}

.btn-icon {
    padding: 6px 12px;
    background: white;
    color: #0B2E65;
    border: 2px solid #0B2E65;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    margin-left: 10px;
}

.btn-icon:hover {
    background: #F47A20;
    color: white;
    border-color: #F47A20;
    transform: rotate(180deg);
}

.btn-icon:active {
    transform: rotate(360deg);
}

.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;
}

.app-version {
    text-align: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
    color: #999;
    font-size: 11px;
    font-weight: 500;
}

.badge-logo {
    display: flex;
    align-items: center;
    line-height: 16px;
    margin-bottom: 40px;
    margin-left: 10px;
}

.badge-logo h1 {
    display: flex;
    margin-right: 10px;
}

.badge-logo p {
    font-size: 16px;
    font-weight: 600;
}

.badge-logo small {
    font-size: 13px;
    font-weight: 400;
    opacity: .8;
}

.login-box .badge-logo {
    margin-left: 0;
    margin-bottom: 20px;
}

.login-box .language-selector {
    margin-left: 0;
    margin-bottom: 20px;
}

/* Chat Page Styles */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: transparent;
}

.chat-header {
    background: #FAFEFE;
    color: inherit;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-left: 320px;
    border-bottom: 1px solid #E2E8F0;
}

.header-left h1 {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.user-info {
    font-size: 0.8rem;
    opacity: 0.9;
    margin-left: 10px;
    border-top: 1px solid #E2E8F0;
    font-weight: 600;
    padding: 10px 0;
}

.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: #F1F5F9;
}

.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: #369;
    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: transparent;
    padding: 20px;
    border-top: none;
    box-shadow: none;
    margin-left: 320px;
}

.message-form {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    /*! background: white; */
    /*! padding: 20px; */
    position: relative;
}

.message-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #e0e0e0;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 60px;
    max-height: 150px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.message-form textarea:focus {
    outline: none;
    border-color: #F47A20;
}

.message-form button {
    width: auto;
    padding: 0;
    position: absolute;
    right: 10px;
    background: #336699;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    margin-top: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.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;
}

.chat-footer .app-version {
    max-width: 900px;
    margin: 10px auto 0;
    padding-top: 10px;
    border-top: none;
    color: #aaa;
    font-size: 10px;
}

/* 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%;
    }
}

/* Quick Messages Sidebar */
.quick-messages-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 320px;
    background: #fff;
    border-right: 1px solid #E2E8F0;
    padding: 20px 30px 20px 20px;
    overflow-y: auto;
    z-index: 10;
    display: flex;
    flex-direction: column;
}

.quick-messages-sidebar h3 {
    color: #94A3B8;
    font-size: 12px;
    margin-bottom: 0px;
    font-weight: 600;
    margin-top: 20px;
    padding: 4px 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.quick-messages-sidebar .text-link {
    margin-left: 10px;
    margin-bottom: 20px;
    margin-top: 7px;
}

.quick-messages-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: auto;
}

.quick-message-btn {
    background: white;
    border: none;
    border-radius: 8px;
    padding: 8px 10px;
    text-align: left;
    cursor: pointer;
    /*! transition: all 0.2s; */
    font-size: 14px;
    color: #333;
    line-height: 1.4;
    display: flex;
}

.quick-message-btn:hover {
    background: #F1F5F9;
    color: inherit;
    border-color: #0B2E65;
    transform: translateX(0px);
    outline: 1px solid #E2E8F0;
}

.quick-messages-list .loading,
.quick-messages-list .no-messages,
.quick-messages-list .error {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 14px;
}

.quick-messages-list .error {
    color: #c33;
}

.quick-message-btn::before {
    content: "";
    display: flex;
    width: 50px;
    height: 16px;
    background-image: url("data:image/svg+xml;utf8,<svg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'><path d='M5 11.5C5.82812 11.5 6.5 12.1719 6.5 13V13.5L8.76562 11.8C9.025 11.6063 9.34062 11.5 9.66562 11.5H14C14.275 11.5 14.5 11.275 14.5 11V2C14.5 1.725 14.275 1.5 14 1.5H2C1.725 1.5 1.5 1.725 1.5 2V11C1.5 11.275 1.725 11.5 2 11.5H5M6.5 15.375L6.49375 15.3813L6.33437 15.5L5.8 15.9C5.65 16.0125 5.44688 16.0312 5.275 15.9469C5.10312 15.8625 5 15.6906 5 15.5V13H3.5H2C0.896875 13 0 12.1031 0 11V2C0 0.896875 0.896875 0 2 0H14C15.1031 0 16 0.896875 16 2V11C16 12.1031 15.1031 13 14 13H9.66562L6.5 15.375Z' fill='%23336699' fill-opacity='0.7'/></svg>");
    background-repeat: no-repeat;
    background-size: 16px 16px;
    margin-top: 5px;
}


#newConversationBtn::before {
    content: "";
    display: flex;
    width: 20px;
    height: 16px;
    background-image: url("data:image/svg+xml;utf8,<svg width='14' height='16' viewBox='0 0 14 16' fill='none' xmlns='http://www.w3.org/2000/svg'><path d='M8 2.5C8 1.94687 7.55313 1.5 7 1.5C6.44687 1.5 6 1.94687 6 2.5V7H1.5C0.946875 7 0.5 7.44687 0.5 8C0.5 8.55313 0.946875 9 1.5 9H6V13.5C6 14.0531 6.44687 14.5 7 14.5C7.55313 14.5 8 14.0531 8 13.5V9H12.5C13.0531 9 13.5 8.55313 13.5 8C13.5 7.44687 13.0531 7 12.5 7H8V2.5Z' fill='%23EC6608'/></svg>");
    background-repeat: no-repeat;
    background-size: 14px 16px;
}




/* Adjust chat body to make room for sidebar */
.chat-body {
    margin-left: 320px;
}

.text-link {
    text-decoration: underline;
    font-weight: 600;
    font-size: 14px;
}

.language-selector {
    background: #F1F5F9;
    border: 1px solid #E2E8F0;
    padding: 10px;
    border-radius: 6px;
    margin-left: 10px;
}

.d-none {
    display: none;
}

/* Responsive adjustments for quick messages */
@media (max-width: 1024px) {
    .quick-messages-sidebar {
        width: 250px;
    }

    .chat-body {
        margin-right: 250px;
    }
}

@media (max-width: 768px) {
    .quick-messages-sidebar {
        display: none; /* Hide sidebar on mobile */
    }

    .chat-body {
        margin-right: 0;
    }
}