/* General styles */
body {
    font-family: 'Lato', sans-serif;
    background-color: #f0f2f5;
    color: #1c1e21;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    background-color: #e4e4e4dd;
    padding: 5px 20px;
    text-align: center;
    margin: 0 auto;
}

.social-links a {
    margin-left: 15px;
    font-weight: bold;
}

.social-links svg {
    fill: #333;
    width: 22px;
    height: 22px;
}

/* Introduction section */
.introduction p {
    font-size: 1.1rem;
}

/* Projects section */
/* .projects {
} */

.projects h3 {
    margin-bottom: 1rem;
    font-weight: bold;
    text-align: left;
}

.social-links-section h3 {
    margin-bottom: 1rem;
    font-weight: bold;
    text-align: left;
}

.card-title {
    font-weight: bold;
}

.project-list {
    list-style: none;
    padding: 0;
}

.project-list li {
    margin-bottom: 10px;
}

.btn-primary {
    background-color: #e4e4e4dd;
    border-color: #e4e4e4dd;
    color: #000;
}

.btn-primary:hover {
    background-color: #d4d4d4dd;
    border-color: #d4d4d4dd;
}

.card {
    border: 1px solid #ddd;
}

/* Mortgage News Page - Modern Design */
.modern-mortgage-page {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #1a1a1a;
}

/* Header */
.mortgage-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
}

