/* General Body and Container Styling */
body {
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Default: Align to top after search */
    align-items: center;
    min-height: 100vh;
    margin: 0;
    background-color: #ffffff; /* White background */
    color: #202124; /* Dark grey text */
    padding-top: 60px; /* Space for fixed header after search */
    box-sizing: border-box;
}

/* Initial Load State - Overrides body for centering */
body.initial-load {
    justify-content: center; /* Center content vertically on initial load */
    padding-top: 0; /* No padding at top for initial load */
}

.container {
    text-align: center;
    width: 90%;
    max-width: 580px;
    margin-left: 5%;
}

/* Logo Styling */
.logo-placeholder {
    font-size: 50px; /* Adjusted from 100px */
    font-weight: bold;
    color: #4285f4; /* Google blue */
    margin-bottom: 30px;
    letter-spacing: -3px;
}

/* Search Form Styling (for initial search, not header) */
.search-form {
    display: flex;
    flex-direction: column; /* Default for main form: items stack vertically */
    align-items: center;
    width: 100%;
}

.search-input-wrapper {
    width: 100%;
    margin-bottom: 20px; /* Default for main form */
    border: 1px solid #dfe1e5;
    border-radius: 24px;
    display: flex;
    align-items: center;
    padding: 10px 15px; /* Adjust padding if needed */
    background-color: #fff;
    box-shadow: 0 1px 6px rgba(32, 33, 36, .1); /* Subtle shadow for input */
}

.search-input-wrapper:hover {
    box-shadow: 0 1px 6px rgba(32, 33, 36, .2); /* Slightly more prominent shadow on hover */
    border-color: #dadce0;
}

.search-input-wrapper:focus-within {
    box-shadow: 0 1px 6px rgba(32, 33, 36, .2); /* Keep consistent shadow on focus */
    border-color: #4285f4; /* Subtle blue border on focus */
}

.search-input {
    flex-grow: 1;
    border: none;
    outline: none;
    font-size: 16px;
    padding: 8px 0;
    margin-left: 10px;
    color: #202124;
}

.search-buttons { /* Only for main search form */
    display: flex;
    gap: 10px;
}

.search-button {
    background-color: #f8f9fa;
    border: 1px solid #f8f9fa;
    border-radius: 4px;
    color: #3c4043;
    font-size: 14px;
    padding: 10px 24px;
    cursor: pointer;
    outline: none;
    transition: background-color .2s ease-in-out, border-color .2s ease-in-out, box-shadow .2s ease-in-out;
}

.search-button:hover {
    background-color: #f1f3f4;
    border-color: #dadce0;
    box-shadow: 0 1px 1px rgba(0, 0, 0, .1);
}

/* Header Search Bar */
#header-search-bar {
    display: flex;
    align-items: center;
    /* justify-content: space-between; This was pushing the form to the right */
    justify-content: flex-start; /* Align header content to the left */
    width: 100%;
    padding: 10px 20px;
    background-color: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    box-sizing: border-box;
}

.header-logo {
    font-size: 20px;
    font-weight: bold;
    color: #4285f4;
    margin-right: 20px; /* Space between logo and search form */
    flex-shrink: 0; /* Prevent logo from shrinking */
}

.header-form {
    flex-direction: row;
    align-items: center;
    max-width: 500px;
    flex-grow: 1;
}

.header-form .search-input-wrapper {
    margin-bottom: 0;
    box-shadow: 0 1px 6px rgba(32, 33, 36, .1);
    border-color: #dfe1e5;
    padding: 0 12px;
    flex-grow: 1;
    width: 100%;
    gap: 8px;
    display: flex;
    align-items: center;
    height: 44px;
    box-sizing: border-box;
}

.header-form .search-input-wrapper:hover {
    box-shadow: 0 1px 6px rgba(32, 33, 36, .2);
    border-color: #dadce0;
}

.header-form .search-input-wrapper:focus-within {
    box-shadow: 0 1px 6px rgba(32, 33, 36, .2);
    border-color: #4285f4;
}

.header-form .search-input {
    flex-grow: 1;
    border: none;
    outline: none;
    font-size: 14px;
    padding: 8px 0;
    margin-left: 0;
    color: #202124;
    height: 100%; /* Make input take full height of wrapper */
    box-sizing: border-box; /* Include padding in height */
}

