/* Windows XP Default Blue Theme (Luna) Pallete */
:root {
    --xp-blue-primary: #3f6eb7; /* Title bar blue */
    --xp-blue-gradient-start: #4a89dc; /* Lighter blue for gradient top */
    --xp-blue-gradient-end: #3660a5; /* Darker blue for gradient bottom */
    --xp-gray-background: #f0f0f0; /* Default window background */
    --xp-gray-light: #f7f7f7; /* Very light gray for elements */
    --xp-gray-medium: #e4e4e4; /* Button default */
    --xp-gray-dark: #c0c0c0; /* Borders, shadows */
    --xp-text-color: #000000;
    --xp-button-border: #9b9b9b;
    --xp-button-active-border: #003c74;
    --xp-button-hover-blue: #a3c4f9; /* Blue highlight for buttons */
    --xp-focus-outline: #0078d7; /* Standard Windows focus outline */
}

body {
    background: url('/Windows.webp') no-repeat center center fixed; /* Default XP wallpaper */
    background-size: cover;
    color: var(--xp-text-color);
    line-height: 1.6;
    font-family: Tahoma, Geneva, sans-serif; /* XP Font */
    font-size: 14px;
}

.container {
    max-width: 900px;
    margin: 20px auto; /* Add some margin from top/bottom */
    padding: 0; /* Remove container padding, sections will have their own */
    background: none; /* No background for container itself */
    box-shadow: none; /* No shadow for container */
}

/* Common window/panel style for XP */
.window {
    margin-bottom: 20px;
    overflow: hidden; /* To contain inner elements */
}

.title-bar {
    /* XP.css handles most of this. Keeping text-shadow for custom look */
    text-shadow: 1px 1px 1px rgba(0,0,0,0.3);
}

.title-bar .title-text {
    /* Keeping this for specific title text shadowing */
    text-shadow: 1px 1px 1px rgba(0,0,0,0.3);
}

.window-content {
    /* XP.css handles padding and background */
}

/* Header (Top "window") */
header {
    padding: 0; /* Remove header padding */
    text-align: left; /* Adjust alignment for XP title bar style */
}

header .title-bar {
    border-bottom: none; /* Title bar already has its own bottom border */
}

header h1 {
    margin: 0; /* Remove margin from h1 */
    display: inline-block; /* For title-text class */
}

.tagline {
    font-style: normal; /* Remove italic */
    color: var(--xp-text-color);
    padding: 10px 15px; /* Add padding to content part */
    display: block; /* Ensure it's on a new line below the notice */
    text-align: center;
}

.scrolling-notice {
    overflow: hidden;
    background: var(--xp-gray-light);
    margin: 0 15px 10px 15px; /* Margin inside the "window" */
    padding: 5px;
    border: 1px solid var(--xp-gray-dark);
    border-radius: 3px;
    box-shadow: inset 1px 1px 2px rgba(0,0,0,0.1);
}

.scrolling-notice p {
    white-space: nowrap;
    animation: scroll-text 15s linear infinite;
    color: #444; /* Darker text for better contrast on light gray */
    font-size: 13px;
}

@keyframes scroll-text {
    0% {
        transform: translateX(100%);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* New hotpage banner */
.hotpage-banner {
    margin-bottom: 20px; /* Space it out from other elements */
    padding: 0; /* Handled by window-content */
}

.hotpage-banner .window-content {
    background-color: var(--xp-gray-light); /* Lighter background for emphasis */
    border: 1px solid var(--xp-gray-dark);
    padding: 10px 15px; /* Adjust padding */
    text-align: center;
    font-size: 1.1rem; /* Slightly larger text */
    font-weight: bold;
    color: var(--xp-blue-primary); /* Use XP blue for text */
}

.hotpage-banner .banner-text {
    margin: 0; /* Remove default paragraph margin */
    text-shadow: 1px 1px 0 rgba(255,255,255,0.7); /* Subtle white shadow for depth */
}

/* Project Link box */
.project-link.window {
    padding: 0;
    margin-bottom: 20px;
}
.project-link .window-content {
    background-color: var(--xp-gray-light);
    border: 1px solid var(--xp-gray-dark);
    border-radius: 4px;
    padding: 8px 15px;
    font-size: 13px;
    text-align: center;
    box-shadow: inset 1px 1px 3px rgba(0,0,0,0.1);
}

.project-link a {
    color: var(--xp-blue-gradient-end); /* XP link blue */
    text-decoration: underline;
}
.project-link a:hover {
    color: var(--xp-blue-primary);
}
.project-link p {
    margin: 0;
}

/* Search container, Result container, Community section */
/* These top-level elements now solely rely on .window for their window styling */

/* The actual content inside these XP windows */
.search-container .window-content,
#resultContainer .window-content,
.community-section .window-content {
    padding: 15px; /* Apply padding to the inner content area */
}

#loadingIndicator.window {
    margin: 2rem auto; /* Center the loading window */
    padding: 0; /* Handled by window-content */
    width: fit-content; /* Adjust width to content */
}
#loadingIndicator .window-content {
    padding: 20px; /* Apply padding to its content */
    text-align: center;
}

