/* ==========================
   SKILL DYNAMICS 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; /* Gilroy alternative */
    font-weight: 400;
    background-color: #f8f9fa;
    color: #1a1a2e;
    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: #002873;
    font-size: 28px;
    margin: 0;
    font-family: 'Bitter', serif;
    font-weight: 600;
}

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

.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, 40, 115, 0.08);
}

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

.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: #002873;
    margin: 0;
    font-size: 18px;
    font-family: 'Bitter', serif;
    font-weight: 600;
}

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

.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;
}

/* 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;
    font-size: 14px;
    transition: border-color 0.2s;
    cursor: pointer;
}

#document-selector:hover,
#response-length-selector:hover {
    border-color: #002873;
}

#document-selector:focus,
#response-length-selector:focus {
    outline: none;
    border-color: #002873;
    box-shadow: 0 0 0 2px rgba(0, 40, 115, 0.1);
}

.reset-btn {
    background-color: #002873;
    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;
    transition: background-color 0.2s;
}

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

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

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

#user-input:disabled::placeholder {
    color: #002873 !important;
    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: #002873;
    font-weight: 500;
    font-style: italic;
    padding: 10px;
    font-family: 'Inter', sans-serif;
    animation: pulse 1.5s ease-in-out infinite;
}

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

.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;
    padding: 10px 14px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 15px;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    background-color: #f8f9fa;
}

#user-input:focus {
    border-color: #002873;
    outline: none;
    background-color: white;
    box-shadow: 0 0 0 2px rgba(0, 40, 115, 0.1);
}

#user-input::placeholder {
    color: #6c757d;
}

#send-button {
    background-color: #002873;
    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;
}

#send-button:hover {
    background-color: #001d52;
}

.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;
    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;
}

/* 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;
}

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

.toggle-switch::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    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);
}

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

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

.audio-source-selector {
    display: flex;
    gap: 20px;
    font-size: 14px;
    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: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
}

.audio-source-selector input[type="radio"]:checked {
    accent-color: #002873;
}

.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;
    font-family: 'Inter', sans-serif;
}

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

.btn-primary:hover {
    background-color: #001d52;
}

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

.btn-secondary:hover {
    background-color: #001d52;
}

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

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

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

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

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

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

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

/* Audio controls */
.audio-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.audio-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #495057;
    font-family: 'Inter', sans-serif;
}

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

.toggle-switch::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: white;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
}

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

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

.audio-source-selector {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 13px;
    color: #6c757d;
    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;
}

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

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

.user-message {
    background-color: rgba(255, 10, 60, 0.05);
    border-right: 4px solid #ff0a3c;
    padding: 20px;
    margin: 15px 0;
    border-radius: 8px;
    text-align: right;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", 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: #002873 !important;
    margin: 20px 0 15px 0 !important;
    font-family: 'Bitter', serif !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
}

.bot-message h1 { 
    font-size: 1.8em !important; 
    border-bottom: 2px solid #002873;
    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; 
}

/* Paragraph styling */
.bot-message p {
    margin: 15px 0 !important;
    color: #495057 !important;
    line-height: 1.7 !important;
}

.bot-message p:first-child {
    margin-top: 0 !important;
}

.bot-message p:last-child {
    margin-bottom: 0 !important;
}

/* Strong emphasis (bold) */
.bot-message strong,
.bot-message b {
    font-weight: 700 !important;
    color: #002873 !important;
}

/* Emphasis (italic) */
.bot-message em,
.bot-message i {
    font-style: italic !important;
    color: #495057 !important;
}

/* Lists styling - Enhanced */
.bot-message ul {
    margin: 15px 0 !important;
    padding-left: 25px !important;
    list-style-type: disc !important;
}

.bot-message ol {
    margin: 15px 0 !important;
    padding-left: 25px !important;
    list-style-type: decimal !important;
}

.bot-message li {
    margin: 10px 0 !important;
    line-height: 1.6 !important;
    color: #495057 !important;
}