.header-form .search-button {
    display: none; /* Hide the AI Search button in the header if it's not needed */
    margin-left: 10px;
    padding: 10px 16px;
    font-size: 13px;
    flex-shrink: 0;
}

/* Icon Button Base Styling */
.icon-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 24px; /* Set a fixed width for the button itself */
    height: 24px; /* Set a fixed height for the button itself */
    transition: opacity 0.3s ease;
}

.icon-button:hover {
    opacity: 0.8; /* Subtle hover effect */
}

/* Magnifying Glass Search Icon (inside input wrapper) */
/* This one is NOT a button, it's just an SVG */
.search-icon {
    fill: #9aa0a6; /* Standard grey color */
    width: 20px; /* Size of the icon */
    height: 20px; /* Size of the icon */
    vertical-align: middle;
    flex-shrink: 0; /* Prevent it from shrinking */
}

/* Clear Search Icon (Cross/X icon) */
.clear-search-button {
    opacity: 0.7;
}

.clear-search-button.hidden {
    display: none !important; /* Ensure it's hidden when the class is present */
}

/* Target the SVG specifically for clear icon */
.clear-search-button .clear-icon {
    fill: #9aa0a6;
    width: 20px;
    height: 20px;
}

/* Voice Search Icon */
/* Target the SVG specifically for voice icon */
.voice-search-icon .voice-icon {
    fill: #9aa0a6; /* Standard grey color, override any specific path colors */
    width: 20px;
    height: 20px;
}
.voice-search-icon .voice-icon path[fill] {
    fill: unset; /* Remove explicit fill on paths if you want them to inherit from parent button's SVG */
}

/* Image Search Icon */
/* Target the SVG specifically for image icon */
.image-search-icon .image-icon {
    fill: #9aa0a6; /* Standard grey color */
    width: 20px;
    height: 20px;
}

/* Main Content Area - New Flex Container for Results and Right Panel */
#main-content-area {
    display: flex;
    justify-content: flex-start;
    width: 100%;
    max-width: 1200px;
    padding: 20px 20px 20px 0px; /* CHANGE THIS: Reduced left padding to 5px */
    box-sizing: border-box;
}

/* Results Section */
#results-container {
    width: 90%; /* This might be adjusted depending on your layout goals */
    /*margin-left: -46px; */
    box-sizing: border-box;
    box-shadow: none;
    background-color: transparent;
    border-radius: 0;
    flex-shrink: 0;
    /*max-width: 1200px;*/ /* Keep your max-width */
    margin-top: 20px;
}

#right-panel {
    flex-grow: 1;
    width: 35%;
    min-width: 250px;
    max-width: 400px;
    padding-left: 30px;
    box-sizing: border-box;
}

#main-answer-section {
    margin-bottom: 20px;
    padding-bottom: 15px;
}

#main-answer-section h2 {
    font-size: 18px;
    color: #202124;
    margin-top: 0;
    margin-bottom: 10px;
}

#main-answer-section p {
    color: #4d5156;
    font-size: 14px;
    line-height: 1.58;
}

.section-title {
    font-size: 18px;
    color: #202124;
    margin-bottom: 15px;
    margin-top: 30px;
}

/* Individual Search Result (Record) Styling */
.record {
    padding: 0;
    margin-bottom: 20px;
    border: none;
    background-color: transparent;
}

.record-title {
    font-size: 18px;
    line-height: 1.3;
    margin-top: 0;
    margin-bottom: 4px;
}

.record-title a {
    color: #1a0dab;
    text-decoration: none;
}

.record-title a:hover {
    text-decoration: underline;
}

.record-summary {
    color: #4d5156;
    font-size: 14px;
    line-height: 1.58;
    margin-top: 0;
    margin-bottom: 0;
}

.record-meta-info {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 5px;
    margin-bottom: 10px;
    color: #70757a;
    font-size: 13px;
}

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

.meta-icon {
    width: 16px;
    height: 16px;
    fill: #70757a;
    flex-shrink: 0;
}

/* Hidden Utility Class */
.hidden {
    display: none !important;
}

/* Error and Loading Messages */
.error-message {
    color: #d93025;
    font-weight: bold;
    margin-top: 20px;
}

/* Modern Pagination Controls */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    margin: 40px 0 30px 0;
    padding: 0;
    border: none;
}

.pagination-button {
    background: transparent;
    border: none;
    color: #1a73e8;
    font-size: 14px;
    font-weight: 500;
    padding: 12px 16px;
    cursor: pointer;
    outline: none;
    border-radius: 50%;
    min-width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
}

