body {
    font-family: 'Roboto', sans-serif; 
    background: #ffffff; 
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px; 
    box-sizing: border-box;
}

#main-container {
    width: 95%; 
    max-width: 1000px; 
    display: flex;
    gap: 20px;
    height: 90vh;
    max-height: 750px;
    box-sizing: border-box;
}

#chat-container {
    flex: 1;
    background-color: #ffffff; 
    border-radius: 16px; 
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15); 
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s ease-out; 
    border: 1px solid #e0e0e0; 
    box-sizing: border-box;
}

#sidebar {
    width: 300px;
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#sidebar-header {
    background-color: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
}

#sidebar-header h3 {
    margin: 0;
    font-size: 1.1em;
    font-weight: 500;
    color: #333;
}

#sidebar-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

#no-articles-message {
    color: #666;
    font-style: italic;
    text-align: center;
    margin-top: 20px;
}

#articles-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.article-item {
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: #f8f9fa;
    transition: all 0.2s ease;
}

.article-item:hover {
    border-color: #007bff;
    background-color: #f0f8ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
}

.article-item a {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
    line-height: 1.4;
    display: block;
}

.article-item a:hover {
    color: #0056b3;
    text-decoration: underline;
}

.article-item .article-meta {
    font-size: 0.8em;
    color: #666;
    margin-top: 8px;
}

#chat-header {
    background-color: #000000; 
    color: white;
    padding: 15px 20px;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

#bot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 15px;
    border: 2px solid white;
}

#chat-header h2 {
    margin: 0;
    font-size: 1.2em;
    font-weight: 500;
}

#chat-box {
    flex-grow: 1;
    padding: 20px; 
    overflow-y: auto;
    border-bottom: 1px solid #e0e0e0; 
    scrollbar-width: thin; 
    scrollbar-color: #000000 #f0f0f0; 
}

#chat-box::-webkit-scrollbar {
    width: 8px;
}
#chat-box::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 10px;
}
#chat-box::-webkit-scrollbar-thumb {
    background-color: #000000; 
    border-radius: 10px;
    border: 2px solid #f0f0f0;
}

.message {
    margin-bottom: 15px; 
    padding: 12px 18px; 
    border-radius: 20px; 
    line-height: 1.5; 
    max-width: 85%; 
    opacity: 0; 
    transform: translateY(10px); 
    animation: fadeInSlideUp 0.5s ease-out forwards;
    word-wrap: break-word;
}

@keyframes fadeInSlideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-message {
    background-color: #4A4A4A; 
    color: white;
    align-self: flex-end;
    margin-left: auto;
    text-align: left; 
    border-bottom-right-radius: 5px; 
}

.bot-message {
    background-color: #e9ecef; 
    color: #343a40; 
    align-self: flex-start;
    margin-right: auto;
    border-bottom-left-radius: 5px; 
}

.bot-message strong {
    display: block;
    margin-top: 8px; 
    font-weight: 500; 
    font-size: 0.9em;
    color: #495057; 
}

.bot-message ul {
    padding-left: 20px;
    margin-top: 8px;
    margin-bottom: 8px;
    list-style-type: disc; 
}
.bot-message li {
    margin-bottom: 5px;
}

#input-area {
    display: flex;
    flex-direction: column;
    align-items: stretch; 
    padding: 12px 15px; 
    background-color: #f8f9fa; 
    border-top: 1px solid #e0e0e0;
    gap: 10px;
}

#suggestions-area {
    display: flex;
    flex-wrap: wrap;
    gap: 8px; 
    padding: 10px 15px; 
    background-color: #f8f9fa; 
}

#province-selector-area {
    padding: 10px 15px 15px 15px;
    background-color: #f8f9fa;
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
}

.province-dropdown {
    width: 100%;
    padding: 10px;
    border-radius: 20px;
    border: 1px solid #ced4da;
    font-size: 0.95em;
    background-color: white;
    box-sizing: border-box; 
}
.province-dropdown:focus {
    border-color: #000000; 
    box-shadow: 0 0 0 0.2rem rgba(0, 0, 0, 0.25); 
    outline: none;
}

.suggestion-button {
    padding: 9px 14px; 
    border: 1px solid #000000; 
    border-radius: 20px; 
    background-color: #ffffff;
    color: #000000; 
    cursor: pointer;
    font-size: 0.9em; 
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.1s ease;
}

.suggestion-button:hover {
    background-color: #000000; 
    color: #ffffff;
    transform: translateY(-2px); 
}

.suggestion-button:active {
    transform: translateY(0px);
}

#user-input {
    width: 100%;
    padding: 12px 18px; 
    border: 1px solid #ced4da; 
    border-radius: 25px; 
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
    margin: 0;
}

#user-input:focus {
    border-color: #000000; 
    box-shadow: 0 0 0 0.2rem rgba(0, 0, 0, 0.25); 
    outline: none;
}

#send-button {
    width: 100%;
    padding: 12px 20px; 
    background-color: #000000; 
    color: white;
    border: none;
    border-radius: 25px; 
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background-color 0.2s ease, transform 0.1s ease;
    display: flex; 
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    margin: 0;
}

#send-button:hover {
    background-color: #333333; 
    transform: translateY(-1px); 
}

#send-button:active {
    transform: translateY(0px);
}

@media (max-width: 1200px) {
    #main-container {
        flex-direction: column;
        max-width: 600px;
    }
    
    #sidebar {
        width: 100%;
        height: 200px;
    }
}

@media (max-width: 600px) {
    body {
        padding: 0; 
        align-items: flex-start; 
    }
    #main-container {
        height: 100vh; 
        width: 100%;
        max-height: none;
        border-radius: 0; 
        box-shadow: none;
        gap: 0;
    }
    #chat-container {
        border-radius: 0; 
        box-shadow: none;
    }
    #sidebar {
        border-radius: 0;
        box-shadow: none;
        height: 150px;
    }
    #chat-header {
        padding: 12px 15px; 
        border-top-left-radius: 0;
        border-top-right-radius: 0;
    }
    #bot-avatar {
        width: 36px; 
        height: 36px;
        margin-right: 10px; 
    }
    #chat-header h2 {
        font-size: 1.1em; 
    }
    #province-selector-area, #suggestions-area {
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
    }
    .message {
        max-width: 90%; 
    }
    .suggestion-button {
        padding: 8px 12px;
        font-size: 0.85em; 
    }
    #chat-box {
        padding: 15px;
    }
    #input-area {
        padding: 10px;
    }
    #user-input, #send-button {
        font-size: 0.95rem;
    }
}

@media (max-width: 400px) {
    #input-area {
        padding: 8px;
        gap: 8px;
    }
    #user-input {
        padding: 10px 14px;
        font-size: 0.9rem;
    }
    #send-button {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
}

/* Source indicators */
.source-indicator {
    font-size: 0.8em;
    color: #666;
    margin-top: 5px;
    font-style: italic;
    padding: 2px 0;
}

/* Links in bot messages */
.bot-message a {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.bot-message a:hover {
    color: #0056b3;
    text-decoration: underline;
}

.bot-message a:visited {
    color: #6f42c1;
}

/* Blog post creation button */
.blog-post-button-container {
    margin-top: 10px;
}

.blog-post-button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.3s;
}

.blog-post-button:hover {
    background-color: #45a049;
}

.blog-post-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

/* Typing indicator */
.typing-indicator {
    opacity: 0.7;
}

.typing-dots {
    display: flex;
    gap: 4px;
    align-items: center;
}

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

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

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

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}