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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.7;
    color: #2c3e50;
    background: #f8f9fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 40px);
}

.chat-container {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    flex: 1;
    display: flex;
    flex-direction: column;
    border: 1px solid #e9ecef;
    min-height: 0;
    padding-bottom: 40px;
}

.chat-header {
    text-align: center;
    padding: 30px 20px 20px;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 0;
    background: #ffffff;
    border-radius: 10px 10px 0 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.chat-header h1 {
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 15px;
    font-weight: normal;
}

.chat-header .subtitle {
    font-size: 1rem;
    color: #6c757d;
    font-style: italic;
    font-weight: normal;
}

.language-switcher {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 20px;
}

.lang-btn {
    padding: 2px 4px;
    border: 1px solid #6c757d;
    background-color: transparent;
    color:#6c757d;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 300;
    transition: all 0.3s ease;
}

.lang-btn:hover {
    background-color: #6c757d;
    color: white;
}

.lang-btn.active {
    background-color: #6c757d;
    color: white;
}

.lang-btn.hidden {
    display: none;
}

.exhibition-info {
    padding: 20px;
    background-color: #f8f9fa;
    border-left: 4px solid #dc3545;
    margin: 20px;
    font-size: 14px;
    border-radius: 4px;
    flex-shrink: 0;
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 0 20px;
    margin-bottom: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.message {
    padding: 12px 16px;
    margin-bottom: 10px;
    border-radius: 18px;
    max-width: 80%;
    word-wrap: break-word;
}

.user-message {
    background-color: #007bff;
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.assistant-message, .typing-message {
    background-color: #e9e9e9;
    color: #333;
    margin-right: auto;
    border-bottom-left-radius: 4px;
    white-space: pre-line !important;
}

.assistant-message a {
    color: #007bff;
    text-decoration: none;
}

.assistant-message a:hover {
    text-decoration: underline;
}

.typing-message {
    font-style: italic;
    background-color: white;
}

.input-container {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 20px;
    background: #ffffff;
    border-radius: 0 0 10px 10px;
    border-top: 1px solid #e9ecef;
    z-index: 100;
    flex-shrink: 0;
}

#user-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #ccc;
    border-radius: 24px;
    font-size: 16px;
    outline: none;
    font-family: inherit;
    min-height: 44px;
    max-height: 120px;
    resize: none;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    line-height: 1.4;
}

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

#send-button {
    padding: 12px 24px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 24px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s ease;
    height: 44px;
    flex-shrink: 0;
}

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

#send-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.typing-indicator {
    display: none;
    font-style: italic;
    color: #777;
    margin-bottom:20px;
}

.error-message {
    color: #d32f2f;
    padding: 15px 20px;
    background-color: #ffebee;
    border-radius: 5px;
    margin: 10px 20px;
    display: none;
    border-left: 3px solid #d32f2f;
}

.info-link {
    color: #007bff;
    text-decoration: none;
    font-weight: bold;
}

.info-link:hover {
    text-decoration: underline;
}

.typing-messages-wrapper {
    position: relative;
    max-width: 200px;
    margin: 0 20px 10px;
}

.typing-message::after {
    content: '...';
    position: relative;
    animation: blink 1.7s infinite;
    margin-left: 3px;
}

@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0; }
    100% { opacity: 1; }
}

.warning-box {
    background: #fff3cd;
    padding: 15px 20px;
    margin: 20px;
    border-left: 3px solid #ffc107;
    border-radius: 4px;
    font-size: 0.9rem;
    color: #856404;
}

.warning-box strong {
    color: #856404;
}

@media (max-width: 768px) {
    .main-container {
        margin-bottom: 20px;
    }
    .chat-header {
       position: relative;
    }
    
    .chat-header h1 {
        font-size: 1.5rem;
    }
    
    .chat-header .subtitle {
        font-size: 0.9rem;
    }
    
    .exhibition-info,
    .warning-box {
        margin: 10px;
        padding: 15px;
    }
    
    .input-container {
        padding: 15px;
    }
}