.pagination-button:hover {
    background-color: rgba(26, 115, 232, 0.08);
    transform: scale(1.05);
}

.pagination-button.active {
    background-color: #1a73e8;
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(26, 115, 232, 0.3);
}

.pagination-button:disabled {
    color: #dadce0;
    cursor: not-allowed;
    opacity: 0.5;
}

.pagination-button:disabled:hover {
    background: transparent;
    transform: none;
}

/* --- Mobile Responsiveness (Media Queries) --- */

@media (max-width: 768px) {
    body {
        padding-top: 50px;
    }

    .logo-placeholder {
        font-size: 80px;
        margin-bottom: 20px;
    }

    .search-input-wrapper {
        padding: 8px 12px;
    }

    .search-input {
        font-size: 14px;
    }

    .search-button {
        font-size: 12px;
        padding: 8px 18px;
    }

    #header-search-bar {
        padding: 8px 10px;
    }

    .header-logo {
        font-size: 20px;
        margin-right: 10px;
    }

    .header-form .search-input-wrapper {
        padding: 6px 10px;
        gap: 6px;
        height: 40px; /* Adjusted height for smaller screens */
    }

    .header-form .search-input {
        padding: 4px 0;
    }

    .header-form .search-button {
        padding: 8px 14px;
    }

    #main-content-area {
        flex-direction: column;
        padding: 10px;
    }

    #results-container {
        width: 100%;
        padding-right: 0;
        margin-left: 0; /* Remove negative margin on mobile */
    }

    #right-panel {
        width: 100%;
        padding-left: 0;
        margin-top: 20px;
        min-width: unset;
        max-width: 100%;
    }

    .record-title {
        font-size: 18px;
    }

    .record-summary, .record-url, .record-meta-info {
        font-size: 13px;
    }

    .pagination-button {
        font-size: 13px;
        padding: 10px 14px;
        min-width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    body {
        padding-top: 45px;
    }

    .logo-placeholder {
        font-size: 60px;
        margin-bottom: 15px;
    }

    .search-input-wrapper {
        padding: 6px 10px;
    }

    .search-input {
        font-size: 13px;
    }

    .search-buttons {
        flex-direction: column;
        gap: 8px;
    }

    .search-button {
        width: 100%;
        font-size: 13px;
        padding: 10px 15px;
    }

    #header-search-bar {
        padding: 7px 8px;
    }

    .header-logo {
        font-size: 18px;
        margin-right: 8px;
    }

    .header-form {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-start; /* Changed to flex-start for smaller screens */
        margin-right: auto; /* Push remaining space to the right */
    }

    .header-form .search-input-wrapper {
        flex-basis: auto; /* Allow content to dictate width */
        max-width: none;
        margin-bottom: 0;
        padding: 5px 8px;
        flex-grow: 1; /* Allow it to grow */
        height: 36px; /* Adjusted height for very small screens */
    }

    .header-form .search-input {
        font-size: 12px;
    }

    .header-form .search-button {
        margin-left: 5px;
        padding: 6px 10px;
        font-size: 10px;
        flex-basis: auto;
    }
}

/* --- Footer Styling --- */
footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 10px 20px;
    background-color: #f8f9fa;
    color: #70757a;
    font-size: 11px;
    text-align: center;
    z-index: 999;
    box-sizing: border-box;
    /*display: flex;*/
    justify-content: flex-start;
}

footer .footer-content span {
    margin-right: 15px;
}

body:not(.initial-load) {
    padding-bottom: 40px;
}

@media (max-width: 480px) {
    footer {
        padding: 8px 10px;
        font-size: 10px;
    }
    footer .footer-content span {
        margin-right: 10px;
    }
    body:not(.initial-load) {
        padding-bottom: 35px;
    }
}

/* Updated Search Modes Bar */
#search-modes-bar {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
    padding: 0 20px;
    background-color: #fff;
    box-sizing: border-box;
    position: fixed;
    top: 60px;
    left: 0;
    z-index: 990;
    height: 48px;
}

.search-mode-item {
    background: none; /* This removes any default button background */
    border: none; /* This removes any default button borders */
    padding: 10px 12px;
    margin: 0 5px;
    cursor: pointer;
    font-size: 14px;
    color: #5f6368;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    position: relative; /* Essential for positioning the ::after pseudo-element */
    transition: color 0.3s ease;
}

