/* ==========================================================================
   Response Meta Information Styles
   ========================================================================== */

.response-meta-info {
    margin-top: 12px;
    padding: 6px 0;
    border-top: 1px solid #e9ecef;
    color: #6c757d;
    font-size: 11px;
    line-height: 1.3;
}

.response-meta-info small {
    font-family: system-ui, -apple-system, sans-serif;
    color: #868e96;
}

/* ==========================================================================
   Base Layout Styles
   ========================================================================== */

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-family-primary);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Main page specific styles */
body.main-page {
    height: 100vh;
    overflow: hidden;
}

/* ==========================================================================
   Navigation Components
   ========================================================================== */

.top-nav {
    background-color: #000000;
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 100px;
    box-sizing: border-box;
    background-image: url('images/EagleVisionHeader.png');
    background-size: cover;
    background-repeat: no-repeat;
}

.nav-content {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
}

.nav-button {
    background-color: transparent;
    border: 2px solid white;
    color: white;
    padding: 5px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s, color 0.3s;
}

.nav-button:hover {
    background-color: white;
    color: #000000;
}

/* ==========================================================================
   Main Layout Container
   ========================================================================== */

.app-container {
    display: flex;
    height: calc(100vh - 45px);
    margin-top: 50px;
    box-sizing: border-box;
    padding-top: 60px;
}

.sidebar {
    width: 250px;
    background-color: #f8f8f8;
    border-right: 1px solid #e0e0e0;
    overflow-y: auto;
    padding: 20px;
}

.sidebar h2 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
}

#sermonSearch {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

.sermon-list {
    display: flex;
    flex-direction: column;
}

.sermon-item {
    margin-bottom: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sermon-item label {
    font-size: 12px;
    cursor: pointer;
}

.chat-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background-color: white;
    overflow: hidden;
    height: 100%;
}

.chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    height: calc(100% - 45px);
}

.message {
    margin-bottom: 15px;
    padding: 15px;
    border-radius: 18px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    word-wrap: break-word;
    font-family: 'Georgia', serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
}

/* Note: .user-message and .assistant-message styles moved to custom.css for better organization */

.input-area {
    display: flex;
    padding: 10px;
    border-top: 1px solid #e0e0e0;
    width: 100%;
    box-sizing: border-box;
    background-color: white;
    align-items: center;
}

#userInput {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    resize: none;
    margin-right: 10px;
    max-height: 100px;
    overflow-y: auto;
}

#loadingIndicator {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    display: none;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    width: 100%;
    height: 100%;
    animation: spin 1s linear infinite;
}

/* Note: Spin animation moved to animations.css for shared use */

#sendButton, #resubmitButton {
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    white-space: nowrap;
}

#resubmitButton {
    background-color: #f0f0f0;
    color: #333;
    padding: 5px 10px;
    margin-left: 5px;
}

#resubmitButton:hover {
    background-color: #e0e0e0;
}

.citations {
    margin-top: 5px;
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    max-height: 100px;
    overflow-y: auto;
}

