/* General Styling - Anchored Times Blog (From ATM_index.html) */
body {
    font-family: Georgia, 'Times New Roman', Times, serif;
    line-height: 1.7;
    background-color: #f4f4f4;
    color: #333;
    margin: 0;
    padding: 0;
}

.main-header {
    background-color: #003366; /* Dark blue header */
    color: #ffffff;
    padding: 15px 30px;
    border-bottom: 4px solid #0055aa;
}

.logo-title {
    display: flex;
    /* justify-content: space-between; Applied via chat integration */
    align-items: center;
    margin-bottom: 10px;
}

/* Added from chat version for layout */
.logo-title-text {
    display: flex;
    align-items: center;
}

.logo-placeholder { /* Style from ATM_index.html */
    display: inline-block;
    /* width: 40px; Use auto from ATM */
    height: 40px;
    /* border: 1px solid #fff; From ATM */
    margin-right: 15px;
    text-align: center;
    line-height: 40px;
    font-size: 2.0em; /* Adjusted for anchor */
    font-family: sans-serif; /* From ATM */
    /* background-color: #eee; From ATM */
    color: #ffffff; /* White anchor */
    flex-shrink: 0;
}

.main-header h1 {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 2.0em; /* Slightly smaller */
    font-weight: normal;
    line-height: 1.1; /* Added from chat version */
}

.subtitle {
    /* margin: -5px 0 15px 55px; Adjusted below */
    font-style: italic;
    font-size: 0.9em;
    color: #cccccc;
    margin-top: -5px; /* From chat version */
    margin-bottom: 15px; /* From chat version */
    /* margin-left: 55px; Removed */
}

/* Navigation (From ATM_index.html) */
.main-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    background-color: #e9e9e9;
    border-top: 1px solid #ccc;
    border-bottom: 1px solid #ccc;
}

.main-nav li {
    margin: 0;
}

.main-nav a { /* Applies to nav-link */
    display: block;
    padding: 10px 15px; /* Adjust padding */
    text-decoration: none;
    color: #003366;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 0.95em; /* Slightly smaller */
    border-right: 1px solid #ccc;
    transition: background-color 0.2s ease;
    cursor: pointer; /* Indicate interactivity */
}

.main-nav a:hover,
.main-nav a.active { /* Style for the active link */
    background-color: #d0d0d0;
    color: #000;
    font-weight: bold;
}

.main-nav li:last-child a {
    border-right: none;
}