.search-mode-item:hover {
    color: #202124;
    background-color: transparent; /* Ensure no background on hover either */
}

/* Active search mode button styling */
.search-mode-item.active {
    color: #1a73e8; /* Google blue for active text */
    font-weight: 500; /* Slightly bolder for active text */
    border-bottom: none; /* Explicitly ensure no bottom border on the element itself */
}

/* Underline for the active search mode button */
.search-mode-item.active::after {
    content: '';
    position: absolute;
    bottom: -1px; /* Positions the underline just below the mode item, overlapping the bar's border */
    left: 0;
    width: 100%;
    height: 3px; /* Thickness of the underline */
    background-color: #1a73e8; /* Google blue color for the underline */
    border-radius: 2px 2px 0 0; /* Slightly rounded corners */
    transition: width 0.3s ease, left 0.3s ease, background-color 0.3s ease;
}
.search-mode-item.disabled {
    opacity: 0.6; /* Dim disabled items */
    cursor: default; /* Change cursor for non-clickable */
    pointer-events: none; /* Prevent any click events on disabled items */
}

/* Override hover for disabled items */
.search-mode-item.disabled:hover {
    color: #5f6368; /* Keep original color on hover */
    background-color: transparent; /* No background change */
    border-bottom-color: transparent; /* No underline */
}

.search-mode-item .mode-icon {
    width: 18px; /* Size of the icon */
    height: 18px;
    margin-right: 5px; /* Space between icon and text */
    fill: currentColor; /* Inherit color from parent */
}

/* Adjust body padding to account for the new modes bar */
body:not(.initial-load) {
    padding-top: 70px;
    padding-bottom: 40px;
}

/* Adjustments for smaller screens */
@media (max-width: 768px) {
    #search-modes-bar {
        top: 50px; /* Adjust if header height changes on mobile */
        height: 40px;
        padding: 0 10px;
        overflow-x: auto; /* Allow horizontal scrolling if items overflow */
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    }

    .search-mode-item {
        padding: 6px 10px;
        margin-right: 10px;
        font-size: 13px;
        flex-shrink: 0; /* Prevent items from shrinking */
    }

    .search-mode-item .mode-icon {
        width: 16px;
        height: 16px;
    }

    body:not(.initial-load) {
        padding-top: 95px; /* Header (50px) + Modes Bar (40px) + buffer (5px) */
    }
}

@media (max-width: 480px) {
    #search-modes-bar {
        top: 45px; /* Adjust if header height changes on very small mobile */
        height: 38px;
        padding: 0 8px;
    }

    .search-mode-item {
        padding: 5px 8px;
        font-size: 12px;
        margin-right: 8px;
    }

    .search-mode-item .mode-icon {
        width: 14px;
        height: 14px;
    }

    body:not(.initial-load) {
        padding-top: 85px; /* Header (45px) + Modes Bar (38px) + buffer (2px) */
    }
}
/* In your style.css */

.record {
    display: flex; /* Makes the record a flex container */
    align-items: flex-start; /* Aligns items to the top */
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.record-content-wrapper {
    display: flex;
    gap: 15px; /* Space between image and text */
    width: 100%;
}

.book-cover-thumbnail {
    width: 100px; /* Adjust as needed */
    height: auto;
    object-fit: contain; /* Ensures the whole image is visible */
    border: 1px solid #eee;
    border-radius: 4px;
    flex-shrink: 0; /* Prevents the image from shrinking */
}

.record-details {
    flex-grow: 1; /* Allows the details to take up remaining space */
}

.record-title {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 1.2em;
}

.book-title-link {
    color: #1a0dab;
    text-decoration: none;
}

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

.record-meta-info {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 0.9em;
    color: #5f6368;
}

.record-meta-item {
    display: flex;
    align-items: center;
}

.record-meta-item .meta-icon {
    width: 16px;
    height: 16px;
    margin-right: 5px;
    color: #5f6368; /* Or any other desired color */
}

.record-summary {
    line-height: 1.5;
    color: #444;
}
/* In your style.css or a similar CSS file */

.record-content-wrapper {
    display: flex; /* Enables flexbox for side-by-side layout */
    align-items: flex-start; /* Aligns items to the start of the cross-axis (top) */
    gap: 15px; /* Adds space between the image and the details */
}

.book-cover-thumbnail {
    width: 100px; /* Adjust as needed */
    height: auto; /* Maintain aspect ratio */
    border: 1px solid #ddd; /* Optional: subtle border */
    border-radius: 4px; /* Optional: rounded corners */
    flex-shrink: 0; /* Prevents the image from shrinking */
}

.book-cover-placeholder {
    width: 100px; /* Match thumbnail width */
    height: 150px; /* Adjust as needed, possibly matching average cover height */
    background-color: #f0f0f0;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #666;
    border: 1px solid #ddd;
    border-radius: 4px;
    flex-shrink: 0;
}

.record-details {
    flex-grow: 1; /* Allows the details section to take up remaining space */
}
/* style.css */

/* ... (your existing CSS) ... */

/* New styles for Google-like search results */

#results-container {
    margin-top: 20px;
    margin-left: 5%;
    padding: 0 20px;
    width: 95%;
    box-sizing: border-box;
    text-align: left;
}

