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

/* Past Learning Designs Section */
#past-designs {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

#past-designs h2 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.designs-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.design-card {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    background-color: #fff;
}

.design-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.design-card h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #3498db;
    font-size: 18px;
}

.design-card p {
    margin-bottom: 10px;
    color: #666;
    font-size: 14px;
    line-height: 1.4;
}

.design-card .design-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #95a5a6;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.design-card .design-date {
    font-style: italic;
}

.loading-designs {
    text-align: center;
    padding: 20px;
    color: #666;
    font-style: italic;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    padding: 20px;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    flex-direction: column;
}

.container {
    width: 95%;
    margin: 0 auto;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 30px;
    position: relative;
    flex: 1;
    height: 90vh;
}

/* Language selector styles */
.language-selector {
    position: absolute;
    top: 20px;
    right: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 100;
}

.language-selector label {
    font-weight: 600;
    margin-bottom: 0;
}

.language-selector select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    font-size: 14px;
    cursor: pointer;
    margin-right: 5px;
}

.language-selector select:focus {
    outline: none;
    border-color: #3498db;
}

.language-btn, .apply-btn {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.language-btn:hover, .apply-btn:hover {
    background-color: #2980b9;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.header-content {
    text-align: center;
    flex: 1;
}

.auth-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
}

.auth-btn {
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.3s;
}

.login-btn {
    background-color: #3498db;
    color: white;
}

.login-btn:hover {
    background-color: #2980b9;
}

.register-btn {
    background-color: #2ecc71;
    color: white;
}

.register-btn:hover {
    background-color: #27ae60;
}

.logout-btn {
    background-color: #e74c3c;
    color: white;
}

.logout-btn:hover {
    background-color: #c0392b;
}

.user-greeting {
    margin-right: 10px;
    font-weight: 600;
    color: #2c3e50;
}

h1 {
    color: #2c3e50;
    margin-bottom: 10px;
}

h2, h3, h4 {
    color: #2c3e50;
    margin: 15px 0;
}

/* Form styles */
.input-section {
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.input-with-suggestions {
    display: flex;
    gap: 10px;
    margin-bottom: 5px;
}

input[type="text"] {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.suggest-btn {
    background-color: #95a5a6;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
    white-space: nowrap;
}

.suggest-btn:hover:not(:disabled) {
    background-color: #7f8c8d;
}

.suggest-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.loading-btn {
    position: relative;
    background-color: #adb5bd;
    cursor: wait;
}

.loading-btn::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: rgba(255, 255, 255, 0.2);
    animation: pulse 1.5s infinite;
}

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

.suggestions-container {
    display: none;
    margin-top: 5px;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    max-height: 200px;
    overflow-y: auto;
}

.suggestion-item {
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
    margin-bottom: 5px;
    transition: background-color 0.2s;
}

.suggestion-item:hover {
    background-color: #e9ecef;
}

.suggestion-item:last-child {
    margin-bottom: 0;
}

button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #2980b9;
}

#reset-btn {
    background-color: #95a5a6;
    margin-top: 20px;
}

#reset-btn:hover {
    background-color: #7f8c8d;
}

/* Results section */
#results {
    margin-top: 30px;
}

.results-header {
    text-align: center;
    margin: 10px 0 20px 0;
}

.results-info {
    font-size: 14px;
    color: #666;
    margin: 0;
    padding: 0;
}

.download-btn {
    background-color: #27ae60;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: background-color 0.3s;
}

.download-btn:hover {
    background-color: #219653;
}

.learning-types {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
}

.learning-card {
    flex: 1;
    min-width: 300px;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

#foundational {
    border-top: 5px solid #3498db;
    background: linear-gradient(to bottom, rgba(52, 152, 219, 0.1), transparent 70%);
    box-shadow: 0 3px 10px rgba(52, 152, 219, 0.2);
    position: relative;
}

#foundational::before {
    content: "🧠";
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
}

#transformative {
    border-top: 5px solid #e74c3c;
    background: linear-gradient(to bottom, rgba(231, 76, 60, 0.1), transparent 70%);
    box-shadow: 0 3px 10px rgba(231, 76, 60, 0.2);
    position: relative;
}

#transformative::before {
    content: "💡";
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
}

