/* ==========================
   MINT ESSENTIALS STYLESHEET
   ========================== */

/* Import Google Fonts - Using closest alternatives since Gilroy isn't on Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Bitter:wght@400;500;600;700&display=swap');

/* GENERAL RESET */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; /* Updated from Roboto */
    font-weight: 400;
    background-color: #f8f9fa; /* Updated from #f5f5f5 */
    color: #1a1a2e; /* Updated from #393b3d */
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.logo img {
    width: 50%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* ==========================
   DASHBOARD/APP SPECIFIC STYLES
   ========================== */

/* App container for dashboard */
.app-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: #ffffff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header styles */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.logo-container img {
    height: 50px;
    width: auto;
}

.title-container {
    flex-grow: 1;
    text-align: center;
}

.title-container h1 {
    color: #007b5f;
    font-size: 28px;
    margin: 0;
    font-family: 'Bitter', serif; /* Added from styles.css */
    font-weight: 600;
}

.title-container p {
    color: #6c757d;
    margin: 5px 0 0 0;
    font-size: 14px;
    font-family: 'Inter', sans-serif; /* Added from styles.css */
}

.user-info {
    text-align: right;
    font-size: 14px;
}

.user-info p {
    margin: 2px 0;
    color: #6c757d;
}

/* Card styles */
.card {
    background-color: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 123, 95, 0.08); /* Updated shadow color to mint */
}

/* How to use collapsible section */
.how-to-use {
    background-color: #f8f9fa;
    border-left: 4px solid #007b5f;
}

.collapsible {
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    padding: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.collapsible h2 {
    color: #007b5f;
    margin: 0;
    font-size: 18px;
    font-family: 'Bitter', serif; /* Added from styles.css */
    font-weight: 600;
}

.collapsible-icon {
    transition: transform 0.3s ease;
    color: #007b5f;
}

.collapsible.active .collapsible-icon {
    transform: rotate(180deg);
}

.content {
    overflow: hidden;
    transition: max-height 0.3s ease;
    max-height: 0;
    margin-top: 15px;
}

.content ul {
    margin: 0;
    padding-left: 20px;
    color: #495057;
    line-height: 1.6;
}

.content li {
    margin: 8px 0;
}

/* Controls */
.controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.selector-label {
    font-weight: 500;
    color: #495057;
    font-family: 'Inter', sans-serif; /* Added from styles.css */
}

/* Make both dropdowns have consistent styling */
#document-selector,
#response-length-selector {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background-color: white;
    color: #495057;
    min-width: 200px;
    font-family: 'Inter', sans-serif; /* Added from styles.css */
    font-size: 14px;
    transition: border-color 0.2s;
    cursor: pointer;
}

#document-selector:hover,
#response-length-selector:hover {
    border-color: #007b5f; /* Changed from #007b5f to mint */
}

#document-selector:focus,
#response-length-selector:focus {
    outline: none;
    border-color: #007b5f; /* Changed from #007b5f to mint */
    box-shadow: 0 0 0 2px rgba(0, 123, 95, 0.1); /* Changed to mint shadow */
}

.reset-btn {
    background-color: #007b5f; /* Changed from #007b5f to mint */
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-family: 'Inter', sans-serif; /* Added from styles.css */
    transition: background-color 0.2s;
}

.reset-btn:hover {
    background-color: #5a6268;
}

/* Chat container */
#chat-container {
    min-height: 400px;
    height: calc(100vh - 380px); /* Updated from fixed max-height */
    overflow-y: auto;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    background-color: #fafafa;
    margin-bottom: 180px; /* Updated from 20px */
}

/* Input loading states */
#user-input:disabled {
    background-color: #f0f0f0 !important;
    cursor: not-allowed !important;
    opacity: 0.7 !important;
}

#user-input:disabled::placeholder {
    color: #007b5f !important; /* Changed from #007b5f to mint */
    font-style: italic !important;
    opacity: 1 !important;
}