.bot-message li strong,
.bot-message li b {
    color: #002873 !important;
    font-weight: 600 !important;
}

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

.bot-message ul ul {
    list-style-type: circle !important;
}

.bot-message ul ul ul {
    list-style-type: square !important;
}

/* Code styling */
.bot-message code {
    background-color: #f1f3f4 !important;
    padding: 3px 6px !important;
    border-radius: 4px !important;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace !important;
    font-size: 0.9em !important;
    color: #ff0a3c !important;
    border: 1px solid #e1e4e8 !important;
}

.bot-message pre {
    background-color: #f8f9fa !important;
    border: 1px solid #e9ecef !important;
    border-radius: 8px !important;
    padding: 20px !important;
    margin: 20px 0 !important;
    overflow-x: auto !important;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace !important;
    font-size: 0.85em !important;
    line-height: 1.5 !important;
}

.bot-message pre code {
    background: none !important;
    padding: 0 !important;
    color: #2d3748 !important;
    border: none !important;
    font-size: inherit !important;
}

/* Links */
.bot-message a {
    color: #002873 !important;
    text-decoration: none !important;
    border-bottom: 1px solid transparent !important;
    transition: border-bottom-color 0.2s !important;
}

.bot-message a:hover {
    border-bottom-color: #002873 !important;
}

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

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

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

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

.bot-message th {
    background-color: #f8f9fa !important;
    font-weight: 600 !important;
    color: #002873 !important;
    font-family: 'Bitter', serif !important;
}

.bot-message tr:nth-child(even) {
    background-color: #f8f9fa !important;
}

/* Horizontal rules */
.bot-message hr {
    border: none !important;
    height: 2px !important;
    background-color: #e9ecef !important;
    margin: 30px 0 !important;
}

/* Task lists (checkboxes) */
.bot-message input[type="checkbox"] {
    margin-right: 8px !important;
}

.bot-message li input[type="checkbox"] {
    margin-left: -20px !important;
    margin-right: 8px !important;
}

/* Document source info */
.document-info {
    font-size: 0.85em !important;
    color: #6c757d !important;
    font-style: italic !important;
    margin-bottom: 15px !important;
    padding: 10px 15px !important;
    background-color: #f8f9fa !important;
    border-radius: 4px !important;
    border: 1px solid #e9ecef !important;
    font-family: 'Inter', sans-serif !important;
}

/* Message actions (audio controls) */
.message-actions {
    margin-top: 20px !important;
    padding-top: 15px !important;
    border-top: 1px solid #e9ecef !important;
}

.audio-button {
    background-color: #002873 !important;
    color: white !important;
    border: none !important;
    padding: 10px 15px !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    font-size: 0.85em !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    transition: all 0.2s ease !important;
    font-family: 'Inter', sans-serif !important;
}

.audio-button:hover {
    background-color: #001d52 !important;
    transform: translateY(-1px) !important;
}

.audio-button.stop-button {
    background-color: #ff0a3c !important;
}

.audio-button.stop-button:hover {
    background-color: #e00030 !important;
}

.audio-icon {
    width: 14px !important;
    height: 14px !important;
}

/* Conversation divider */
.conversation-divider {
    text-align: center !important;
    margin: 30px 0 !important;
    position: relative !important;
}

.conversation-divider::before {
    content: '' !important;
    position: absolute !important;
    top: 50% !important;
    left: 0 !important;
    right: 0 !important;
    height: 1px !important;
    background-color: #dee2e6 !important;
}

.divider-label {
    background-color: #fafafa !important;
    padding: 8px 20px !important;
    color: #6c757d !important;
    font-size: 0.85em !important;
    position: relative !important;
    z-index: 1 !important;
    border-radius: 20px !important;
    border: 1px solid #dee2e6 !important;
    font-family: 'Inter', sans-serif !important;
}

/* Fix for any remaining formatting issues */
.bot-message * {
    max-width: 100% !important;
}

.bot-message img {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 4px !important;
    margin: 10px 0 !important;
}