/* Hide section titles if you no longer want them */
#metadata-section-title,
#semantic-section-title {
    display: none; /* Hide the section titles for a unified look */
}

/* Style for individual search result containers */
.search-result-item {
    background-color: #ffffff;
    flex-direction: row-reverse;
    padding: 15px 0;
    margin-bottom: 0;
    border: none;
    box-shadow: none;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    border-bottom: 1px solid #ebebeb;
    width: 65%;
    text-align: left;
    margin-left: 0;
}
.search-result-item:last-child {
    border-bottom: none; /* Remove border from the last item */
}

.search-result-item:hover {
    box-shadow: none; /* No shadow on hover either */
    transition: none; /* No transition on hover */
}
.book-cover-thumbnail {
    width: 100px; /* Adjust as needed */
    height: auto; /* Maintain aspect ratio */
    border: 1px solid #ddd; /* Optional: subtle border */
    border-radius: 4px; /* Optional: rounded corners */
    flex-shrink: 0; /* Prevents the image from shrinking */
    object-fit: cover; /* Ensures image covers the area without distortion */
}

.book-cover-placeholder {
    width: 100px;
    height: 150px; /* Standard book aspect ratio */
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 0.8em;
    text-align: center;
    flex-shrink: 0;
}

.result-details {
    flex-grow: 1; /* Allows details to take up remaining space */
}

.result-title {
    font-size: 1.2em; /* Slightly larger title */
    color: #1a0dab; /* Google blue for links */
    margin-bottom: 5px;
    text-decoration: none; /* Remove underline by default */
}

.result-title:hover {
    text-decoration: underline; /* Underline on hover */
}

.result-snippet {
    font-size: 0.9em;
    color: #4d5156; /* Darker grey for snippet */
    line-height: 1.5;
    margin-bottom: 10px;
}

.record-meta-info {
    display: flex;
    flex-wrap: wrap;
    gap: 15px; /* Increase gap between meta items */
    margin-top: 10px;
    font-size: 0.85em; /* Slightly smaller for metadata */
    color: #5f6368;
    align-items: center; /* Vertically align icons and text */
}

.record-meta-item {
    display: flex;
    align-items: center; /* Ensures icon and text are aligned */
    white-space: nowrap; /* Prevent wrapping for each meta item */
}

.record-meta-item .meta-icon {
    width: 18px; /* Slightly larger icons */
    height: 18px;
    margin-right: 6px; /* Space between icon and text */
    fill: #5f6368; /* Icon color */
    flex-shrink: 0; /* Prevent icons from shrinking */
}

/* Pagination controls - ensure they are centered and styled well */
.pagination-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
    margin-bottom: 30px;
}

.pagination-button {
    background-color: #f8f9fa;
    border: 1px solid #dadce0;
    border-radius: 4px;
    padding: 10px 15px;
    font-size: 0.9em;
    color: #1a0dab;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.pagination-button:hover {
    background-color: #e8eaed;
}

.pagination-button:disabled {
    background-color: #f0f0f0;
    color: #9aa0a6;
    cursor: not-allowed;
}

/* Adjustments for semantic results if you still want a distinct section */
#semantic-results {
    margin-top: 30px; /* Space between metadata and semantic results */
}

/* If you want semantic results to also adopt the card-like structure */
.semantic-result-item {
    background-color: #f0fffee8; /* Light blueish tint for semantic results */
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 20px;
    border: 1px solid #cceeff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.semantic-result-item .result-title {
    color: #0d47a1; /* Darker blue for semantic titles */
}
.semantic-result-item .result-snippet {
    color: #333;
}

#loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    
    position: relative; /* Ensures it participates in normal document flow */
    margin-top: 20px; /* Adds space between the buttons and the indicator */
    margin-bottom: 20px; /* Optional: adds space below the indicator if other content follows */
    gap: 8px;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);}

/* Loading Spinner */
.loading-spinner {
    border: 3px solid #f3f3f3; /* Light grey base for the circle */
    border-top: 3px solid #4285f4; /* Google blue for the spinning part */
    border-radius: 50%; /* Makes it a perfect circle */
    width: 24px; /* Slightly larger size for visibility */
    height: 24px; /* Matches width for circular shape */
    animation: spin 1s linear infinite; /* Keeps it spinning */
}

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

/* Loading Message */
#loading-message { /* Changed from .loading-message to #loading-message for consistency with HTML ID */
    font-size: 1em; /* Reduced font size for a less prominent look */
    color: #5f6368; /* A subtle grey */
    font-weight: bold;
    text-align: center;
}

/* Responsive adjustments for .search-result-item */
@media (max-width: 768px) {
    .search-result-item {
        flex-direction: column; /* Stack image and text vertically */
        align-items: center; /* Center items when stacked */
        text-align: center; /* Center text */
        padding: 15px 10px; /* Adjust padding */
    }

    .book-cover-thumbnail,
    .book-cover-placeholder {
        margin-bottom: 15px; /* Add space below image when stacked */
    }

    .record-meta-info {
        justify-content: center; /* Center meta info items */
        margin-top: 10px; /* Adjust margin */
    }
}

@media (max-width: 480px) {
    .record-meta-info {
        gap: 8px; /* Reduce gap between meta items */
        font-size: 0.8em; /* Further reduce font size */
    }

    .record-meta-item .meta-icon {
        width: 16px;
        height: 16px;
    }

    .result-title {
        font-size: 1.1em; /* Adjust title size */
    }

    .result-snippet {
        font-size: 0.85em; /* Adjust snippet size */
    }

    .pagination-controls {
        gap: 2px;
        margin: 30px 0 20px 0;
    }

    .pagination-button {
        padding: 8px 12px;
        font-size: 13px;
        min-width: 36px;
        height: 36px;
    }
}

/*new css added - 30th July 2025*/

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    padding: 10px 20px;
    background-color: #f9f9f9;
}

.header-left {
    display: flex;
    align-items: center;
}

.header-logo {
    font-size: 20px;
    font-weight: bold;
    color: #333;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.header-link {
    text-decoration: none;
    color: #5d5d5d;
    font-size: 12px;
    transition: color 0.3s ease;
    padding: 5px;
}

.header-link:hover {
    color: #007bff;
}

.donate-button {
    background-color: #d9534f;
    color: #fff !important;
    padding: 5px 10px;
    border-radius: 4px;
    font-weight: bold;
}



/* Responsive */
@media (max-width: 768px) {
    .header-right {
        justify-content: center;
        margin-top: 10px;
    }
    #header-search-form {
        margin-top: 10px;
    }
}


/*About us CSS*/

.about-section {
    padding: 5px 30px;
    background-color: #f9f9f9;
    color: #333;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    text-align: left;
    margin-top: 30px;
    margin-bottom: 50px;
    border-radius: 10px;
}

.container_abt {
    /*max-width: 900px;*/
    /*margin: 0 auto;*/
    text-align: left;
}

.about-title {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 20px;
    color: #222;
}

.about-intro {
    font-size: 16px;
    margin-bottom: 20px;
    line-height: 1.6;
}

.about-subtitle {
    font-size: 22px;
    font-weight: bold;
    margin-top: 20px;
    margin-bottom: 15px;
}

.features-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.features-list li {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 10px;
}

.jain-quote {
    font-style: italic;
    font-size: 16px;
    background: #fff;
    padding: 15px 20px;
    border-left: 4px solid #007bff;
    margin: 20px 0;
    color: #555;
}

.jain-quote span {
    display: block;
    margin-top: 10px;
    font-style: normal;
    font-weight: bold;
    color: #333;
}

.closing-note {
    font-size: 16px;
    font-weight: normal;
    margin-top: 30px;
}