#send-button:disabled,
.btn-mic:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    background-color: #cccccc !important;
}

/* Loading indicator enhancement */
#loading {
    display: none;
    text-align: center;
    color: #007b5f; /* Changed from #007b5f to mint */
    font-weight: 500; /* Added from styles.css */
    font-style: italic;
    padding: 10px;
    font-family: 'Inter', sans-serif; /* Added from styles.css */
    animation: pulse 1.5s ease-in-out infinite; /* Added from styles.css */
}

/* Input container - Fixed at bottom */
.input-container {
    position: fixed; /* Changed from relative */
    bottom: 0;
    left: 0;
    right: 0;
    background-color: white;
    border-top: 1px solid #e9ecef;
    padding: 15px 20px; /* Updated padding */
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05); /* Added shadow */
    z-index: 100; /* Added z-index */
}

.input-wrapper {
    max-width: 1160px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.input-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

#user-input {
    flex: 1; /* Added from styles.css */
    padding: 10px 14px; /* Updated padding */
    border: 1px solid #ced4da;
    border-radius: 6px; /* Updated from 4px */
    font-size: 15px; /* Updated from 16px */
    box-sizing: border-box;
    font-family: 'Inter', sans-serif; /* Added from styles.css */
    background-color: #f8f9fa; /* Added from styles.css */
}

#user-input:focus {
    border-color: #007b5f;
    outline: none;
    background-color: white; /* Added from styles.css */
    box-shadow: 0 0 0 2px rgba(0, 123, 95, 0.1); /* Changed to mint */
}

#user-input::placeholder {
    color: #6c757d; /* Added from styles.css */
}

#send-button {
    background-color: #007b5f; /* Changed from #007b5f to mint */
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    transition: background-color 0.2s;
    height: 42px; /* Added from styles.css */
}

#send-button:hover {
    background-color: #00664d; /* Changed from #5a6268 to darker mint */
}

.btn-mic {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background-color 0.2s;
    height: 42px; /* Added from styles.css */
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
}

.btn-mic:hover {
    background-color: #5a6268;
}

.btn-mic.recording {
    background-color: #ff0a3c;
    animation: pulse 1.5s infinite;
}

.btn-mic svg {
    width: 18px;
    height: 18px;
}

.action-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 4px;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background-color: #007b5f;
    color: #ffffff;
}

.btn-primary:hover {
    background-color: #00664d;
}

.btn-secondary {
    background-color: #6c757d;
    color: #ffffff;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-tertiary {
    background-color: #ffa726;
    color: #ffffff;
}

.btn-tertiary:hover {
    background-color: #ff8c00;
}

.btn-warning {
    background-color: #dc3545;
    color: #ffffff;
}

.btn-warning:hover {
    background-color: #c82333;
}

.btn-icon {
    width: 16px;
    height: 16px;
}

#record-button.recording {
    background-color: #dc3545;
    animation: pulse 1.5s infinite;
}

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

/* Audio controls - inline below input */
.audio-controls {
    display: flex;
    align-items: center;
    gap: 30px;
    font-size: 14px;
    color: #495057;
    font-family: 'Inter', sans-serif;
    padding-left: 4px;
}

.audio-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #495057;
    font-family: 'Inter', sans-serif;
    white-space: nowrap; /* Added from styles.css */
}

.toggle-switch {
    position: relative;
    width: 44px; /* Updated from 40px */
    height: 24px; /* Updated from 20px */
    background-color: #ccc;
    border-radius: 24px; /* Updated */
    transition: background-color 0.3s;
}

.toggle-switch::before {
    content: '';
    position: absolute;
    width: 20px; /* Updated from 16px */
    height: 20px; /* Updated from 16px */
    border-radius: 50%;
    background-color: white;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); /* Added from styles.css */
}

#audio-toggle:checked + .toggle-switch {
    background-color: #007b5f;
}