#social-emotional {
    border-top: 5px solid #2ecc71;
    background: linear-gradient(to bottom, rgba(46, 204, 113, 0.1), transparent 70%);
    box-shadow: 0 3px 10px rgba(46, 204, 113, 0.2);
    position: relative;
}

#social-emotional::before {
    content: "👥";
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
}

.subtitle {
    font-style: italic;
    color: #7f8c8d;
    margin-bottom: 5px;
}

.detailed-view-note {
    font-size: 14px;
    color: #95a5a6;
    margin-top: 5px;
}

.detailed-view-note a {
    color: #3498db;
    text-decoration: none;
}

.detailed-view-note a:hover {
    text-decoration: underline;
}

.definition {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.content-list {
    padding-left: 20px;
    margin-bottom: 15px;
}

.content-list li {
    margin-bottom: 8px;
}

.metrics {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
}

pre.xapi-examples {
    background-color: #f1f1f1;
    padding: 10px;
    border-radius: 4px;
    overflow-x: auto;
    font-size: 12px;
    margin-top: 10px;
}

/* xAPI related styles */
.xapi-actions {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed #ddd;
}

.try-xapi-btn {
    background-color: #95a5a6;
    padding: 8px 15px;
    font-size: 14px;
}

.try-xapi-btn:hover {
    background-color: #7f8c8d;
}

.xapi-status {
    display: inline-block;
    margin-left: 10px;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 14px;
}

.xapi-status.success {
    background-color: #dff0d8;
    color: #3c763d;
}

.xapi-status.error {
    background-color: #f2dede;
    color: #a94442;
}

/* Integrated Tabs */
.integrated-tabs {
    margin-top: 30px;
    margin-bottom: 30px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    background-color: #f8f9fa;
}

.tab-btn {
    background-color: transparent;
    border: none;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #666;
    transition: all 0.3s ease;
    flex: 1;
    text-align: center;
}

.tab-btn:hover {
    background-color: #e9ecef;
}

.tab-btn.active {
    background-color: #3498db;
    color: white;
}

.tab-content {
    position: relative;
    padding: 20px;
    width: 95%;
    margin: 0 auto;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    height: 70vh;
    overflow-y: auto;
}

.tab-pane h3 {
    margin-top: 0;
    color: #2c3e50;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

/* Flipped Learning Cards */
#pre-class {
    border-top: 5px solid #9b59b6;
    background: linear-gradient(to bottom, rgba(155, 89, 182, 0.1), transparent 70%);
    box-shadow: 0 3px 10px rgba(155, 89, 182, 0.2);
    position: relative;
}

#pre-class::before {
    content: "📚";
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
}

#in-class {
    border-top: 5px solid #f39c12;
    background: linear-gradient(to bottom, rgba(243, 156, 18, 0.1), transparent 70%);
    box-shadow: 0 3px 10px rgba(243, 156, 18, 0.2);
    position: relative;
}

#in-class::before {
    content: "👨‍🏫";
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
}

#post-class {
    border-top: 5px solid #1abc9c;
    background: linear-gradient(to bottom, rgba(26, 188, 156, 0.1), transparent 70%);
    box-shadow: 0 3px 10px rgba(26, 188, 156, 0.2);
    position: relative;
}

#post-class::before {
    content: "✅";
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
}

/* Assessment Cards */
#formative {
    border-top: 5px solid #16a085;
    background: linear-gradient(to bottom, rgba(22, 160, 133, 0.1), transparent 70%);
    box-shadow: 0 3px 10px rgba(22, 160, 133, 0.2);
    position: relative;
}

#formative::before {
    content: "📝";
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
}

#summative {
    border-top: 5px solid #8e44ad;
    background: linear-gradient(to bottom, rgba(142, 68, 173, 0.1), transparent 70%);
    box-shadow: 0 3px 10px rgba(142, 68, 173, 0.2);
    position: relative;
}

#summative::before {
    content: "🎯";
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
}

#growth {
    border-top: 5px solid #27ae60;
    background: linear-gradient(to bottom, rgba(39, 174, 96, 0.1), transparent 70%);
    box-shadow: 0 3px 10px rgba(39, 174, 96, 0.2);
    position: relative;
}

#growth::before {
    content: "📈";
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
}