/* Responsive */
@media (max-width: 600px) {
    .about-title {
        font-size: 22px;
    }

    .about-subtitle {
        font-size: 18px;
    }

    .features-list li {
        font-size: 14px;
    }

    .jain-quote {
        font-size: 14px;
    }
}

/*Footer css*/

.site-footer {
    width: 100%;
    background-color: #f1f1f1;
    padding: 8px 10px;
    font-size: 12px;
    color: #555;
    margin-top: 20px;
}

.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.footer-left {
    flex: 1;
    text-align: left;
}

.footer-right {
    flex: 1;
    text-align: right;
}

.footer-container p {
    margin: 0;
}

.ai-click-more-button {
    background: linear-gradient(-45deg, #667eea, #764ba2, #f093fb, #f5576c, #4facfe, #00f2fe);
    background-size: 400% 400%;
    animation: gradientShift 3s ease infinite;
    border: none;
    border-radius: 25px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 12px 24px;
    position: absolute;
    top: 0;
    right: 5%;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    width: auto;
}

.ai-click-more-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.ai-click-more-button::before {
    content: '💬';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    animation: bounce 2s infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(-50%); }
    40% { transform: translateY(-60%); }
    60% { transform: translateY(-55%); }
}

.footer-link {
    color: #007bff;
    text-decoration: none;
}

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

/* Responsive */
@media (max-width: 600px) {
    .site-footer {
        font-size: 12px;
        padding: 15px 5px;
    }
}
/* Home page top bar */
.home-top-bar {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 100;
}

.home-login {
    display: flex;
    align-items: center;
}

#ai-overview-section {
    width: 100%;
    background: transparent;
    padding: 0;
    margin: 0 0 20px 0;
    position: relative;
}

.ai-overview-card {
    position: relative;
    width: 65%;
    margin-left: 20px;
    padding: 0;
    text-align: left;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    max-height: 300px;
    overflow-y: auto;
}

.ai-overview-card.collapsed {
    max-height: 90px;
    overflow: hidden;
    position: relative;
}

.ai-overview-card.collapsed::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(transparent, #ffffff);
    pointer-events: none;
}

.ai-expand-button {
    background: none;
    border: none;
    color: #1a73e8;
    font-size: 14px;
    cursor: pointer;
    padding: 8px 0;
    margin-top: 12px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.ai-expand-button:hover {
    text-decoration: underline;
}

.ai-expand-button::after {
    content: '';
    width: 12px;
    height: 12px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%231a73e8"><path d="M7 10l5 5 5-5z"/></svg>') no-repeat center;
    background-size: contain;
    transition: transform 0.2s ease;
}

.ai-overview-card.collapsed .ai-expand-button::after {
    transform: rotate(-90deg);
}

#metadata-results {
    position: relative;
    z-index: 1;
    margin-top: 20px;
}

@media (max-width: 768px) {
    .ai-overview-card {
        width: 90%;
        margin-left: 10px;
        padding: 0;
    }
    
    .ai-overview-card.collapsed {
        max-height: 75px;
    }
    
    .ai-click-more-button {
        position: static;
        margin-top: 16px;
        width: auto;
        right: auto;
    }
    
    .ai-short-answer {
        font-size: 15px;
    }
    
    .ai-detailed-answer {
        font-size: 13px;
    }
}