/* History button styling */
.history-btn {
    background-color: #002873;
    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: #001d52;
}

/* 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: #002873;
    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: #002873 !important;
    margin: 15px 0 10px 0 !important;
    font-weight: 600 !important;
    font-family: 'Bitter', serif !important;
}

.history-response strong,
.history-response b {
    color: #002873 !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: #002873;
    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;
}

/* ==========================
   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, 40, 115, 0.1);
}

.centered-container h1 {
    margin-bottom: 20px;
    color: #002873;
    font-size: 24px;
    font-family: 'Bitter', serif;
    font-weight: 600;
}

.centered-container p {
    color: #606b75;
    margin: 20px 0;
    font-family: 'Inter', sans-serif;
}

/* 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;
    font-family: 'Inter', sans-serif;
}

input:focus {
    border-color: #002873;
    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;
    font-size: 14px;
    color: #606b75;
    font-family: 'Inter', sans-serif;
}

/* Label for "Remember Me" */
.remember-me-container label {
    margin-right: 30px;
    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: #002873;
    text-decoration: none;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
}

.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: 'Inter', 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: 'Inter', 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: #002873;
    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: #002873;
    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: #002873;
    font-family: 'Bitter', serif;
    font-weight: 600;
}

.lightbox-content h4 {
    color: #002873;
    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: #002873;
    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: #001d52;
}

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

/* ==========================
   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);
        margin-bottom: 180px;
    }
    
    .input-container {
        padding: 12px;
    }
    
    .input-row {
        gap: 6px;
    }
    
    #send-button {
        padding: 10px 14px;
    }
    
    #send-button .btn-icon {
        display: none;
    }
    
    .btn-mic {
        padding: 8px 10px;
        font-size: 13px;
    }
    
    .audio-controls {
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .audio-source-selector {
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }
    
    /* 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;
    }
/* ==========================
   SETTINGS MODAL STYLES
   Add these to your existing styles.css
   ========================== */

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

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

/* Adjusted audio toggle positioning when right-aligned */
.audio-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #495057;
    font-family: 'Inter', sans-serif;
    white-space: nowrap;
}

/* Remove the old audio-controls styles since they're no longer used */
.audio-controls {
    display: none;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .input-row {
        flex-wrap: wrap;
    }
    
    .audio-toggle {
        width: 100%;
        margin-left: 0 !important;
        margin-top: 10px;
        justify-content: center;
    }
    
    #settings-button {
        padding: 8px;
    }
}
    
}

/* ==========================
   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;
}

/* New Conversation Confirmation Modal Styles */
.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 {
    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, 40, 115, 0.15);
    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: #002873;
    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: #002873;
    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: #001d52;
}

/* History Modal Markdown Rendering Styles */
.history-response {
    color: #495057;
    line-height: 1.6;
    margin-bottom: 15px;
    padding: 15px;
    background-color: #fafafa;
    border-radius: 4px;
}

.history-response h1,
.history-response h2,
.history-response h3 {
    color: #002873;
    font-family: 'Bitter', serif;
    margin: 0.5em 0;
}

.history-response h1 {
    font-size: 1.8em;
}

.history-response h2 {
    font-size: 1.5em;
}

.history-response h3 {
    font-size: 1.3em;
}

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

.history-response li {
    margin: 5px 0;
    line-height: 1.6;
}

.history-response code {
    background-color: #f4f4f4;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.history-response pre {
    background-color: #f4f4f4;
    padding: 10px;
    border-radius: 5px;
    overflow-x: auto;
}

.history-response blockquote {
    border-left: 4px solid #002873;
    padding-left: 15px;
    margin: 10px 0;
    color: #666;
    font-style: italic;
}

.history-response table {
    border-collapse: collapse;
    width: 100%;
    margin: 10px 0;
}

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

.history-response th {
    background-color: #f2f2f2;
    font-weight: bold;
}

/* SETTINGS MODAL RADIO BUTTONS - FIXED */
.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: #002873;
}

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