#audio-toggle:checked + .toggle-switch::before {
    transform: translateX(20px);
}

.audio-source-selector {
    display: flex;
    gap: 20px; /* Updated from column layout */
    font-size: 14px; /* Updated from 13px */
    color: #495057;
    font-family: 'Inter', sans-serif;
}

.audio-source-selector label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.audio-source-selector input[type="radio"] {
    width: auto;
    margin: 0;
}

/* Voice Selection */
.voice-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.voice-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.voice-selector label {
    color: #495057;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
}

.voice-selector select {
    padding: 6px 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background-color: white;
    color: #495057;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.2s;
    cursor: pointer;
}

.voice-selector select:hover {
    border-color: #007b5f; /* Changed to mint */
}

.voice-selector select:focus {
    outline: none;
    border-color: #007b5f; /* Changed to mint */
    box-shadow: 0 0 0 2px rgba(0, 123, 95, 0.1); /* Changed to mint */
}

/* Speed control */
.speed-control {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #6c757d;
}

.speed-control input[type="range"] {
    width: 100px;
}

.speed-value {
    font-weight: 500;
    color: #495057;
    min-width: 30px;
}

/* ==========================
   ENHANCED CHAT MESSAGE STYLES
   ========================== */

/* Chat message formatting */
.bot-message {
    background-color: #f8f9fa;
    border-left: 4px solid #007b5f;
    padding: 20px;
    margin: 15px 0;
    border-radius: 8px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.7;
}

.user-message {
    background-color: #e3f2fd;
    border-right: 4px solid #007b5f;
    padding: 20px;
    margin: 15px 0;
    border-radius: 8px;
    text-align: right;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.7;
}