.ai-overview-card h3 {
    font-size: 16px;
    font-weight: 400;
    color: #70757a;
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-overview-card h3::before {
    content: '';
    width: 20px;
    height: 20px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%234285f4"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>') no-repeat center;
    background-size: contain;
    flex-shrink: 0;
}

.ai-short-answer {
    font-size: 16px;
    font-weight: 400;
    color: #202124;
    margin-top: 60px;
    margin-bottom: 16px;
    line-height: 1.3;
}

.ai-detailed-answer {
    font-size: 14px;
    color: #4d5156;
    line-height: 1.58;
    margin-bottom: 20px;
    display: none;
}

.ai-detailed-answer.show {
    display: block;
}

.ai-reference-section {
    display: none;
}

.ai-reference-section.show {
    display: block;
}

.ai-reference-list {
    margin: 16px 0;
    padding: 0;
    list-style: none;
}

.ai-reference-list li {
    margin-bottom: 8px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-reference-list li::before {
    content: '';
    width: 16px;
    height: 16px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%235f6368"><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"/></svg>') no-repeat center;
    background-size: contain;
    flex-shrink: 0;
}

.ai-reference-list a {
    color: #1a73e8;
    text-decoration: none;
    line-height: 1.4;
}

.ai-reference-list a:hover {
    text-decoration: underline;
}

.search-arrow-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: #4285f4;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.search-arrow-button:hover {
    color: #1a73e8;
}

.intro-text {
    max-width: 500px;
    margin: 30px auto 0;
    text-align: center;
}

.intro-text p {
    font-size: 14px;
    line-height: 1.5;
    color: #5f6368;
}

.header-center {
    margin-left: 20px;
    flex-grow: 1;
    display: flex;
    justify-content: flex-start;
}

.cache-status-message {
    font-size: 11px;
    color: #5f6368;
    font-style: italic;
    text-align: left;
    margin: 0;
    padding: 0;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.footer-separator {
    margin: 0 8px;
    color: #70757a;
}

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

.login-modal-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.login-modal-content h2 {
    color: #202124;
    margin-bottom: 16px;
    font-size: 24px;
    font-weight: 400;
}

.login-modal-content p {
    color: #5f6368;
    margin-bottom: 24px;
    line-height: 1.5;
}

.close-modal-btn {
    background: #f8f9fa;
    border: 1px solid #dadce0;
    border-radius: 4px;
    padding: 8px 16px;
    margin-top: 16px;
    cursor: pointer;
    color: #3c4043;
}

.close-modal-btn:hover {
    background: #f1f3f4;
}

/* Donation Popup Styles */
.donation-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.donation-popup-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    position: relative;
}

.donation-popup-content h3 {
    color: #202124;
    margin-bottom: 16px;
    font-size: 24px;
    font-weight: 500;
}

.donation-popup-content p {
    color: #5f6368;
    margin-bottom: 16px;
    line-height: 1.6;
    font-size: 14px;
}

.donation-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
}

.donate-btn {
    background: #1a73e8;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 12px 24px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s ease;
}

.donate-btn:hover {
    background: #1557b0;
}

.skip-btn {
    background: #f8f9fa;
    color: #3c4043;
    border: 1px solid #dadce0;
    border-radius: 6px;
    padding: 12px 24px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.skip-btn:hover {
    background: #f1f3f4;
}

.close-popup-btn {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #5f6368;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-popup-btn:hover {
    background: #f1f3f4;
    border-radius: 50%;
}

/* Forget Me Modal Styles */
.forget-me-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.forget-me-modal-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    text-align: left;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.forget-me-modal-content h2 {
    color: #d93025;
    margin-bottom: 16px;
    font-size: 20px;
    font-weight: 500;
}

.forget-me-modal-content p {
    color: #202124;
    margin-bottom: 12px;
    line-height: 1.5;
}

.forget-me-modal-content ul {
    color: #5f6368;
    margin: 16px 0;
    padding-left: 20px;
}

.forget-me-modal-content li {
    margin-bottom: 8px;
}

#forget-confirmation {
    width: 100%;
    padding: 12px;
    border: 2px solid #dadce0;
    border-radius: 4px;
    font-size: 14px;
    margin: 16px 0;
    box-sizing: border-box;
}

#forget-confirmation:focus {
    border-color: #1a73e8;
    outline: none;
}

.forget-me-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

.delete-btn {
    background: #d93025;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 10px 20px;
    cursor: pointer;
    font-weight: 500;
}

.delete-btn:hover {
    background: #b52d20;
}

.cancel-btn {
    background: #f8f9fa;
    color: #3c4043;
    border: 1px solid #dadce0;
    border-radius: 4px;
    padding: 10px 20px;
    cursor: pointer;
}

.cancel-btn:hover {
    background: #f1f3f4;
}

.forget-me-link {
    color: #d93025 !important;
    font-size: 12px;
}

.forget-me-link:hover {
    color: #b52d20 !important;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Google Sign-In Button Styling */
.g_id_signin {
    margin: 16px 0;
}

/* Mobile responsiveness for modals */
@media (max-width: 480px) {
    .login-modal-content,
    .donation-popup-content,
    .forget-me-modal-content {
        padding: 20px;
        margin: 20px;
    }
    
    .donation-buttons,
    .forget-me-buttons {
        flex-direction: column;
    }
    
    .donate-btn,
    .skip-btn,
    .delete-btn,
    .cancel-btn {
        width: 100%;
    }
}