/* Main Content Area (From ATM_index.html) */
.content-area {
    max-width: 900px;
    margin: 25px auto; /* Slightly less margin */
    padding: 15px 25px; /* Adjust padding */
    background-color: #ffffff;
    border: 1px solid #ccc;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Page Section Styling (Combined) */
.page-section {
    display: none; /* Hidden by default (JS handles visibility) */
    animation: fadeIn 0.5s ease-in-out; /* Simple fade-in */
    margin-bottom: 30px; /* Added spacing */
}

.page-section.active {
    display: block; /* Shown when active */
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}


/* Content Elements Styling (From ATM_index.html) */
.page-section h2, .page-section h3 {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #003366;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 5px;
    margin-top: 20px;
    margin-bottom: 15px;
    font-weight: normal;
}

.page-section h2 {
    font-size: 1.7em;
}

.page-section h3 {
    font-size: 1.3em;
}

.page-section p {
    margin-bottom: 1.2em;
    text-align: justify;
}

.page-section ul, .page-section ol {
    margin-left: 25px;
    margin-bottom: 1.2em;
}
 .page-section ul { list-style: disc; }
 .page-section ol { list-style: decimal; }


.page-section li {
    margin-bottom: 0.6em;
}

/* Scripture Quote Styling (From ATM_index.html) */
.scripture-quote {
    border-left: 4px solid #0055aa;
    margin: 20px 0 20px 30px; /* Indentation */
    padding: 10px 20px;
    background-color: #f9f9f9;
    font-style: italic;
    color: #555;
}

.scripture-quote cite {
    display: block;
    margin-top: 10px;
    font-style: normal;
    text-align: right;
    font-size: 0.9em;
    color: #003366;
}

/* Blog Post Excerpt Simulation (From ATM_index.html) */
.blog-excerpt {
    border: 1px solid #e0e0e0;
    padding: 15px;
    margin-bottom: 20px;
    background-color: #fdfdfd;
}
.blog-excerpt h3 {
    margin-top: 0;
    font-size: 1.2em;
    border-bottom: 1px dotted #ccc;
}
.blog-excerpt .read-more { /* Also applies to .fake-link */
    display: block;
    text-align: right;
    font-weight: bold;
    color: #0055aa;
    text-decoration: none;
    font-size: 0.9em;
    cursor: pointer; /* Indicate interactivity */
}
.blog-excerpt .read-more:hover {
    text-decoration: underline;
}
.blog-excerpt .post-meta {
    font-size: 0.8em;
    color: #777;
    margin-top: 10px;
    border-top: 1px dotted #eee;
    padding-top: 5px;
}

/* --- Chat Interface Styles (Integrated & Updated) --- */

/* Connection status */
.connection-status {
    display: flex;
    align-items: center;
    margin-left: 20px; /* Keep space from title block if in header */
    font-size: 0.9em;
    color: #cccccc; /* Light text for dark header */
    background-color: rgba(255, 255, 255, 0.1); /* Subtle bg on dark header */
    padding: 5px 10px;
    border-radius: 4px;
    flex-shrink: 0;
    /* Position within chat section if moved there */
    margin-bottom: 15px; /* Space below status in chat section */
    color: #555; /* Darker text for light content area */
    background-color: #eee; /* Light background in content area */
}
.status-icon {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
    background-color: #ffcc00; /* Default: Connecting */
    border: 1px solid #fff; /* Border for dark header */
}
.connection-status .status-icon { /* Specificity for content area */
     border: 1px solid #aaa; /* Border for light content area */
}
.status-icon.connected { background-color: #4CAF50; } /* Green */
.status-icon.disconnected { background-color: #f44336; } /* Red */
.status-icon.error { background-color: #f44336; } /* Red for error */

.chat-messages {
    height: 400px;
    overflow-y: auto;
    border: 1px solid #ccc; /* Keep a subtle border for the message area */
    padding: 10px;
    margin-bottom: 15px;
    background-color: #f9f9f9;
    line-height: 1.5;
}

.chat-messages .message {
    margin-bottom: 15px; /* Slightly more space */
    padding: 10px 15px; /* Adjust padding */
    border-radius: 15px; /* Keep existing rounding */
    max-width: 80%;
    word-wrap: break-word;
    position: relative; /* Needed for speak button */
}

/* --- Updated User Message Style --- */
.chat-messages .message.user,
.chat-messages .user-message {
    background-color: #0056b3; /* Match button blue */
    color: white; /* White text for contrast */
    align-self: flex-end;
    margin-left: auto;
    /* Optional: Add edgy corner like reference */
    /* border-bottom-right-radius: 0; */
}

.chat-messages .message.ai,
.chat-messages .ai-message {
    background-color: #f1f0f0; /* Keep light grey */
    color: #333; /* Ensure dark text for contrast */
    align-self: flex-start;
    margin-right: auto;
    padding-right: 35px; /* Keep space for button */
    padding-bottom: 25px; /* Keep space for button */
    /* Optional: Add edgy corner like reference */
    /* border-bottom-left-radius: 0; */
}

/* Style for the Model Name Tag on AI messages */
.model-tag {
    position: absolute;
    top: -8px; /* Adjusted slightly for potentially different line-height */
    right: 10px;
    font-size: 0.7em; /* Slightly smaller */
    background: #0056b3; /* Header blue background */
    color: #ffffff; /* White text */
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
    line-height: 1; /* Ensure consistent height */
    z-index: 1; /* Ensure it sits above the message background */
}

/* --- Keyframes for Thinking Animation (Light Theme) --- */
@keyframes thinking-dots {
    /* Using grey colors suitable for the light theme */
    0%, 20% { color: rgba(150, 150, 150, 0.4); text-shadow: .25em 0 0 rgba(150, 150, 150, 0.4), .5em 0 0 rgba(150, 150, 150, 0.4); }
    40% { color: #999; text-shadow: .25em 0 0 rgba(150, 150, 150, 0.4), .5em 0 0 rgba(150, 150, 150, 0.4); }
    60% { text-shadow: .25em 0 0 #999, .5em 0 0 rgba(150, 150, 150, 0.4); }
    80%, 100% { text-shadow: .25em 0 0 #999, .5em 0 0 #999; }
}

/* --- Updated Thinking Indicator Style --- */
/* Apply thinking styles directly to the message div */
.chat-messages .message.ai-message.thinking {
    font-style: italic; /* Keep italic */
    color: #666; /* Base color for the text */
    background-color: #f8f8f8; /* Slightly different background */
    /* Reset padding if needed, or keep ai-message padding */
    padding-right: 15px;
    padding-bottom: 10px;
}

/* Style the inner span that holds the base text */
.chat-messages .message.thinking span {
    /* Base text color */
    color: #666;
}

/* Use ::after on the inner span for the animated dots */
.chat-messages .message.thinking span::after {
    content: '...'; /* The dots */
    display: inline-block; /* Required for text-shadow */
    animation: thinking-dots 1.4s infinite;
    vertical-align: bottom; /* Align dots nicely */
    margin-left: 3px; /* Space between base text and dots */
}

.chat-input {
    display: flex;
    align-items: center;
    padding: 10px;
    border-top: 1px solid #ccc;
    background-color: #f9f9f9;
}

/* --- Updated Textarea Borders --- */
.chat-input textarea {
    flex-grow: 1;
    min-height: 40px;
    max-height: 120px;
    padding: 10px;
    border: 1px solid #0056b3; /* Default subtle border */
    border-radius: 20px;
    resize: vertical;
    margin-right: 10px;
    font-size: 1em;
    line-height: 1.4;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease; /* Add transition */
}

/* Focus style matching button color */
.chat-input textarea:focus {
    outline: none;
    border-color: #0056b3; /* Match button blue */
    box-shadow: 0 0 0 2px rgba(0, 86, 179, 0.2); /* Subtle glow matching blue */
}

.chat-input button {
    padding: 10px 15px;
    border: none;
    background-color: #0056b3; /* Keep existing blue */
    color: white;
    border-radius: 20px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.2s, transform 0.1s; /* Added transform */
}

.chat-input button:hover {
    background-color: #004494; /* Keep existing darker blue */
}

/* Add active state from reference */
.chat-input button:active {
    transform: scale(0.98); /* Click effect */
}

.chat-input button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Style for the speak button */
.speak-button {
    background: none;
    border: none;
    font-size: 1.2em;
    cursor: pointer;
    color: #555;
    padding: 0;
    position: absolute;
    right: 10px;
    bottom: 5px;
    opacity: 0.7;
    transition: opacity 0.2s;
    line-height: 1;
}
.speak-button:hover {
    opacity: 1;
    color: #000;
}

/* Connection Status Icons */
.connection-status {
    margin-left: 20px;
    font-size: 0.9em;
    color: #cccccc;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 5px 10px;
    border-radius: 4px;
    flex-shrink: 0;
    margin-bottom: 15px;
    color: #555;
    background-color: #eee;
}

.status-icon {
    margin-right: 5px;
}

/* Add colors for status icons (Font Awesome handles the icon shape) */
.status-icon.connected { color: green; }
.status-icon.error { color: red; }
.status-icon.connecting { color: orange; }

/* Footer (From ATM_index.html) */
.main-footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    background-color: #333;
    color: #ccc;
    font-size: 0.9em;
    border-top: 4px solid #000;
}

.main-footer p {
    margin: 5px 0;
}

.ebs-link {
    color: #a5bcd2;
    text-decoration: none;
}

.ebs-link:hover {
    color: #769dc2;
    text-decoration: underline;
}

/* Internal link style from ATM_index.html blog post section */
.internal-link {
   text-decoration:none;
   color: #0055aa;
   font-weight: bold;
   cursor: pointer;
}
.internal-link:hover {
    text-decoration: underline;
}

/* Add styling for the security note */
.security-note {
    font-size: 0.75rem;
    color: var(--text-dark);
    text-align: center;
    flex-basis: 100%;
    order: 1;
    margin-top: -10px;
    margin-bottom: 10px;
}

/* Additional styles from ATM_index.html (e.g., random verse, BG widget) */
#random-verse-section {
    border-top: 3px solid #003366;
    margin-top: 30px;
    background-color: #eef;
    padding: 20px 25px;
}
#random-verse-section h3 {
    text-align: center;
    margin-top: 0;
    color: #003366;
    border-bottom: none;
}
#random-verse-display {
    text-align: center;
}
#verse-text {
    font-size: 1.1em;
    font-style: italic;
    min-height: 4em;
    padding: 10px;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-align: center;
}
#verse-reference {
    display: block;
    margin-top: 10px;
    font-weight: bold;
    color: #003366;
}

/* Bible Gateway Widget Styles */
#bible-gateway-widget table {
    border-color: #003366 !important;
    margin: 15px auto;
    background-color: #f8f8f8;
}
#bible-gateway-widget th {
    color:#003366;
    text-align: center;
    padding: 5px 10px;
    background-color: #e9e9e9;
}
#bible-gateway-widget td {
    background-color: #fff;
    text-align: center;
    padding: 10px;
}
#bible-gateway-widget input[type="text"] {
    margin: 5px 2px;
    padding: 5px;
    border: 1px solid #ccc;
    width: 80%;
}
#bible-gateway-widget input[type="submit"] {
    margin:5px 2px;
    color: #fff;
    background-color: #0055aa;
    border: none;
    padding: 8px 15px;
    cursor: pointer;
    border-radius: 4px;
}
#bible-gateway-widget input[type="submit"]:hover {
    background-color: #003366;
}
#bible-gateway-widget h5 {
    text-align: center;
    margin-top: 10px;
    margin-bottom: 5px;
    color: #003366;
    font-size: 1em;
    font-weight: bold;
}

