body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 10px;
    background-color: #f4f4f4;
    color: #333;
}

.container {
    max-width: 800px;
    margin: 20px auto;
    background-color: #fff;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

header h1 {
    margin: 0;
    color: #0056b3;
}

.settings-button {
    background-color: #007bff;
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.settings-button:hover {
    background-color: #0056b3;
}

h1, h2 {
    color: #0056b3;
    text-align: center;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 10px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
    width: calc(100% - 22px); /* Account for padding and border */
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.form-group textarea {
    resize: vertical;
}

.checkbox-group {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.checkbox-group input[type="checkbox"] {
    margin-right: 10px;
    width: auto; /* Override width for checkboxes */
}

button[type="submit"],
button[type="button"] {
    background-color: #007bff;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 18px;
    width: 100%;
    box-sizing: border-box; /* Include padding and border in the element's total width and height */
    margin-top: 10px;
}

button[type="submit"]:hover,
button[type="button"]:hover {
    background-color: #0056b3;
}

#process-status {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
    font-size: 1.1em;
    font-weight: bold;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: #007bff;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

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

#output pre {
    background-color: #e9e9e9;
    padding: 15px;
    border-radius: 5px;
    white-space: pre-wrap; /* Preserve whitespace and wrap text */
    word-wrap: break-word; /* Break long words */
    max-height: 400px; /* Limit height */
    overflow-y: auto; /* Enable scrolling */
    margin-top: 20px;
    border: 1px solid #ccc;
}

#results {
    margin-top: 20px;
    padding: 15px;
    background-color: #d4edda;
    border: 1px solid #28a745;
    border-radius: 5px;
    color: #155724;
    text-align: center;
}

#report-links a {
    display: block;
    margin-top: 5px;
    color: #007bff;
    text-decoration: none;
}

#report-links a:hover {
    text-decoration: underline;
}

/* Drop Area Styles */
.drop-area {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    color: #666;
    cursor: pointer;
    margin-top: 10px;
    transition: border .3s ease-in-out;
}

.drop-area.highlight {
    border-color: #007bff;
    background-color: #e6f7ff;
}

#reference-docs-list {
    list-style: none;
    padding: 0;
    margin-top: 10px;
}

#reference-docs-list li {
    background-color: #f0f0f0;
    padding: 8px 12px;
    margin-bottom: 5px;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.remove-file {
    color: #dc3545;
    cursor: pointer;
    font-weight: bold;
    margin-left: 10px;
}

#reference-docs-folder-path,
#direct-articles-file-path {
    margin-top: 10px;
    font-style: italic;
    color: #555;
}

/* Dropdown for Additional Options */
.dropdown {
    position: relative;
    display: block; /* Changed from inline-block to block */
    width: 100%; /* Ensure it takes full width */
    margin-bottom: 15px; /* Add some space below */
}

.dropdown summary {
    background-color: #007bff;
    color: white;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    list-style: none; /* Remove default marker */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dropdown summary::-webkit-details-marker {
    display: none; /* Hide default marker for Webkit browsers */
}

.dropdown summary:hover {
    background-color: #0056b3;
}

.dropdown-content {
    display: none; /* Hidden by default */
    padding: 15px;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 5px 5px;
    background-color: #f9f9f9;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.dropdown[open] .dropdown-content {
    display: block; /* Show when details is open */
}

.dropdown-content .checkbox-group {
    margin-bottom: 8px; /* Adjust spacing within dropdown */
}

/* Settings Page Specific Styles */
nav {
    margin-bottom: 20px;
    text-align: center;
}

nav a {
    display: inline-block;
    padding: 10px 15px;
    background-color: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    margin: 0 5px;
}

nav a:hover {
    background-color: #0056b3;
}

.settings-section {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #eee;
}

.settings-section h2, .settings-section h3 {
    color: #0056b3;
    margin-top: 0;
    margin-bottom: 15px;
    text-align: left;
}

/* Styles for URL input group */
.url-input-group {
    display: flex;
    gap: 10px; /* Space between input and button */
}

.url-input-group input[type="url"] {
    flex-grow: 1; /* Allow input to take available space */
    width: auto; /* Override default width */
    padding: 8px 10px; /* Slightly smaller padding for input */
}

.url-input-group button {
    width: auto; /* Allow button to size based on content */
    padding: 8px 15px; /* Smaller padding for the button */
    font-size: 16px; /* Smaller font size */
    margin-top: 0; /* Remove top margin */
    flex-shrink: 0; /* Prevent button from shrinking */
}

/* Easy Mode Button */
.easy-mode-button {
    background-color: #28a745; /* Green color */
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 18px;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 20px; /* Space below the button */
    display: block; /* Ensure it takes full width */
}

.easy-mode-button:hover {
    background-color: #218838; /* Darker green on hover */
}

/* Modal Styles */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
    padding-top: 60px;
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto; /* 15% from the top and centered */
    padding: 20px;
    border: 1px solid #888;
    border-radius: 8px;
    width: 80%; /* Could be more or less, depending on screen size */
    max-width: 600px;
    position: relative;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    animation-name: animatetop;
    animation-duration: 0.4s
}

/* Add Animation */
@keyframes animatetop {
    from {top: -300px; opacity: 0}
    to {top: 0; opacity: 1}
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close-button:hover,
.close-button:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.modal-content h2 {
    text-align: center;
    color: #0056b3;
    margin-bottom: 15px;
}

.modal-content p {
    margin-bottom: 15px;
    line-height: 1.5;
}

.modal-content textarea {
    width: calc(100% - 22px); /* Account for padding and border */
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    margin-bottom: 15px;
    resize: vertical;
}

.modal-content button {
    width: 100%;
    padding: 12px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 18px;
}

.modal-content button:hover {
    background-color: #0056b3;
}

/* Fading Popup Message */
.fading-popup {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 123, 255, 0.9); /* Blue with transparency */
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    font-size: 1.1em;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    z-index: 1001; /* Above modal */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.fading-popup.show {
    opacity: 1;
}

/* API Warning Modal Styles */
#api-warning-modal .modal-content {
    border-color: #ffc107; /* A warning yellow */
}

#api-warning-modal h2 {
    color: #d39e00; /* A darker yellow for the heading */
}

#api-warning-modal p {
    font-size: 1.1em;
}

#api-warning-modal a {
    color: #007bff;
    text-decoration: underline;
}

#api-warning-modal a:hover {
    color: #0056b3;
}