.description {
    margin-bottom: 15px;
    text-align: left; /* Align description left inside the window content */
}

.input-wrapper {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

input[type="text"], select, textarea {
    flex: 1;
    border: 1px solid var(--xp-gray-dark);
    border-top-color: #a0a0a0; /* Darker top border for recessed effect */
    border-left-color: #a0a0a0; /* Darker left border */
    box-shadow: inset 1px 1px 2px rgba(0,0,0,0.1); /* Recessed look */
    font-size: 1rem;
    color: var(--xp-text-color);
}

/* Specific styles for the textarea */
#lostMediaInput {
    min-height: 100px; /* Make it bigger */
    font-size: 1.25rem; /* Make text 1.25x bigger */
    resize: vertical; /* Allow vertical resizing */
    overflow-y: auto; /* Ensure scrollable if content exceeds height */
}

input[type="text"]:focus, select:focus, textarea:focus {
    outline: 1px solid var(--xp-focus-outline);
    border-color: var(--xp-focus-outline);
    box-shadow: inset 1px 1px 2px rgba(0,0,0,0.1);
}

button {
    font-weight: normal; /* Remove bold */
    font-size: 13px;
    transition: all 0.1s ease-out; /* Smoother transition */
}

button:hover {
    background: linear-gradient(to bottom, var(--xp-button-hover-blue), var(--xp-blue-primary));
    color: white; /* White text on hover */
    border-color: var(--xp-blue-primary);
    box-shadow: 1px 1px 0 rgba(0,0,0,0.2);
}

button:active {
    background: linear-gradient(to top, var(--xp-button-hover-blue), var(--xp-blue-primary));
    border-color: var(--xp-button-active-border);
    box-shadow: inset 1px 1px 2px rgba(0,0,0,0.2); /* Pressed effect */
    transform: translateY(1px); /* Slight shift down when pressed */
}

/* Specific button overrides */
.share-button {
    background: linear-gradient(to bottom, var(--xp-gray-light), var(--xp-gray-medium));
    color: var(--xp-text-color);
    border-color: var(--xp-button-border);
}
.share-button:hover {
    background: linear-gradient(to bottom, var(--xp-button-hover-blue), var(--xp-blue-primary));
    color: white;
}
.share-button:active {
    background: linear-gradient(to top, var(--xp-button-hover-blue), var(--xp-blue-primary));
}

/* Delete button specific styling */
.delete-button {
    background: linear-gradient(to bottom, #ff9999, #cc0000); /* Red gradient for delete */
    color: white;
    border-color: #990000;
}

.delete-button:hover {
    background: linear-gradient(to bottom, #ff6666, #ff0000);
    border-color: #cc0000;
}

.delete-button:active {
    background: linear-gradient(to top, #ff6666, #ff0000);
    border-color: #800000;
}

.local-save-button {
    background: linear-gradient(to bottom, #c1f0c1, #5cb85c);
    color: white;
    border-color: #4cae4c;
}

.local-save-button:hover {
    background: linear-gradient(to bottom, #a9e8a9, #47a447);
    color: white;
}

.local-save-button:active {
    background: linear-gradient(to top, #a9e8a9, #47a447);
}

#loadingIndicator {
    text-align: center;
    margin: 2rem 0;
}

.spinner {
    width: 40px; /* Smaller spinner */
    height: 40px;
    border: 4px solid var(--xp-gray-medium); /* Lighter border */
    border-top: 4px solid var(--xp-blue-primary); /* XP blue spinner */
    margin: 0 auto 10px;
    animation: spin 1s linear infinite;
}

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

.hidden {
    display: none;
}

#resultContainer {
    padding: 0;
}

/* Wiki styling */
#wikiContent {
    font-family: Arial, sans-serif; /* Common web font for content */
    font-size: 13px;
}

#wikiContent h2 {
    font-size: 1.25rem; /* Made smaller */
    color: var(--xp-blue-primary);
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--xp-gray-dark);
    padding-bottom: 0.2rem;
}

#wikiContent h3 {
    font-size: 1rem; /* Made smaller relative to h2 */
    color: var(--xp-blue-gradient-end);
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px dotted var(--xp-gray-dark); /* Dotted for sub-section */
    padding-bottom: 0.1rem;
}

