:root {
    --primary-color: #10a37f;
    --dark-color: #444654;
    --light-color: #f7f7f8;
    --border-color: #ddd;
    --user-msg-color: #e6f7ff;
    --ai-msg-color: #f5f5f5;
    --system-msg-color: #fffbe6;
    --error-color: #ff4d4f;
    --blog-bg-color: #f9f9f9;
    --blog-heading-color: #333;
    --blog-text-color: #444;
    --blog-quote-color: #666;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f9f9f9;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
}

/* Header and Navigation */
header {
    margin-bottom: 30px;
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.logo h1 {
    color: var(--primary-color);
    margin: 0;
    font-size: 2rem;
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
}

.main-nav a {
    text-decoration: none;
    color: var(--dark-color);
    font-weight: 500;
    padding: 5px 0;
    position: relative;
}

.main-nav a:hover {
    color: var(--primary-color);
}

.main-nav li.active a {
    color: var(--primary-color);
}

.main-nav li.active a::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
}

.language-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.language-selector label {
    font-weight: bold;
    font-size: 0.9rem;
}

.language-selector select {
    padding: 5px 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: white;
    font-size: 0.9rem;
}

#headerSubtitle {
    width: 100%;
    text-align: center;
    color: #666;
    margin-top: 15px;
}

/* Main Content */
main {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 30px;
}

.model-select {
    display: flex;
    align-items: center;
    padding: 15px;
    background-color: var(--light-color);
    border-bottom: 1px solid var(--border-color);
}

.model-select label {
    margin-right: 10px;
    font-weight: bold;
    flex-shrink: 0;
}

.model-select select {
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: white;
    flex: 1;
}

.chat-container {
    height: 450px;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: white;
}

.message {
    margin-bottom: 15px;
    padding: 10px 15px;
    border-radius: 8px;
    max-width: 85%;
    position: relative;
}

.message p {
    margin: 0;
    word-break: break-word;
}

.message.user {
    background-color: var(--user-msg-color);
    margin-left: auto;
    border-bottom-right-radius: 0;
}

.message.ai {
    background-color: var(--ai-msg-color);
    margin-right: auto;
    border-bottom-left-radius: 0;
}

.message.system {
    background-color: var(--system-msg-color);
    margin-left: auto;
    margin-right: auto;
    max-width: 95%;
    text-align: center;
}

.message.error {
    background-color: var(--error-color);
    color: white;
    margin-left: auto;
    margin-right: auto;
    max-width: 95%;
    text-align: center;
}

.message-input {
    display: flex;
    padding: 10px;
    border-top: 1px solid var(--border-color);
}

.message-input textarea {
    flex: 1;
    height: 60px;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    resize: none;
    font-family: inherit;
    font-size: 16px;
}

.message-input button {
    margin-left: 10px;
    padding: 0 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.message-input button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.actions {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    border-top: 1px solid var(--border-color);
}

.actions button {
    padding: 8px 15px;
    background-color: var(--dark-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

button:hover:not(:disabled) {
    opacity: 0.9;
}

/* Blog Article Styling */
.blog-article {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 25px;
    margin-bottom: 30px;
}

.blog-article h2 {
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.blog-article h3 {
    color: var(--blog-heading-color);
    margin-bottom: 5px;
    font-size: 1.5em;
}

.blog-article h4 {
    color: var(--blog-heading-color);
    margin: 20px 0 10px;
    font-size: 1.2em;
}

.article-meta {
    color: #777;
    font-style: italic;
    margin-bottom: 20px;
    font-size: 0.9em;
}

.article-content p {
    margin-bottom: 15px;
    color: var(--blog-text-color);
    line-height: 1.7;
}

.article-content blockquote {
    border-left: 3px solid var(--primary-color);
    padding-left: 15px;
    margin: 20px 0;
    color: var(--blog-quote-color);
    font-style: italic;
}

/* Footer Styling */
footer {
    background-color: #f5f5f5;
    border-radius: 8px;
    padding: 30px 20px 20px;
    margin-top: 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-column h4 {
    color: var(--dark-color);
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.footer-column ul {
    list-style: none;
}

.footer-column ul li {
    margin-bottom: 8px;
}

.footer-column a {
    text-decoration: none;
    color: #666;
}

.footer-column a:hover {
    color: var(--primary-color);
}

.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.social-link {
    display: inline-block;
    padding: 5px 10px;
    background-color: #eee;
    border-radius: 4px;
    text-decoration: none;
    color: #666;
    font-size: 0.9rem;
}

.social-link:hover {
    background-color: #ddd;
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    color: #888;
    font-size: 0.9em;
}

.copyright {
    margin-top: 5px;
    font-size: 0.85em;
}

/* Page Content Styling */
.page-content {
    padding: 30px;
}

.page-header {
    margin-bottom: 30px;
    text-align: center;
}

.page-header h2 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.page-section {
    margin-bottom: 30px;
}

.page-section h3 {
    color: var(--dark-color);
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.page-section p {
    margin-bottom: 15px;
}

.page-section ul {
    margin: 15px 0;
    padding-left: 20px;
}

.page-section li {
    margin-bottom: 8px;
}

/* Team Grid */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.team-member {
    text-align: center;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 8px;
}

.member-photo {
    width: 100px;
    height: 100px;
    background-color: #eee;
    border-radius: 50%;
    margin: 0 auto 15px;
}

.member-title {
    color: var(--primary-color);
    font-style: italic;
    margin-bottom: 10px;
}

/* Contact Info */
.contact-info {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    margin-top: 10px;
}

.contact-info p {
    margin-bottom: 8px;
}

/* Blog Page Styling */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.blog-card {
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    background-color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.blog-image {
    height: 150px;
    background-color: #eee;
}

.blog-content {
    padding: 20px;
}

.blog-card h3 {
    margin-bottom: 10px;
    color: var(--dark-color);
}

.blog-meta {
    font-size: 0.8rem;
    color: #777;
    margin-bottom: 10px;
}

.blog-excerpt {
    margin-bottom: 15px;
    font-size: 0.95rem;
    color: #555;
}

.read-more {
    display: inline-block;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
}

.read-more:hover {
    text-decoration: underline;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin-top: 30px;
}

.page-link {
    display: inline-block;
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: var(--dark-color);
}

.page-link.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.next-page {
    margin-left: 5px;
    text-decoration: none;
    color: var(--primary-color);
}

/* Terms Page */
.terms-section {
    margin-bottom: 30px;
}

.terms-section h3 {
    color: var(--dark-color);
    margin-bottom: 15px;
}

.terms-section p {
    margin-bottom: 15px;
}

.terms-section strong {
    font-weight: bold;
}

.loading-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    color: white;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 4px solid white;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.hidden {
    display: none;
}

/* Responsive styles */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .main-nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .message {
        max-width: 90%;
    }
    
    .chat-container {
        height: 350px;
    }
    
    .actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .actions button {
        width: 100%;
    }
    
    .page-content {
        padding: 20px 15px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .team-grid {
        grid-template-columns: 1fr;
    }
    
    .blog-grid {
        grid-template-columns: 1fr;
    }
}