/* Results Tabs Container (keeping for backward compatibility) */
.results-tabs-container {
    display: none;
}

.task-analysis-content {
    line-height: 1.6;
    font-size: 16px;
    height: 65vh;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 5px;
    background-color: #f9f9f9;
}

/* Markdown styles for task analysis */
.task-analysis-content h1,
.task-analysis-content h2,
.task-analysis-content h3,
.task-analysis-content h4,
.task-analysis-content h5,
.task-analysis-content h6 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    color: #2c3e50;
}

.task-analysis-content h1 {
    font-size: 1.8em;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.3em;
}

.task-analysis-content h2 {
    font-size: 1.5em;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.3em;
}

.task-analysis-content h3 {
    font-size: 1.3em;
}

.task-analysis-content h4 {
    font-size: 1.1em;
}

.task-analysis-content p {
    margin-bottom: 1em;
}

.task-analysis-content ul,
.task-analysis-content ol {
    margin-bottom: 1em;
    padding-left: 2em;
}

.task-analysis-content li {
    margin-bottom: 0.5em;
}

.task-analysis-content blockquote {
    border-left: 4px solid #ddd;
    padding-left: 1em;
    color: #666;
    margin-left: 0;
    margin-right: 0;
}

.task-analysis-content code {
    background-color: #f5f5f5;
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: monospace;
}

.task-analysis-content pre {
    background-color: #f5f5f5;
    padding: 1em;
    border-radius: 5px;
    overflow-x: auto;
    margin-bottom: 1em;
}

.task-analysis-content pre code {
    background-color: transparent;
    padding: 0;
}

.task-analysis-content table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 1em;
}

.task-analysis-content th,
.task-analysis-content td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

.task-analysis-content th {
    background-color: #f5f5f5;
}

.task-analysis-content tr:nth-child(even) {
    background-color: #f9f9f9;
}

.results-tabs-container .close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    color: #95a5a6;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.task-analysis-popup .close-btn:hover {
    background-color: #f8f9fa;
    color: #7f8c8d;
}

.popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

/* Status Bar */
.status-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #2c3e50;
    color: white;
    padding: 8px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    flex-wrap: wrap;
    font-size: 14px;
}

.status-bar-left {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 150px;
}

.status-bar-center {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
}

.status-bar-language {
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 1;
    justify-content: center;
}

.status-bar-language label {
    font-weight: 600;
    margin-bottom: 0;
    white-space: nowrap;
}

.status-bar-language select {
    padding: 4px 8px;
    border: 1px solid #1a2530;
    border-radius: 4px;
    background-color: #34495e;
    color: white;
    font-size: 13px;
    cursor: pointer;
}

.status-bar-language select:focus {
    outline: none;
    border-color: #3498db;
}

.status-bar-language button {
    background-color: transparent;
    color: white;
    border: none;
    padding: 4px;
    font-size: 14px;
    cursor: pointer;
}

.status-bar-right {
    display: flex;
    gap: 8px;
    flex: 1;
    justify-content: flex-end;
}

.status-bar-button {
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.save-btn {
    background-color: #3498db;
    color: white;
}

.save-btn:hover {
    background-color: #2980b9;
}

.download-btn-status {
    background-color: #27ae60;
    color: white;
}

.download-btn-status:hover {
    background-color: #219653;
}

.logout-btn-status {
    background-color: #e74c3c;
    color: white;
}

.logout-btn-status:hover {
    background-color: #c0392b;
}

/* Utility classes */
.hidden {
    display: none;
}

#loading {
    text-align: center;
    padding: 20px;
    font-style: italic;
}

/* Add padding to the bottom of the container to account for the status bar */
.container {
    padding-bottom: 60px;
}

/* Chat Interface */
.chat-interface {
    position: fixed;
    bottom: 60px;
    right: 20px;
    width: 350px;
    height: 500px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    overflow: hidden;
}

