* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    background-color: #ffffff;
    color: #1a1a1a;
    height: 100vh;
    overflow: hidden;
}

.chat-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 100%;
    margin: 0 auto;
    background: #ffffff;
}

.chat-header {
    background: #00677F;
    color: #ffffff;
    padding: 0.8rem;
    text-align: center;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.chat-header h2 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.chat-header i {
    font-size: 1.2rem;
}

.messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem 0;
    scroll-behavior: smooth;
    background-color: #f8f9fa;
}

.message {
    padding: 1rem 1.5rem;
    margin: 0;
    line-height: 1.6;
    font-size: 1rem;
    max-width: none;
    width: 100%;
    border: none;
}

.message-content {
    margin: 0 auto;
    padding: 1.25rem;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    width: 80%;
}

.user-message .message-content {
    background-color: rgba(0, 103, 127, 0.05);
    margin-left: auto;
    margin-right: 1rem;
}

.assistant-message .message-content {
    background-color: #ffffff;
    margin-right: auto;
    margin-left: 1rem;
}

.input-container {
    border-top: 1px solid rgba(0,0,0,0.1);
    padding: 1.5rem;
    position: relative;
    background: #ffffff;
    flex-shrink: 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.input-wrapper {
    max-width: 48rem;
    margin: 0 auto;
    position: relative;
}

#message-input {
    width: 100%;
    min-height: 55px;
    max-height: 200px;
    padding: 14px 45px 14px 16px;
    font-size: 1rem;
    line-height: 1.5;
    color: #1a1a1a;
    background-color: #ffffff;
    border: 1px solid rgba(0, 103, 127, 0.2);
    border-radius: 12px;
    box-shadow: 0 0 10px rgba(0, 103, 127, 0.05);
    resize: none;
    overflow-y: auto;
    font-family: inherit;
    transition: all 0.2s ease;
}

#message-input:focus {
    outline: none;
    border-color: #00677F;
    box-shadow: 0 0 0 2px rgba(0, 103, 127, 0.2);
}

button {
    position: absolute;
    right: 10px;
    bottom: 15px;
    background: transparent;
    border: none;
    padding: 4px 8px;
    cursor: pointer;
    color: #00677F;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

button:hover:not(:disabled) {
    background-color: rgba(0, 103, 127, 0.1);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    color: #666;
}

#message-input:disabled {
    background-color: rgba(0, 103, 127, 0.02);
    border-color: rgba(0, 103, 127, 0.1);
    cursor: not-allowed;
}

.loading {
    display: inline-block;
    width: 25px;
    height: 25px;
    border: 4px solid rgba(0, 103, 127, 0.2);
    border-top: 4px solid #00677F;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

.loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    min-height: 40px;
}

/* Message text formatting */
.message-text {
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.message-text p {
    margin-bottom: 0.75rem;
}

.message-text p:last-child {
    margin-bottom: 0;
}

.message-text ul, .message-text ol {
    margin-left: 1.5rem;
    margin-bottom: 0.75rem;
}

/* Document list styling */
.document-separator {
    height: 1px;
    background-color: #ccc;
    margin: 15px 0;
    width: 100%;
}

.document-container {
    font-size: 0.7em;
    margin-top: 10px;
}

.document-intro {
    font-weight: 500;
    margin-bottom: 10px;
    color: #555;
}

.document-list {
    display: flex;
		flex-direction: row;
		align-items: stretch;
		flex-wrap: wrap;
    gap: 12px;
    margin-top: 10px;
}

.document-item {
    border-left: 3px solid #00677F;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    padding: 10px;
    background-color: rgba(0, 103, 127, 0.05);
    border-radius: 8px;
		width: 48%;
}

.document-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.document-item a {
    transition: color 0.2s ease;
}

.document-item a:hover {
    color: #004c5f;
    text-decoration: underline !important;
}

.document-title {
		font-size: 1.15em;
    margin: 0 0 8px 0;
    font-weight: 600;
    color: #00677F;
}

.document-page {
    font-size: 1em;
    font-weight: normal;
    color: #666;
}

.document-excerpt {
    line-height: 1.5;
    margin-bottom: 10px;
}

.document-link {
    display: flex;
    align-items: center;
    color: #00677F;
    text-decoration: none;
    font-weight: 500;
}

.document-icon {
    margin-right: 8px;
}

/* Metadata styling */
.metadata-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
		flex-direction: row-reverse;
    gap: 6px;
    margin-bottom: 10px;
}

.metadata-container span {
    display: inline-flex;
    align-items: center;
    transition: all 0.2s ease;
}

.metadata-container span:hover {
    transform: translateY(-1px);
}

.metadata-container i {
    margin-right: 4px;
}

.metadata-tag {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75em;
}

.metadata-type-tag {
    background-color: rgba(0, 103, 127, 0.2);
    font-weight: 500;
    color: #00677F;
}

.metadata-keyword-tag {
		display: none !important;
    background-color: rgba(0, 103, 127, 0.1);
    color: #666;
}

/* Documents section */
.documents {
    margin-top: 12px;
    border-top: 1px solid rgba(0, 103, 127, 0.1);
    padding-top: 8px;
}

.document-name {
    text-decoration: underline;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    .message-content {
        padding: 0.75rem 1rem;
    }

    .input-container {
        padding: 1rem;
    }

    #message-input {
        font-size: 16px; /* Prevent zoom on mobile */
    }
}

@media (max-width: 700px) {
    .message-content {
        width: calc(100% - 1rem);
        margin-left: 0.5rem;
        margin-right: 0.5rem;
    }
    
    .user-message .message-content {
        margin-left: 0.5rem;
        margin-right: 0.5rem;
    }
    
    .assistant-message .message-content {
        margin-left: 0.5rem;
        margin-right: 0.5rem;
    }
}

::selection {
    background-color: rgba(0, 103, 127, 0.2);
}

::-moz-selection {
    background-color: rgba(0, 103, 127, 0.2);
}

/* Email styling */
.email-separator {
    height: 1px;
    background-color: #ccc;
    margin: 15px 0;
    width: 100%;
}

.email-container {
    font-size: 0.85em;
    margin-top: 10px;
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.email-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
}

.email-icon {
    color: #00677F;
    font-size: 1.2em;
    margin-right: 8px;
}

.email-title {
    font-weight: 600;
    color: #00677F;
    font-size: 1.1em;
}

.email-subject {
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.email-content {
    line-height: 1.6;
    white-space: pre-wrap;
    color: #444;
    margin-bottom: 15px;
    padding: 10px;
    background-color: white;
    border-radius: 4px;
    border-left: 3px solid #00677F;
}

.email-copy-button {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #00677F;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 0.9em;
    cursor: pointer;
    transition: background-color 0.2s ease;
    width: 100%;
}

.email-copy-button:hover {
    background-color: #004c5f;
}

.email-copy-button i {
    margin-right: 6px;
}

/* Formatted text styling */
.message-text b {
    font-weight: 600;
}

.message-text i {
    font-style: italic;
}

.message-text u {
    text-decoration: underline;
}

.message-text code {
    font-family: monospace;
    background-color: rgba(0, 0, 0, 0.05);
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 0.9em;
}

.message-text a {
    color: #00677F;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.message-text a:hover {
    color: #004c5f;
}

.message-text ul {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.message-text li {
    margin-bottom: 0.25rem;
} 