/* Message content container */
.message-content {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Comprehensive Markdown styling for bot messages */
.bot-message h1,
.bot-message h2,
.bot-message h3,
.bot-message h4,
.bot-message h5,
.bot-message h6 {
    color: #007b5f !important;
    margin: 20px 0 15px 0 !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
}

.bot-message h1 { 
    font-size: 1.8em !important; 
    border-bottom: 2px solid #007b5f;
    padding-bottom: 8px !important;
}
.bot-message h2 { 
    font-size: 1.5em !important; 
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 5px !important;
}
.bot-message h3 { 
    font-size: 1.3em !important; 
}
.bot-message h4 { 
    font-size: 1.2em !important; 
}
.bot-message h5 { 
    font-size: 1.1em !important; 
}
.bot-message h6 { 
    font-size: 1.05em !important;
    font-weight: 700 !important;
}

/* Strong emphasis */
.bot-message strong,
.bot-message b {
    color: #007b5f !important;
    font-weight: 700 !important;
}

/* Italic text */
.bot-message em,
.bot-message i {
    font-style: italic;
    color: #495057;
}

/* Links */
.bot-message a {
    color: #007b5f !important;
    text-decoration: underline;
}

.bot-message a:hover {
    color: #00664d !important;
}

/* Lists */
.bot-message ul,
.bot-message ol {
    margin: 15px 0 !important;
    padding-left: 25px !important;
    color: #495057;
}

.bot-message ul ul,
.bot-message ol ol,
.bot-message ul ol,
.bot-message ol ul {
    margin: 8px 0 !important;
}

.bot-message li {
    margin: 8px 0 !important;
    line-height: 1.5 !important;
}

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

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

/* Code styling */
.bot-message code {
    background-color: #f4f4f4 !important;
    color: #c7254e !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    font-family: 'Courier New', monospace !important;
    font-size: 0.9em !important;
}

/* Code blocks */
.bot-message pre {
    background-color: #f8f9fa !important;
    border: 1px solid #e9ecef !important;
    border-left: 4px solid #007b5f !important;
    border-radius: 6px !important;
    padding: 15px !important;
    margin: 15px 0 !important;
    overflow-x: auto !important;
    white-space: pre-wrap !important;
    word-wrap: break-word !important;
}

.bot-message pre code {
    background-color: transparent !important;
    color: #333333 !important;
    padding: 0 !important;
    font-size: 0.9em !important;
}

/* Blockquotes */
.bot-message blockquote {
    border-left: 4px solid #007b5f !important;
    background-color: #f8f9fa !important;
    padding: 12px 20px !important;
    margin: 15px 0 !important;
    border-radius: 4px !important;
    color: #666 !important;
    font-style: italic !important;
}

.bot-message blockquote p {
    margin: 0 !important;
}

/* Tables */
.bot-message table {
    border-collapse: collapse !important;
    width: 100% !important;
    margin: 15px 0 !important;
    background-color: white !important;
    border: 1px solid #e9ecef !important;
    border-radius: 4px !important;
    overflow: hidden !important;
}

.bot-message thead {
    background-color: #007b5f !important;
    color: white !important;
}

.bot-message th,
.bot-message td {
    border: 1px solid #e9ecef !important;
    padding: 10px !important;
    text-align: left !important;
}

.bot-message th {
    font-weight: 600 !important;
}

.bot-message tbody tr:hover {
    background-color: #f8f9fa !important;
}

/* Horizontal rules */
.bot-message hr {
    border: none !important;
    border-top: 2px solid #e9ecef !important;
    margin: 20px 0 !important;
}

/* Paragraphs */
.bot-message p {
    margin: 12px 0 !important;
    color: #495057;
    line-height: 1.6 !important;
}

/* First paragraph after a heading */
.bot-message h1 + p,
.bot-message h2 + p,
.bot-message h3 + p,
.bot-message h4 + p,
.bot-message h5 + p,
.bot-message h6 + p {
    margin-top: 8px !important;
}

/* Loading dots animation */
.loading-dots {
    display: inline-flex;
    gap: 4px;
}

.loading-dot {
    width: 8px;
    height: 8px;
    background-color: #007b5f;
    border-radius: 50%;
    animation: loading-bounce 1.4s infinite ease-in-out;
}

.loading-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dot:nth-child(2) {
    animation-delay: -0.16s;
}

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

/* Error message styling */
.error-message {
    background-color: #fee;
    border-left: 4px solid #dc3545;
    color: #721c24;
    padding: 15px;
    margin: 15px 0;
    border-radius: 4px;
    font-family: 'Inter', sans-serif;
}

.error-message strong {
    color: #dc3545;
}

/* Source citations - Added from styles.css */
.source-citation {
    display: inline-block;
    background-color: #e8f5f0; /* Light mint background */
    color: #007b5f; /* Mint text */
    padding: 2px 6px;
    margin: 0 2px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}

.source-citation:hover {
    background-color: #007b5f; /* Mint background on hover */
    color: white;
}

.sources-section {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 2px solid #e9ecef;
}

.sources-section h4 {
    color: #007b5f; /* Mint color */
    font-size: 16px;
    margin-bottom: 10px;
    font-weight: 600;
    font-family: 'Bitter', serif;
}

.source-list {
    list-style: none;
    padding-left: 0;
}

.source-item {
    background-color: #f8f9fa;
    border-left: 3px solid #007b5f; /* Mint border */
    padding: 10px 15px;
    margin: 8px 0;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
    transition: all 0.2s;
}

.source-item:hover {
    background-color: #e8f5f0; /* Light mint on hover */
    transform: translateX(2px);
}

.source-item a {
    color: #007b5f !important; /* Mint link color */
    text-decoration: none;
}

.source-item a:hover {
    text-decoration: underline;
}

.source-item .source-title {
    font-weight: 500;
    color: #333;
}

.source-item .source-snippet {
    color: #6c757d;
    font-size: 13px;
    margin-top: 4px;
    display: block;
}

/* Tooltips for sources */
.source-tooltip {
    position: relative;
    display: inline-block;
}

.source-tooltip .tooltip-text {
    visibility: hidden;
    background-color: #333;
    color: white;
    text-align: left;
    padding: 8px 10px;
    border-radius: 6px;
    position: absolute;
    z-index: 10;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    width: 200px;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.source-tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* History Modal Specific Styles */

/* History button styling */
.history-btn {
    background-color: #007b5f;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    transition: background-color 0.2s;
}

.history-btn:hover {
    background-color: #5a6268;
}

/* History Modal Styles */
.history-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.history-modal-content {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 40, 115, 0.15);
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.history-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #e9ecef;
    background-color: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.history-modal-header h3 {
    margin: 0;
    color: #007b5f;
    font-size: 18px;
    font-family: 'Bitter', serif;
    font-weight: 600;
}

.close-history-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #6c757d;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.close-history-btn:hover {
    background-color: #e9ecef;
    color: #495057;
}

.history-modal-body {
    padding: 20px 25px;
    overflow-y: auto;
    flex-grow: 1;
}

.history-loading {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 40px 20px;
    font-family: 'Inter', sans-serif;
}

.history-empty {
    text-align: center;
    color: #6c757d;
    padding: 40px 20px;
    font-family: 'Inter', sans-serif;
}

.history-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Individual history item */
.history-item {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.history-item:hover {
    box-shadow: 0 2px 8px rgba(0, 40, 115, 0.1);
}

.history-item-header {
    background-color: #f8f9fa;
    padding: 12px 15px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

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

.history-query {
    font-weight: 500;
    color: #495057;
    margin: 0;
    flex-grow: 1;
    margin-right: 15px;
    font-family: 'Inter', sans-serif;
}

.history-timestamp {
    font-size: 12px;
    color: #6c757d;
    white-space: nowrap;
    font-family: 'Inter', sans-serif;
}

.history-expand-icon {
    margin-left: 10px;
    transition: transform 0.3s ease;
    color: #6c757d;
}

.history-item.expanded .history-expand-icon {
    transform: rotate(180deg);
}

.history-item-content {
    padding: 15px;
    background-color: white;
    display: none;
}

.history-item.expanded .history-item-content {
    display: block;
}

.history-response {
    color: #495057;
    line-height: 1.6;
    margin-bottom: 10px;
    font-family: 'Inter', sans-serif;
}

/* Apply same markdown styling to history responses */
.history-response h1,
.history-response h2,
.history-response h3,
.history-response h4,
.history-response h5,
.history-response h6 {
    color: #007b5f !important;
    margin: 15px 0 10px 0 !important;
    font-weight: 600 !important;
    font-family: 'Bitter', serif !important;
}

.history-response strong,
.history-response b {
    color: #007b5f !important;
    font-weight: 700 !important;
}

.history-response ul,
.history-response ol {
    margin: 10px 0 !important;
    padding-left: 20px !important;
}

.history-response li {
    margin: 5px 0 !important;
    line-height: 1.5 !important;
}

.history-sources {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

.history-sources h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #007b5f;
    font-weight: 600;
    font-family: 'Bitter', serif;
}

.history-source-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.history-source-item {
    background-color: #f8f9fa;
    padding: 6px 10px;
    margin: 4px 0;
    border-radius: 4px;
    font-size: 13px;
    color: #495057;
    font-family: 'Inter', sans-serif;
}

.history-meta {
    display: flex;
    gap: 15px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
    font-size: 12px;
    color: #6c757d;
    font-family: 'Inter', sans-serif;
}

.history-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}


/* Settings Modal Specific Styles - Added from styles.css */
.settings-section {
    margin-bottom: 25px;
}

.settings-section h3 {
    color: #007b5f; /* Changed to mint */
    font-size: 16px;
    margin-bottom: 12px;
    font-weight: 600;
    font-family: 'Bitter', serif;
}

.settings-audio-selector {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 15px;
}

.settings-option {
    display: flex !important;
    align-items: center !important;
    flex-direction: row !important;
    gap: 12px !important;
    padding: 12px 15px !important;
    background-color: #f8f9fa;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: #495057;
}

.settings-option:hover {
    background-color: #e9ecef;
}

.settings-option input[type="radio"] {
    position: static !important;
    margin: 0 !important;
    width: 18px !important;
    height: 18px !important;
    flex-shrink: 0 !important;
    cursor: pointer;
    accent-color: #007b5f; /* Changed to mint */
}

.settings-option span {
    flex: 1 !important;
    display: block !important;
}

.settings-voice-section {
    margin-top: 20px;
}

.settings-voice-selector {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.settings-voice-option {
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-voice-option label {
    color: #495057;
    font-weight: 500;
    font-size: 14px;
    min-width: 80px;
}

.settings-voice-option select {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background-color: white;
    color: #495057;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.2s;
    cursor: pointer;
}

.settings-voice-option select:hover {
    border-color: #007b5f; /* Changed to mint */
}

.settings-voice-option select:focus {
    outline: none;
    border-color: #007b5f; /* Changed to mint */
    box-shadow: 0 0 0 2px rgba(0, 123, 95, 0.1); /* Changed to mint */
}

.settings-speed-control {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    background-color: #f8f9fa;
    border-radius: 6px;
    margin-top: 12px;
}

.settings-speed-control label {
    color: #495057;
    font-weight: 500;
    font-size: 14px;
    min-width: 80px;
}

.settings-speed-control input[type="range"] {
    flex: 1;
    accent-color: #007b5f; /* Changed to mint */
}

.settings-speed-value {
    font-weight: 600;
    color: #007b5f; /* Changed to mint */
    min-width: 35px;
    text-align: center;
}

/* Settings button icon-only style */
#settings-button {
    padding: 8px 10px;
    min-width: auto;
}

#settings-button .btn-icon {
    margin: 0;
}

/* ==========================
   LOGIN/REGISTRATION STYLES
   ========================== */

/* CENTERED CONTAINER */
.centered-container {
    text-align: center;
    max-width: 400px;
    background-color: #ffffff;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1);
}

.centered-container h1 {
    margin-bottom: 20px;
    color: #007b5f;
    font-size: 24px;
}

.centered-container p {
    color: #606b75;
    margin: 20px 0;
}

/* FORM STYLES */
form {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

input {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border: 1px solid #cbcbcb;
    border-radius: 5px;
    font-size: 16px;
    text-align: left;
    box-sizing: border-box;
}

input:focus {
    border-color: #007b5f;
    outline: none;
}

/* "Remember Me" - Proper Inline Alignment */
.remember-me-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-top: 10px;
    margin-bottom: 20px; /* Adds space before the Login button */
    font-size: 14px;
    color: #606b75;
}

/* Label for "Remember Me" */
.remember-me-container label {
    margin-right: 30px; /* Ensures spacing from the checkbox */
    white-space: nowrap;
}

/* Checkbox */
.remember-me-container input {
    width: 16px;
    height: 16px;
    margin: 0;
}

/* BUTTON STYLES */
.btn-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.text-link {
    color: #007b5f;
    text-decoration: none;
    font-size: 14px;
}

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

/* Google Sign-In Button */
.gsi-material-button {
  -moz-user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  -webkit-appearance: none;
  background-color: WHITE;
  background-image: none;
  border: 1px solid #747775;
  -webkit-border-radius: 4px;
  border-radius: 4px;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  color: #1f1f1f;
  cursor: pointer;
  font-family: 'Roboto', arial, sans-serif;
  font-size: 14px;
  height: 40px;
  letter-spacing: 0.25px;
  outline: none;
  overflow: hidden;
  padding: 0 12px;
  position: relative;
  text-align: center;
  -webkit-transition: background-color .218s, border-color .218s, box-shadow .218s;
  transition: background-color .218s, border-color .218s, box-shadow .218s;
  vertical-align: middle;
  white-space: nowrap;
  width: auto;
  max-width: 400px;
  min-width: min-content;
}

.gsi-material-button .gsi-material-button-icon {
  height: 20px;
  margin-right: 12px;
  min-width: 20px;
  width: 20px;
}

.gsi-material-button .gsi-material-button-content-wrapper {
  -webkit-align-items: center;
  align-items: center;
  display: flex;
  -webkit-flex-direction: row;
  flex-direction: row;
  -webkit-flex-wrap: nowrap;
  flex-wrap: nowrap;
  height: 100%;
  justify-content: space-between;
  position: relative;
  width: 100%;
}

.gsi-material-button .gsi-material-button-contents {
  -webkit-flex-grow: 1;
  flex-grow: 1;
  font-family: 'Roboto', arial, sans-serif;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: top;
}

.gsi-material-button .gsi-material-button-state {
  -webkit-transition: opacity .218s;
  transition: opacity .218s;
  bottom: 0;
  left: 0;
  opacity: 0;
  position: absolute;
  right: 0;
  top: 0;
}

.gsi-material-button:disabled {
  cursor: default;
  background-color: #ffffff61;
  border-color: #1f1f1f1f;
}

.gsi-material-button:disabled .gsi-material-button-contents {
  opacity: 38%;
}

.gsi-material-button:disabled .gsi-material-button-icon {
  opacity: 38%;
}

.gsi-material-button:not(:disabled):active .gsi-material-button-state, 
.gsi-material-button:not(:disabled):focus .gsi-material-button-state {
  background-color: #303030;
  opacity: 12%;
}

.gsi-material-button:not(:disabled):hover {
  -webkit-box-shadow: 0 1px 2px 0 rgba(60, 64, 67, .30), 0 1px 3px 1px rgba(60, 64, 67, .15);
  box-shadow: 0 1px 2px 0 rgba(60, 64, 67, .30), 0 1px 3px 1px rgba(60, 64, 67, .15);
}

.gsi-material-button:not(:disabled):hover .gsi-material-button-state {
  background-color: #303030;
  opacity: 8%;
}
/* Lightbox container */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 1000;
}

/* Help Lightbox specific styles */
#help-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 999;
}