.chat-interface.hidden {
    display: none;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background-color: #3498db;
    color: white;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.chat-header h3 {
    margin: 0;
    font-size: 16px;
}

.close-chat-btn {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background-color: #f8f9fa;
    display: flex;
    flex-direction: column;
}

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

.chat-message.user {
    background-color: #3498db;
    color: white;
    align-self: flex-end;
}

.chat-message.ai {
    background-color: #e9ecef;
    color: #333;
    align-self: flex-start;
}

/* Markdown formatting within chat messages */
.chat-message h1,
.chat-message h2,
.chat-message h3,
.chat-message h4,
.chat-message h5,
.chat-message h6 {
    margin-top: 1em;
    margin-bottom: 0.5em;
    font-weight: 600;
    line-height: 1.25;
    color: inherit;
    clear: both;
}

.chat-message h1 {
    font-size: 1.6em;
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 0.3em;
    margin-top: 1.2em;
}

.chat-message h2 {
    font-size: 1.4em;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 0.3em;
    margin-top: 1.1em;
}

.chat-message h3 {
    font-size: 1.2em;
    margin-top: 1em;
}

.chat-message h4 {
    font-size: 1.1em;
}

.chat-message h5, .chat-message h6 {
    font-size: 1em;
}

.chat-message p {
    margin-top: 0;
    margin-bottom: 1em;
    line-height: 1.5;
}

.chat-message ul,
.chat-message ol {
    margin-top: 0.2em;
    margin-bottom: 1em;
    padding-left: 2em;
    line-height: 1.5;
}

.chat-message ul {
    list-style-type: disc;
}

.chat-message ol {
    list-style-type: decimal;
}

.chat-message li {
    margin-bottom: 0.4em;
}

.chat-message li > ul,
.chat-message li > ol {
    margin-top: 0.4em;
    margin-bottom: 0;
}

.chat-message ul ul,
.chat-message ul ol,
.chat-message ol ul,
.chat-message ol ol {
    margin-bottom: 0;
}

.chat-message blockquote {
    margin: 1em 0;
    padding: 0.5em 1em;
    color: #555;
    background-color: rgba(0, 0, 0, 0.03);
    border-left: 0.25em solid #dfe2e5;
    border-radius: 0 3px 3px 0;
}

.chat-message pre {
    margin-top: 0;
    margin-bottom: 1em;
    padding: 1em;
    overflow: auto;
    font-size: 0.9em;
    line-height: 1.5;
    background-color: #f6f8fa;
    border-radius: 4px;
    border: 1px solid #eaecef;
    white-space: pre-wrap;
}

.chat-message code {
    padding: 0.2em 0.4em;
    margin: 0;
    font-size: 0.9em;
    background-color: rgba(27, 31, 35, 0.05);
    border-radius: 3px;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    word-break: break-word;
}

.chat-message pre code {
    padding: 0;
    margin: 0;
    font-size: 100%;
    word-break: normal;
    white-space: pre;
    background: transparent;
    border: 0;
    overflow-x: auto;
    display: block;
}

.chat-message table {
    margin-top: 0;
    margin-bottom: 1em;
    border-spacing: 0;
    border-collapse: collapse;
    width: 100%;
    overflow: auto;
    display: block;
    max-width: 100%;
}

.chat-message table th {
    font-weight: 600;
    padding: 8px 13px;
    border: 1px solid #dfe2e5;
    background-color: #f6f8fa;
}

.chat-message table td {
    padding: 8px 13px;
    border: 1px solid #dfe2e5;
}

.chat-message table tr {
    background-color: #fff;
    border-top: 1px solid #c6cbd1;
}

.chat-message table tr:nth-child(2n) {
    background-color: #f6f8fa;
}

.chat-message img {
    max-width: 100%;
    box-sizing: content-box;
    background-color: #fff;
    border-radius: 4px;
    margin: 1em 0;
}

.chat-message hr {
    height: 0.25em;
    padding: 0;
    margin: 1.5em 0;
    background-color: #e1e4e8;
    border: 0;
}

.chat-message a {
    color: #0366d6;
    text-decoration: none;
    font-weight: 500;
}

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

/* Special styling for user messages (blue background) */
.chat-message.user {
    color: white;
}

.chat-message.user h1,
.chat-message.user h2,
.chat-message.user h3,
.chat-message.user h4,
.chat-message.user h5,
.chat-message.user h6 {
    color: white;
    border-bottom-color: rgba(255, 255, 255, 0.2);
}

.chat-message.user a {
    color: #ffffff;
    text-decoration: underline;
}

.chat-message.user code {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.chat-message.user pre {
    background-color: rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.2);
}

.chat-message.user pre code {
    color: white;
}

.chat-message.user blockquote {
    border-left: 0.25em solid rgba(255, 255, 255, 0.5);
    color: rgba(255, 255, 255, 0.9);
    background-color: rgba(0, 0, 0, 0.1);
}

.chat-message.user table th {
    background-color: rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.2);
}