/* Scrollbar Styling (Optional - from chat version) */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f1f1;
}
::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* Responsive adjustments (example) */
@media (max-width: 600px) {
    .message {
        max-width: 90%;
    }
    .chat-input {
        padding: 8px;
    }
    .chat-input textarea {
        margin-right: 8px;
    }
    .chat-input button {
        padding: 8px 12px;
    }
}

/* Adjust AI message padding slightly if needed to ensure button fits well */
.ai-message {
    background-color: #f1f0f0; /* Light grey */
    align-self: flex-start; /* Position AI messages to the left */
    margin-right: auto; /* Push to the left */
    position: relative; /* Needed for absolute positioning of the button */
    padding-right: 35px; /* Ensure space for button on the right */
    padding-bottom: 25px; /* Add padding at the bottom to make space for the button */
}

/* Style for the thinking indicator */
.ai-message.thinking {
    font-style: italic;
    color: #666; /* Grey text */
    background-color: #f8f8f8; /* Slightly different background */
    /* Reset padding adjusted for the button */
    padding-right: 12px;
    padding-bottom: 8px; /* Reset bottom padding */
}

/* Added CSS for TTS button */
.tts-button {
    background: none;
    border: none;
    font-size: 1.2em; /* Adjust size as needed */
    cursor: pointer;
    padding: 0 5px;
    vertical-align: middle; /* Align with text if needed */
    transition: opacity 0.2s ease-in-out;
    margin-left: 5px; /* Add some space */
}

.tts-button:hover {
    opacity: 0.7;
}

.tts-button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}