#wikiContent p {
    margin-bottom: 0.8rem;
}

#wikiContent ul, #wikiContent ol {
    margin-left: 20px;
    margin-bottom: 0.8rem;
}

.wiki-status {
    background-color: #cccccc; /* Default gray for status */
    color: #333;
    padding: 2px 6px;
    border-radius: 2px;
    font-size: 0.75rem;
    font-weight: normal;
    border: 1px solid #999999;
}

/* Specific status colors */
.wiki-lost { background-color: #ffcccc; border-color: #ff0000; color: #000; } /* Light red */
.wiki-partially-found { background-color: #ffe6b3; border-color: #ff8c00; color: #000; } /* Light orange */
.wiki-found { background-color: #ccffcc; border-color: #008000; color: #000; } /* Light green */
.wiki-existence-unconfirmed { background-color: #e0ccff; border-color: #800080; color: #000; } /* Light purple */
.wiki-false-flag { background-color: #d6b8a8; border-color: #8b4513; color: #000; } /* Light brown */
.wiki-hoax { background-color: #d2dce2; border-color: #5f9ea0; color: #000; } /* Light blue-gray */
.wiki-fictional-lost-media { background-color: #b3e0ff; border-color: #007bff; color: #000; } /* Light blue */
.wiki-recently-rediscovered { background-color: #ccf2f5; border-color: #00bcd4; color: #000; } /* Light cyan */
.wiki-reconstruction-attempt { background-color: #ffc9b3; border-color: #ff5722; color: #000; } /* Light orange-red */
.wiki-reconstruction-success { background-color: #d4f8e8; border-color: #4CAF50; color: #000; } /* Light mint green */
.wiki-reconstruction-fail { background-color: #ffcdd2; border-color: #f44336; color: #000; } /* Light red */
.wiki-destroyed { background-color: #e0e0e0; border-color: #424242; color: #000; } /* Light gray */
.wiki-creator-resurrected { background-color: #f7b3d0; border-color: #e91e63; color: #000; } /* Light pink */
.wiki-gatekept { background-color: #f5f5f5; border-color: #757575; color: #000; } /* Light grey */
.wiki-fake-lost { background-color: #e8dada; border-color: #c19a9a; color: #000; } /* Grayish red */
.wiki-fake-found { background-color: #dae8da; border-color: #9ac19a; color: #000; } /* Grayish green */
.wiki-fake-partially-found { background-color: #e8e1da; border-color: #c1b19a; color: #000; } /* Grayish orange */
.wiki-whistleblower-resurrected { background-color: #b2ebf2; border-color: #00bcd4; color: #000; } /* Light cyan */

.wiki-section {
    margin-bottom: 1.5rem;
}

.wiki-section h3 {
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
}

.wiki-image-placeholder {
    background-color: #eee;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
    margin: 1rem 0;
    position: relative;
}

.wiki-image-placeholder img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.wiki-image-placeholder .generate-image-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: var(--xp-blue-primary); /* This will be XP Blue from the root vars */
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    opacity: 0.9;
}

.wiki-image-placeholder .generate-image-btn:hover {
    opacity: 1;
}

.wiki-image-placeholder .spinner-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #666;
}

.wiki-image-placeholder .image-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #c00;
}

.retry-image-btn {
    background: var(--xp-gray-medium);
    border: 1px solid var(--xp-button-border);
    padding: 3px 8px;
    font-size: 12px;
}

.retry-image-btn:hover {
    background: var(--xp-gray-light);
}

.wiki-info-box {
    background-color: #ffffff;
    border: 1px solid var(--xp-gray-dark);
    padding: 10px;
    margin: 10px 0 10px 15px; /* Adjust margin */
    float: right;
    width: 250px; /* Slightly narrower */
    border-radius: 3px;
    box-shadow: inset 1px 1px 2px rgba(0,0,0,0.1);
}

.wiki-info-box h4 {
    background-color: var(--xp-blue-primary);
    color: white;
    padding: 3px 5px;
    margin: -10px -10px 10px -10px; /* Extend background */
    text-align: center;
    font-size: 13px;
    font-weight: bold;
}

.wiki-info-item {
    margin-bottom: 5px;
    font-size: 12px;
}

.wiki-info-label {
    font-weight: bold;
}

.wiki-references {
    border-top: 1px dotted var(--xp-gray-dark);
    padding-top: 1rem;
    margin-top: 1.5rem;
    font-size: 0.85rem;
}

.wiki-references ol {
    margin-left: 1.5rem;
}

/* Community Entries */
.community-section {
    margin-top: 3rem;
    background-color: var(--xp-gray-background);
    padding: 0;
    border: 1px solid var(--xp-gray-dark);
}

.community-section h2 {
    /* This rule will be overridden by .title-bar on the H2 itself now */
    display: none; /* Hide the h2 directly as it's replaced by .title-bar content */
}

.community-description {
    text-align: left;
    margin-bottom: 1.5rem;
}

.local-saves-controls {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--xp-gray-dark);
}

.local-saves-controls button {
    background: linear-gradient(to bottom, #ff9999, #cc0000);
    color: white;
    border-color: #990000;
}

.local-saves-controls button:hover {
    background: linear-gradient(to bottom, #ff6666, #ff0000);
    border-color: #cc0000;
}

/* New: Community Controls */
.community-controls {
    margin-bottom: 15px;
    background-color: #fff8e1; /* Light yellow warning background */
    border: 1px solid #ffc107; /* Amber border */
    padding: 10px;
    border-radius: 3px;
}

.community-controls label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
    cursor: pointer;
}

.community-warning {
    margin: 8px 0 0 0;
    font-size: 12px;
    color: #616161; /* Darker gray for text */
}

/* New: Community Search Wrapper */
.community-search-wrapper {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    padding: 0 15px; /* Match inner content padding */
}

.community-search-wrapper input[type="text"] {
    flex-grow: 1;
    padding: 6px 8px;
    font-size: 1rem;
}

.community-search-wrapper button {
    flex-shrink: 0;
    padding: 6px 15px;
    font-size: 1rem;
}

/* New: Date Input Wrapper */
.date-input-wrapper {
    margin-top: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.date-input-wrapper label {
    font-weight: bold;
    color: var(--xp-text-color);
    font-size: 13px;
    flex-shrink: 0;
}

.date-input-wrapper input[type="text"] {
    padding: 6px 8px;
    font-size: 13px;
    border: 1px solid var(--xp-button-border);
    border-radius: 2px;
    box-shadow: inset 1px 1px 2px rgba(0,0,0,0.1);
    flex-grow: 1;
    max-width: 250px;
}

/* New: Share Container */
.share-container {
    margin-top: 1.5rem;
    padding-top: 15px;
    border-top: 1px solid var(--xp-gray-dark);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.share-container button {
    flex-grow: 1;
}

.share-container .hidden {
    display: none;
}

#shareConfirmation,
#localSaveConfirmation {
    width: 100%;
    text-align: center;
    color: green;
    font-weight: bold;
    font-size: 13px;
    margin-top: 5px;
}

/* New: Poster Details Wrapper */
.poster-details-wrapper {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px dashed var(--xp-gray-dark);
}

.poster-details-wrapper h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: var(--xp-blue-primary);
}

.poster-input-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.poster-input-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.poster-input-item label {
    font-weight: normal;
    font-size: 13px;
}

.poster-input-item textarea {
    min-height: 40px;
    font-size: 13px;
    resize: vertical;
}

/* Community Entries */
.community-entries {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    padding: 0 15px 15px 15px; /* Add padding to match window-content, especially bottom */
}

.community-entry {
    background-color: #e0e0e0; /* Slightly darker than window background */
    border: 1px solid var(--xp-gray-dark);
    border-radius: 3px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.1s ease-out;
    box-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.community-entry:hover {
    transform: none; /* No lift effect */
    box-shadow: inset 1px 1px 2px rgba(0,0,0,0.1); /* Pressed effect on hover */
    background-color: #d0d0d0;
}
.community-entry:active {
    background-color: #c0c0c0;
    box-shadow: inset 1px 1px 3px rgba(0,0,0,0.2);
}

.entry-title {
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: var(--xp-blue-primary);
    font-size: 14px;
}

.entry-creator {
    font-size: 0.75rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.entry-status {
    /* Re-using wiki-status directly, no need for composes */
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: bold;
    color: white;
    margin-top: 5px;
}

.entry-preview {
    margin-top: 0.8rem;
    font-size: 0.85rem;
    color: #444;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.loading-entries {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
    color: #666;
}

.entry-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent black overlay */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content.window {
    padding: 0; /* No padding on the outer modal-content, it's handled by window-content */
    max-width: 700px; /* Smaller max-width for modals */
    max-height: 90vh;
    overflow: hidden; /* To contain inner elements like window */
    position: relative;
    display: flex; /* Make it a flex container to arrange titlebar and content */
    flex-direction: column; /* Stack children vertically */
}

/* Specific styling for modal title bar to look like XP */
.modal-content .title-bar {
    border-radius: 3px 33px 0 0; /* Apply border-radius to match XP window */
    border-bottom: 1px solid var(--xp-blue-gradient-end); /* Ensure standard border */
}

/* Ensure the title text within the modal title bar is white */
.modal-content .title-bar .title-text {
    color: white;
    font-weight: bold;
    font-size: 14px;
    margin: 0; /* Remove default h2 margin */
}

/* Content area of the modal */
.modal-content .window-content {
    padding: 15px;
    overflow-y: auto; /* Allow scrolling for modal content */
    flex-grow: 1; /* Allow content to grow and take available space */
}

.modal-actions button {
    margin: 0 5px;
}

.close-modal {
    background: none;
    border: none;
    cursor: pointer;
    color: white; /* White X on blue bar */
    padding: 0;
    line-height: 1; /* For better alignment */
    width: 20px; /* Fixed size */
    height: 20px;
    text-align: center;
    border-radius: 2px;
    font-size: 1.5rem; /* Make X bigger */
    font-weight: normal; /* Remove bold default from button style */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.1s ease-out; /* Smooth transition */
}

.close-modal:hover {
    background-color: #c00000; /* Red hover for close button */
    color: white;
    border-color: #c00000; /* Match border color */
}
.close-modal:active {
    background-color: #800000;
    border-color: #800000; /* Match border color */
}

.security-warning {
    background-color: #ffe0b2; /* Light orange for warning */
    color: #e65100;
    padding: 1rem;
    border: 1px solid #ff9800;
    border-radius: 4px;
    margin: 1rem 0;
    font-weight: bold;
    text-align: center;
}

/* Sequel/Follow-up Styles */
.follow-up-section {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 2px solid var(--xp-blue-primary);
}

.follow-up-section h3 {
    font-size: 1.2rem;
    color: var(--xp-blue-primary);
    margin-bottom: 1rem;
    text-align: center;
}

.follow-up-section .input-wrapper,
.follow-up-section .status-selector-wrapper,
.follow-up-section .date-input-wrapper {
    margin-bottom: 1rem;
}

.wiki-entry-part {
    border: 1px solid var(--xp-gray-dark);
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
    background-color: #f7f7f7;
    box-shadow: inset 1px 1px 3px rgba(0,0,0,0.1);
}

.wiki-entry-part:last-child {
    margin-bottom: 0;
}

.entry-part-header {
    background-color: var(--xp-gray-medium);
    margin: -15px -15px 15px -15px;
    padding: 8px 15px;
    border-bottom: 1px solid var(--xp-gray-dark);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    font-size: 13px;
    gap: 10px;
}

.entry-part-date {
    font-weight: bold;
    white-space: nowrap;
}

.entry-part-poster {
    display: block;
    font-size: 12px;
    font-style: italic;
    color: #333;
    margin-bottom: 4px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    body {
        background-attachment: scroll; /* Allow background to scroll on mobile */
        font-size: 12px; /* Slightly smaller base font for mobile */
    }

    .container {
        margin: 10px; /* Reduce margin on smaller screens */
        padding: 0;
        max-width: 100%; /* Allow container to take full width */
    }

    .window {
        margin-bottom: 15px; /* Reduce spacing between windows */
    }

    .title-bar {
        font-size: 13px; /* Slightly smaller title bar font */
        padding: 4px 8px; /* Reduce padding */
    }

    header h1 {
        font-size: 16px; /* Adjust header title font size */
    }

    .tagline {
        padding: 8px 10px; /* Reduce padding */
        font-size: 12px;
    }

    .description {
        font-size: 12px;
        margin-bottom: 10px;
    }

    .input-wrapper {
        flex-direction: column; /* Stack input and button vertically */
        gap: 8px; /* Smaller gap */
        margin-bottom: 10px;
    }

    #lostMediaInput {
        min-height: 80px; /* Smaller min-height for mobile input */
        font-size: 1rem; /* Adjust font size relative to new base */
    }

    button {
        width: 100%; /* Make buttons full width when stacked */
        font-size: 12px;
        padding: 10px 15px; /* Increase padding for easier tapping */
    }

    .window-content {
        padding: 10px; /* Reduce content padding for more space */
    }

    /* Wiki content adjustments */
    #wikiContent {
        font-size: 12px;
    }

    #wikiContent h2 {
        font-size: 1.1rem; /* Smaller H2 for mobile */
        margin-top: 0.8rem;
        margin-bottom: 0.4rem;
    }

    #wikiContent h3 {
        font-size: 0.9rem; /* Smaller H3 for mobile */
        margin-top: 0.8rem;
        margin-bottom: 0.4rem;
    }

    #wikiContent p {
        margin-bottom: 0.6rem;
    }

    #wikiContent ul, #wikiContent ol {
        margin-left: 15px; /* Reduce list indentation */
        margin-bottom: 0.6rem;
    }

    .wiki-info-box {
        float: none; /* Remove float */
        width: auto; /* Take full available width */
        margin: 10px 0; /* Center it with top/bottom margin */
        padding: 8px; /* Adjust padding */
    }

    .wiki-info-box h4 {
        margin: -8px -8px 8px -8px; /* Adjust margin to extend background */
    }

    .wiki-info-item {
        font-size: 11px; /* Smaller info item font */
    }

    .wiki-references {
        font-size: 0.8rem; /* Smaller references font */
        padding-top: 0.8rem;
        margin-top: 1rem;
    }

    /* Community entries adjustments */
    .community-search-wrapper { /* Stack search input and button vertically */
        flex-direction: column;
        gap: 8px;
        margin-bottom: 15px;
        padding: 0 10px; /* Adjust padding for mobile */
    }

    .community-search-wrapper input[type="text"],
    .community-search-wrapper button {
        width: 100%; /* Full width for mobile */
        font-size: 12px;
        padding: 8px 10px; /* Adjust padding */
    }

    .community-entries {
        grid-template-columns: 1fr; /* Single column layout for community entries */
        gap: 1rem; /* Reduce gap */
        padding: 0 10px 10px 10px; /* Adjust padding for mobile */
    }

    .community-entry {
        padding: 8px; /* Reduce padding for entries */
    }

    .entry-title {
        font-size: 13px;
    }

    .entry-creator, .entry-preview {
        font-size: 0.7rem;
    }

    /* Modal adjustments */
    .modal-content.window {
        max-width: 95vw; /* Almost full width */
        max-height: 95vh; /* Almost full height */
    }

    .modal-content .window-content {
        padding: 10px; /* Reduced padding for modal content */
    }

    footer {
        padding: 10px; /* Reduce footer padding */
        font-size: 0.75rem; /* Smaller footer text */
        margin-top: 15px;
    }

    .date-input-wrapper { /* Stack on mobile */
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .date-input-wrapper input[type="text"] {
        width: 100%;
        max-width: none;
    }
}