.chat-message.user table td {
    border-color: rgba(255, 255, 255, 0.2);
}

.chat-message.user table tr {
    background-color: transparent;
    border-top-color: rgba(255, 255, 255, 0.2);
}

.chat-message.user table tr:nth-child(2n) {
    background-color: rgba(0, 0, 0, 0.1);
}

.chat-message.user hr {
    background-color: rgba(255, 255, 255, 0.3);
}

.chat-input-container {
    display: flex;
    padding: 10px;
    border-top: 1px solid #ddd;
}

.chat-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: none;
    font-family: inherit;
    font-size: 14px;
    min-height: 40px;
    max-height: 120px;
    overflow-y: auto;
}

.chat-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.chat-send-btn {
    margin-left: 8px;
    padding: 8px 15px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-send-btn:hover {
    background-color: #2980b9;
}

/* Typing indicator animation */
.typing-indicator {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin: 5px 0;
}

.typing-indicator span {
    height: 8px;
    width: 8px;
    background-color: #999;
    border-radius: 50%;
    display: inline-block;
    margin: 0 2px;
    animation: typing 1.4s infinite ease-in-out;
}

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

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

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
    100% { transform: translateY(0); }
}

/* Elaborate Popup Styles */
.elaborate-popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    max-width: 800px;
    height: 90vh;
    max-height: 900px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    z-index: 100000;
    overflow: hidden;
    flex-direction: column;
    padding: 0;
}

.elaborate-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.elaborate-popup-title {
    font-size: 18px;
    font-weight: bold;
    margin: 0;
    flex-grow: 1;
}

.elaborate-popup-save {
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    margin-right: 10px;
    cursor: pointer;
    font-size: 14px;
}

.elaborate-popup-save:hover {
    background-color: #218838;
}

.elaborate-popup-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #6c757d;
    margin-left: 10px;
}

.elaborate-popup-tabs {
    display: flex;
    background-color: #f0f0f0;
    border-bottom: 1px solid #ddd;
}

.elaborate-popup-tab {
    padding: 10px 15px;
    cursor: pointer;
    border-right: 1px solid #ddd;
    background-color: #f0f0f0;
    transition: background-color 0.3s;
}

.elaborate-popup-tab.active {
    background-color: #fff;
    border-bottom: 2px solid #007bff;
    font-weight: bold;
}

.elaborate-popup-tab:hover:not(.active) {
    background-color: #e9e9e9;
}

.elaborate-popup-content {
    padding: 20px;
    overflow-y: auto;
    flex-grow: 1;
    line-height: 1.6;
    height: calc(100% - 110px); /* Subtract header and tabs height */
    box-sizing: border-box;
    display: none;
}

.elaborate-popup-content.active {
    display: block;
}

.elaborate-popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 99999;
}

.elaborate-popup-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.elaborate-popup-loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 2s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Additional elaborate popup related styles */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 4px;
    margin-bottom: 10px;
}

.chat-input-container {
    display: flex;
    margin-top: 10px;
}

.chat-input {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: none;
}

.chat-send-btn {
    padding: 10px 15px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    margin-left: 10px;
    cursor: pointer;
}

.chat-message {
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 4px;
    max-width: 80%;
}

.chat-message.user {
    background-color: #007bff;
    color: white;
    align-self: flex-end;
    margin-left: auto;
}

.chat-message.ai {
    background-color: #e9e9e9;
    color: #333;
    align-self: flex-start;
}

.more-details-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.more-details-input-container {
    margin-bottom: 20px;
}

.more-details-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
    font-size: 14px;
    margin-bottom: 10px;
}

.more-details-submit-btn {
    padding: 10px 15px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.more-details-submit-btn:hover {
    background-color: #0069d9;
}

.more-details-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 4px;
    min-height: 200px;
}