.citation-pill {
    background-color: #e0e0e0;
    border-radius: 10px;
    padding: 1px 6px;
    font-size: 0.7em;
    text-decoration: none;
    color: #333;
    transition: background-color 0.3s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.citation-pill:hover {
    background-color: #f0f0f0;
}

.welcome-message {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.welcome-content {
    flex: 1;
    overflow-y: hidden;
    padding-right: 15px;
}

.sample-prompts {
    margin-top: auto;
    padding-top: 20px;
}

.prompt-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    padding: 0;
    list-style-type: none;
}

.sample-prompts h2 {
    text-align: center;
    margin-bottom: 15px;
}

.prompt-item {
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.prompt-item:hover {
    background-color: #e0e0e0;
}

.error-message {
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    padding: 10px;
    margin-top: 10px;
}

.message.streaming {
    position: relative;
}

.message.streaming::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    background-color: #007bff;
    border-radius: 50%;
    animation: blink 1s infinite;
}

/* Note: Blink animation moved to animations.css for shared use */

.tabbed-interface {
    width: 100%;
    margin-top: 20px;
}

.tab-buttons {
    display: flex;
    border-bottom: 1px solid #ccc;
}

.tab-button, .semantic-search-tab {
    padding: 10px 20px;
    border: none;
    background-color: #f1f1f1;
    cursor: pointer;
    transition: background-color 0.3s;
}

.tab-button:hover {
    background-color: #ddd;
}

.tab-button.active {
    background-color: #fff;
    border: 1px solid #ccc;
    border-bottom: none;
    font-weight:bold;
}

.tab-contents {
    padding: 20px;
    border: 1px solid #ccc;
    border-top: none;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.semantic-search-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    table-layout: fixed;
}

.semantic-search-table th,
.semantic-search-table td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
    vertical-align: top;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.semantic-search-table th {
    background-color: #f2f2f2;
    font-weight: bold;
}

.semantic-search-table td div.expandable {
    max-height: 100px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
}

.semantic-search-table td div.expandable::after {
    content: '...';
    position: absolute;
    bottom: 0;
    right: 0;
    padding: 0 5px;
    background-color: inherit;
}

.semantic-search-table td div.expanded {
    max-height: none;
}

.semantic-search-table td div.expanded::after {
    display: none;
}

.semantic-search-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.semantic-search-table tr:hover {
    background-color: #f5f5f5;
}

.view-content-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 5px 10px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 12px;
    margin: 2px 2px;
    cursor: pointer;
    border-radius: 3px;
}

.content-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
}

.dialog-content {
    background-color: white;
    padding: 20px;
    border-radius: 5px;
    max-width: 80%;
    max-height: 80%;
    overflow-y: auto;
}

.close-dialog-btn {
    background-color: #f44336;
    color: white;
    border: none;
    padding: 5px 10px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 12px;
    margin-top: 10px;
    cursor: pointer;
    border-radius: 3px;
}

@media (max-width: 768px) {

    body{
        background-color:darkgoldenrod;
    }

    .app-container {
        flex-direction: column;
        height: 90vh;
        margin-top:0px;
        padding-top:0px;
    }

    .sidebar {
        display: none;
    }

    .chat-container {
        height: 100vh;
        padding-top:0px;        
    }

    .chat-messages{
        background-image: url('/images/EagleVision_MobileBG.png');
        background-position: center center;
        background-repeat: no-repeat;
        background-size: cover;
    }

    .prompt-grid {
        grid-template-columns: 1fr;
    }

    .header, .top-nav {
        display:none;
      }
      
    #homeButton{ display:none; }

    .welcome-message{
        display:none;
    }
    
}

@media (min-width: 768px) {
    .citations {
        column-count: 2;
        column-gap: 10px;
    }
}

@media (min-width: 1200px) {
    .citations {
        column-count: 3;
    }

    .chat-container {
        width: 90%;
        max-width: 1400px;
    }

    .assistant-message {
        max-width: 95%;
        width: 95%;
    }

    .user-message {
        max-width: 85%;
    }

    .welcome-message {
        padding: 15px;
    }

    .welcome-message h1 {
        font-size: 22px;
    }

    .welcome-message h2 {
        font-size: 18px;
    }

    .welcome-message p, .welcome-message ul {
        font-size: 14px;
    }
}

/* ==========================================================================
   Toggle Switch Components
   ========================================================================== */

.toggle-container {
    display: flex;
    align-items: center;
    margin: 10px 0;
    padding: 8px;
    background: #f0f0f0;
    border-radius: 4px;
}

.toggle {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 24px;
    margin-right: 10px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #2196F3;
}

input:checked + .slider:before {
    transform: translateX(16px);
}

.toggle-label {
    font-size: 14px;
    color: #333;
}