.header-content h1.header-title {
    margin: 0;
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.header-content .header-subtitle {
    margin: 0.5rem 0 0 0;
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 300;
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.header-actions .btn {
    border-radius: 0.5rem;
    padding: 0.5rem 1.2rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.header-actions .btn-outline-light:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.header-actions .btn-light {
    background-color: white;
    color: #667eea;
    font-weight: 600;
}

.header-actions .btn-light:hover {
    background-color: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* Main Content */
.main-content {
    padding: 2rem 0;
    min-height: calc(100vh - 120px);
}

/* Filters Section */
.filters-section {
    margin-bottom: 2rem;
    padding: 0 1rem;
}

.filter-card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.filter-item {
    display: flex;
    flex-direction: column;
}

.filter-label {
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.filter-label i {
    margin-right: 0.5rem;
    color: #667eea;
}

.filter-input {
    border: 2px solid #e0e0e0;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.filter-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
}

/* Summary Section */
.summary-section {
    padding: 2rem 1rem;
    background: white;
    border-radius: 1rem;
    margin: 0 1rem 2rem 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.summary-section .accordion-button {
    background-color: #f8f9ff;
    font-weight: 600;
    color: #1a1a1a;
    border: none;
}

.summary-section .accordion-button:not(.collapsed) {
    background-color: #667eea;
    color: white;
}

.summary-section .accordion-button:focus {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Articles Section */
.articles-section {
    padding: 2rem 1rem;
}

.section-title {
    color: white;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.article-card {
    display: block;
}

.card {
    border: none;
    border-radius: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    background: white;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.card-body {
    padding: 1.5rem;
}

.card-title {
    margin-bottom: 1rem;
    font-weight: 700;
    color: #1a1a1a;
    font-size: 1.1rem;
    line-height: 1.4;
}

.card-title a {
    color: #667eea;
    text-decoration: none;
}

.card-title a:hover {
    color: #764ba2;
    text-decoration: underline;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e0e0e0;
    font-size: 0.85rem;
    color: #666;
}

.article-meta small {
    display: flex;
    align-items: center;
}

.card-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #333;
}

.card-text p:last-child {
    margin-bottom: 0;
}

/* Modal Styling */
.modern-modal .modal-content {
    border: none;
    border-radius: 1.2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modern-modal .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 1.2rem 1.2rem 0 0;
    padding: 1.5rem;
}

.modern-modal .modal-title {
    font-weight: 700;
    font-size: 1.3rem;
}

.modern-modal .modal-title i {
    margin-right: 0.5rem;
}

.modal-divider {
    background-color: #e0e0e0;
    margin: 1rem 0;
}

.info-description {
    background-color: #f8f9ff;
    padding: 1rem;
    border-radius: 0.5rem;
    line-height: 1.6;
    font-size: 0.95rem;
    color: #333;
}

.info-description ul {
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
}

.info-description li {
    margin-bottom: 0.5rem;
}

.info-description a {
    color: #667eea;
    text-decoration: none;
}

.info-description a:hover {
    text-decoration: underline;
}

.model-select {
    border: 2px solid #e0e0e0;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.model-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.metadata-card {
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    border: 2px solid #667eea30;
    border-radius: 0.75rem;
    padding: 1.25rem;
    font-size: 0.95rem;
}

.metadata-card .summary-metadata-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e0e0e0;
}

.metadata-card .summary-metadata-item:last-child {
    border-bottom: none;
}

.metadata-card strong {
    color: #667eea;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .mortgage-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 1.5rem 1rem;
    }

    .header-content h1.header-title {
        font-size: 1.8rem;
    }

    .header-content .header-subtitle {
        font-size: 0.9rem;
    }

    .header-actions {
        width: 100%;
    }

    .filter-card {
        grid-template-columns: 1fr;
    }

    .articles-grid {
        grid-template-columns: 1fr;
    }

    .section-title {
        font-size: 1.5rem;
    }
}

/* Sidebar */
.sidebar {
    height: 100%;
    width: 250px;
    position: fixed;
    z-index: 1;
    top: 0;
    left: 0;
    background-color: #e4e4e4dd; /* Matching homepage header */
    overflow-x: hidden;
    transition: 0.5s;
    padding-top: 20px;
}

.sidebar a {
    padding: 8px 8px 8px 32px;
    text-decoration: none;
    font-size: 25px;
    color: #000; /* Black text */
    display: block;
    transition: 0.3s;
}

.sidebar a:hover {
    color: #fff;
}

.sidebar .closebtn {
    position: absolute;
    top: 0;
    right: 25px;
    font-size: 36px;
    margin-left: 50px;
}

.openbtn {
    font-size: 20px;
    cursor: pointer;
    background-color: #b5c4d2; /* Dark gray */
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
}

.openbtn:hover {
    background-color: #444;
}

#main {
    transition: margin-left .5s;
    padding: 16px;
    margin-left: 250px;
}

#model-selection label,
#date-filter-container label,
.sidebar h5 {
    color: black;
}

/* WebLLM Chat page */
.chat-area {
    overflow-y: auto;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #fff;
}

.answer-container {
    background-color: #f8f9fa;
}

.answer-container pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: inherit;
}

.input-area {
    padding-top: 15px;
}

.rag-container {
    max-width: 800px;
    margin: 0 auto;
}

.settings-sidebar {
    width: 300px; /* Adjust as needed */
    background-color: #f8f9fa;
    border-left: 1px solid #ddd;
    flex-shrink: 0; /* Prevent shrinking */
}

.main-chat-content {
    flex-grow: 1;
    padding-right: 15px; /* Add some spacing between content and sidebar */
}

/* ===== MODERN MORTGAGE NEWS PAGE DESIGN ===== */

.modern-mortgage-page {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #1a1a1a;
}

/* Header */
.mortgage-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
}

.header-content h1.header-title {
    margin: 0;
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.header-content .header-subtitle {
    margin: 0.5rem 0 0 0;
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 300;
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.header-actions .btn {
    border-radius: 0.5rem;
    padding: 0.5rem 1.2rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.header-actions .btn-outline-light:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.header-actions .btn-light {
    background-color: white;
    color: #667eea;
    font-weight: 600;
}

.header-actions .btn-light:hover {
    background-color: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* Main Content */
.main-content {
    padding: 2rem 0;
    min-height: calc(100vh - 120px);
}

/* Filters Section */
.filters-section {
    margin-bottom: 2rem;
    padding: 0 1rem;
}

.filter-card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.filter-item {
    display: flex;
    flex-direction: column;
}

.filter-label {
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.filter-label i {
    margin-right: 0.5rem;
    color: #667eea;
}

.filter-input {
    border: 2px solid #e0e0e0;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.filter-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
}

/* Summary Section */
.summary-section {
    padding: 2rem 1rem;
    background: white;
    border-radius: 1rem;
    margin: 0 1rem 2rem 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.summary-section .accordion-button {
    background-color: #f8f9ff;
    font-weight: 600;
    color: #1a1a1a;
    border: none;
}

.summary-section .accordion-button:not(.collapsed) {
    background-color: #667eea;
    color: white;
}

.summary-section .accordion-button:focus {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Articles Section */
.articles-section {
    padding: 2rem 1rem;
}

.section-title {
    color: white;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.article-card {
    display: block;
}

.card {
    border: none;
    border-radius: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    background: white;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.card-body {
    padding: 1.5rem;
}

.card-title {
    margin-bottom: 1rem;
    font-weight: 700;
    color: #1a1a1a;
    font-size: 1.1rem;
    line-height: 1.4;
}

.card-title a {
    color: #667eea;
    text-decoration: none;
}

.card-title a:hover {
    color: #764ba2;
    text-decoration: underline;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e0e0e0;
    font-size: 0.85rem;
    color: #666;
}

.article-meta small {
    display: flex;
    align-items: center;
}

.card-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #333;
}

.card-text p:last-child {
    margin-bottom: 0;
}

/* Modal Styling */
.modern-modal .modal-content {
    border: none;
    border-radius: 1.2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modern-modal .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 1.2rem 1.2rem 0 0;
    padding: 1.5rem;
}

.modern-modal .modal-title {
    font-weight: 700;
    font-size: 1.3rem;
}

.modern-modal .modal-title i {
    margin-right: 0.5rem;
}

.modal-divider {
    background-color: #e0e0e0;
    margin: 1rem 0;
}

.info-description {
    background-color: #f8f9ff;
    padding: 1rem;
    border-radius: 0.5rem;
    line-height: 1.6;
    font-size: 0.95rem;
    color: #333;
}

.info-description ul {
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
}

.info-description li {
    margin-bottom: 0.5rem;
}

.info-description a {
    color: #667eea;
    text-decoration: none;
}

.info-description a:hover {
    text-decoration: underline;
}

.model-select {
    border: 2px solid #e0e0e0;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.model-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.metadata-card {
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    border: 2px solid #667eea30;
    border-radius: 0.75rem;
    padding: 1.25rem;
    font-size: 0.95rem;
}

.metadata-card .summary-metadata-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e0e0e0;
}

.metadata-card .summary-metadata-item:last-child {
    border-bottom: none;
}

.metadata-card strong {
    color: #667eea;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .mortgage-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 1.5rem 1rem;
    }

    .header-content h1.header-title {
        font-size: 1.8rem;
    }

    .header-content .header-subtitle {
        font-size: 0.9rem;
    }

    .header-actions {
        width: 100%;
    }

    .filter-card {
        grid-template-columns: 1fr;
    }

    .articles-grid {
        grid-template-columns: 1fr;
    }

    .section-title {
        font-size: 1.5rem;
    }
}