.lightbox-content-wrapper {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 40, 115, 0.15);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.lightbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #e9ecef;
    background-color: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.lightbox-header h2 {
    margin: 0;
    color: #007b5f;
    font-size: 20px;
    font-family: 'Bitter', serif;
    font-weight: 600;
}

.lightbox-close-x {
    background: none;
    border: none;
    font-size: 28px;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.lightbox-close-x:hover {
    background-color: #e9ecef;
    color: #495057;
}

.lightbox-body {
    padding: 25px;
    overflow-y: auto;
    font-family: 'Inter', sans-serif;
}

.lightbox-body ul {
    margin: 0;
    padding-left: 20px;
    color: #495057;
    line-height: 1.8;
}

.lightbox-body li {
    margin: 12px 0;
}

.lightbox-body li strong {
    color: #007b5f;
    font-weight: 600;
}

/* Lightbox content */
.lightbox-content {
    background: #fff;
    width: 100%;
    height: calc(100% - 50px);
    overflow-y: auto;
    padding: 20px;
    text-align: left;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    font-family: 'Inter', sans-serif;
}

.lightbox-content h3 {
    color: #007b5f;
    font-family: 'Bitter', serif;
    font-weight: 600;
}

.lightbox-content h4 {
    color: #007b5f;
    font-family: 'Bitter', serif;
    font-weight: 500;
}

.lightbox-content h5 {
    color: #495057;
    font-family: 'Bitter', serif;
    font-weight: 500;
}

/* Close button */
.lightbox-close-btn {
    width: 100%;
    padding: 10px;
    background: #007b5f;
    color: white;
    font-weight: bold;
    border: none;
    cursor: pointer;
    text-align: center;
    border-radius: 0 0 8px 8px;
    font-family: 'Inter', sans-serif;
}

.lightbox-close-btn:hover {
    background: #5a6268;
}

.terms-link {
    font-size: 10px;
    text-align: center;
    display: block;
    margin-top: 10px;
    color: #007b5f;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
}

/* New Conversation Confirmation Modal Styles - Added from styles.css */
.confirmation-modal .modal-body {
    text-align: center;
    padding: 30px 25px;
}

.confirmation-modal .modal-body p {
    font-size: 16px;
    color: #495057;
    margin: 0;
    line-height: 1.6;
}

.confirmation-modal .modal-footer {
    justify-content: center;
    padding: 15px 25px;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 10px;
    background-color: #f8f9fa;
    border-radius: 0 0 8px 8px;
}

/* Modal Styles - Added from styles.css */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 123, 95, 0.15); /* Changed shadow to mint */
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #e9ecef;
    background-color: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.modal-header h2 {
    margin: 0;
    color: #007b5f; /* Changed to mint */
    font-size: 20px;
    font-family: 'Bitter', serif;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.modal-close:hover {
    background-color: #e9ecef;
    color: #495057;
}

.modal-body {
    padding: 25px;
    overflow-y: auto;
    font-family: 'Inter', sans-serif;
}

.modal-footer {
    padding: 15px 25px;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background-color: #f8f9fa;
    border-radius: 0 0 8px 8px;
}

.btn-cancel {
    background-color: #6c757d;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-cancel:hover {
    background-color: #5a6268;
}

.btn-confirm {
    background-color: #007b5f; /* Changed to mint */
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-confirm:hover {
    background-color: #00664d; /* Changed to darker mint */
}

/* ==========================
   RESPONSIVE DESIGN
   ========================== */

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    #document-selector {
        min-width: auto;
    }
    
    #chat-container {
        height: calc(100vh - 420px); /* Added from styles.css */
        margin-bottom: 180px; /* Added from styles.css */
    }
    
    .input-container {
        padding: 12px; /* Added from styles.css */
    }
    
    .input-row {
        gap: 6px; /* Added from styles.css */
        flex-wrap: wrap; /* Added from styles.css */
    }
    
    #send-button {
        padding: 10px 14px; /* Added from styles.css */
    }
    
    #send-button .btn-icon {
        display: none; /* Added from styles.css */
    }
    
    .btn-mic {
        padding: 8px 10px; /* Added from styles.css */
        font-size: 13px; /* Added from styles.css */
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .audio-controls {
        flex-wrap: wrap; /* Added from styles.css */
        gap: 12px; /* Added from styles.css */
    }
    
    .audio-source-selector {
        flex-direction: column; /* Changed from row */
        gap: 8px; /* Added from styles.css */
        width: 100%; /* Added from styles.css */
    }
    
    .audio-toggle {
        width: 100%; /* Added from styles.css */
        margin-left: 0 !important; /* Added from styles.css */
        margin-top: 10px; /* Added from styles.css */
        justify-content: center; /* Added from styles.css */
    }
    
    #settings-button {
        padding: 8px; /* Added from styles.css */
    }
    
    /* Mobile adjustments for bot messages */
    .bot-message {
        padding: 15px;
    }
    
    .bot-message h1 {
        font-size: 1.5em !important;
    }
    
    .bot-message h2 {
        font-size: 1.3em !important;
    }
    
    .bot-message h3 {
        font-size: 1.2em !important;
    }
}

/* ==========================
   FIXES ADDED FOR FRONTEND ISSUES
   Added by request - November 2024
   ========================== */

/* Fix for radio button alignment in Settings modal */
.settings-option input[type="radio"] {
    flex-shrink: 0 !important;
    align-self: center !important;
}