body { 
    background-color: #000000;
    color: #e0e0e0;
    font-size: 1.25rem !important; /* Increased by 4 sizes */
}

/* Base markdown styles */
.markdown-body { 
    width: 100% !important; /* Fill the container width */
    max-width: 100% !important; /* Fill the container width */
    margin: 0 !important; 
    padding: 20px;
    color: #e0e0e0;
    background-color: #000000;
    box-sizing: border-box;
}

/* Post date styling */
.post-date {
    color: #999;
    font-size: 0.9em;
    font-style: italic;
    margin-bottom: 2em;
    margin-top: -0.5em;
    text-align: left;
}

.markdown-body h1 { font-size: 2.5em; margin-top: 1.5em; margin-bottom: 1em; color: #ffffff; }
.markdown-body h2 { font-size: 2em; margin-top: 1.2em; margin-bottom: 1em; color: #ffffff; }
.markdown-body h3 { font-size: 1.6em; margin-top: 1em; margin-bottom: 1em; color: #ffffff; }

/* Collapsible headers */
.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4, .markdown-body h5, .markdown-body h6 {
    position: relative;
    transition: color 0.2s ease;
}

.markdown-body h1:hover, .markdown-body h2:hover, .markdown-body h3:hover, 
.markdown-body h4:hover, .markdown-body h5:hover, .markdown-body h6:hover {
    color: #c999ff;
}

.collapse-toggle {
    color: #c999ff;
}

.collapse-toggle:hover {
    color: #ffffff;
}

.header-anchor {
    color: #c999ff !important;
    text-decoration: none !important;
}

.header-anchor:hover {
    color: #ffffff !important;
}

/* Smooth transitions for collapsed content */
.markdown-body * {
    transition: opacity 0.3s ease;
}

.markdown-body .collapsing {
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

/* Paragraph spacing */
.markdown-body p { margin: 1.5em 0; }

/* Purple bold text */
.markdown-body strong { color: #c999ff; font-weight: bold; }

/* Blockquotes */
.markdown-body blockquote {
    border-left: 4px solid #444;
    margin: 1em 0;
    padding: 0.5em 1em;
    color: #999;
    background-color: #111;
}

/* Links */
.markdown-body a { 
    color: #66b3ff !important; 
    text-decoration: underline; 
    transition: color 0.2s ease, opacity 0.2s ease;
}

.markdown-body a:hover { 
    color: #99ccff !important; 
    opacity: 0.8;
}

/* Images - centered and smallish size */
.markdown-body img {
    max-width: 25% !important; /* Smallish size - 1/4 of page width */
    width: auto !important;
    height: auto !important;
    display: block !important;
    margin: 0 auto !important;
}

/* Ensure text content is properly sized and centered */
.markdown-body {
    font-size: 1.25rem !important;
    line-height: 1.6;
    text-align: left;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .markdown-body {
        width: 100% !important; /* Fill container width on medium screens */
        max-width: 100% !important;
    }
    
    .markdown-body img {
        max-width: 50% !important; /* Increased from 25% to 50% */
    }
}

@media (max-width: 768px) {
    .markdown-body {
        width: 100% !important; /* Fill container width on small screens */
        max-width: 100% !important;
    }
    
    .markdown-body img {
        max-width: 50% !important; /* Increased from 40% to 50% */
    }
}

/* Link preview card */
.link-preview {
    position: absolute;
    background: rgba(17, 17, 17, 0.95);
    border: 1px solid #444;
    border-radius: 8px;
    padding: 12px;
    max-width: 520px;
    min-width: 360px;
    max-height: 450px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.9);
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    font-size: 14px;
    line-height: 1.4;
    color: #e0e0e0;
    backdrop-filter: blur(15px);
}

.link-preview.visible {
    opacity: 1;
    transform: translateY(0);
}

.link-preview h1, .link-preview h2, .link-preview h3 {
    margin: 0 0 12px 0;
    font-size: 20px;
    color: #ffffff;
}

.link-preview p {
    margin: 0 0 12px 0;
    color: #ccc;
    font-size: 16px;
}

.link-preview .preview-content {
    max-height: 400px;
    overflow: hidden;
    position: relative;
}

.link-preview .preview-content::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(transparent, #111);
}

.link-preview .loading {
    color: #666;
    font-style: italic;
    font-size: 16px;
}

.link-preview .error {
    color: #ff6b6b;
    font-style: italic;
    font-size: 14px;
}

/* URL preview styles */
.link-preview .url-preview-header {
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #333;
}

.link-preview .url-preview-body {
    color: #ccc;
}

.link-preview .url-actions a {
    display: inline-block;
    padding: 4px 8px;
    background: rgba(102, 179, 255, 0.1);
    border: 1px solid #66b3ff;
    border-radius: 4px;
    color: #66b3ff !important;
    text-decoration: none !important;
    font-size: 12px;
    transition: all 0.2s ease;
}

.link-preview .url-actions a:hover {
    background: rgba(102, 179, 255, 0.2);
    color: #99ccff !important;
}

/* External link iframe preview */
.link-preview .iframe-container {
    border: 1px solid #333;
    border-radius: 4px;
    overflow: hidden;
    background: #000;
    position: relative;
}

.link-preview .iframe-container iframe {
    background: #fff;
    pointer-events: none;
    border: none;
}

.link-preview .iframe-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #333;
}

.link-preview .iframe-header a:hover {
    color: #99ccff !important;
}

/* Archive notice styling */
.link-preview .archive-notice {
    background: #2d2d2d;
    border: 1px solid #444;
    padding: 8px 12px;
    margin-bottom: 12px;
    border-radius: 4px;
    font-size: 12px;
    color: #999;
    text-align: center;
}

/* Enhanced iframe fallback */
.link-preview .iframe-container > div {
    padding: 40px 20px;
    text-align: center;
    color: #666;
    font-style: italic;
    line-height: 1.5;
}

.link-preview .iframe-container a {
    color: #c999ff;
    text-decoration: underline;
    font-weight: bold;
    transition: color 0.2s ease;
}

.link-preview .iframe-container a:hover {
    color: #ffffff;
}

/* Tables */
.markdown-body table { 
    border-collapse: collapse; 
    width: 100%; 
    margin: 1.5em 0;
    background-color: #111;
}
.markdown-body td, .markdown-body th { 
    border: 1px solid #333; 
    padding: 8px; 
    text-align: left;
}
.markdown-body th {
    background-color: #222;
}

/* Lists */
.markdown-body ul { list-style-type: disc; padding-left: 2em; margin: 1.5em 0; }
.markdown-body ol { list-style-type: decimal; padding-left: 2em; margin: 1.5em 0; }
.markdown-body ul li, .markdown-body ol li { margin-bottom: 0.5em; padding-left: 0.5em; }
.markdown-body ul ul, .markdown-body ol ul { list-style-type: circle; margin: 0.5em 0 0.5em 2em; }
.markdown-body ul ol, .markdown-body ol ol { list-style-type: lower-alpha; margin: 0.5em 0 0.5em 2em; }

/* Math */
.katex-display { 
    margin: 2em 0 !important; 
    text-align: center !important; 
    overflow-x: auto;
    color: #ffffff;
}
.katex { 
    font-size: 1.1em !important;
    color: #ffffff !important;
}
.katex .mathrm { font-style: normal !important; }
.katex .mord { font-style: normal !important; }
.math-inline { display: inline-block; }
.math-display { display: block; margin: 1em 0; overflow-x: auto; }

/* Code blocks */
.markdown-body pre { 
    background: #111; 
    padding: 16px; 
    overflow-x: auto; 
    border-radius: 4px; 
    margin: 1.5em 0;
    border: 1px solid #333;
    color: #e0e0e0;
}

/* Checkboxes */
.markdown-body input[type="checkbox"] { 
    appearance: checkbox !important;
    -webkit-appearance: checkbox !important;
    width: 15px !important;
    height: 15px !important;
    margin-right: 8px !important;
    position: relative;
    top: 2px;
    background-color: #111;
    border: 1px solid #444;
}
.markdown-body .task-list-item { 
    list-style-type: none; 
    margin: 0.5em 0;
}
.markdown-body .contains-task-list { 
    list-style-type: none;
    padding-left: 1em;
}

/* Navigation */
nav {
    background-color: #111 !important;
    border-bottom: 1px solid #333;
    position: relative;
    z-index: 1; /* Lower than carousel */
}
nav a {
    color: #e0e0e0 !important;
}
nav a:hover {
    color: #ffffff !important;
}

/* Selection */
::selection {
    background: #444;
    color: #fff;
}
/* Main content container */
.main-content {
    position: relative;
    z-index: 1;
    margin: 20px auto;
    padding: 20px;
    width: 400px; /* Fixed width for home page */
    min-width: 400px;
    max-width: 400px;
    min-height: calc(100vh - 200px);
    font-family: Helvetica, Arial, sans-serif;
    text-align: center;
    background-color: #000000;
    border: 2px solid #c999ff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Footer links container */
.footer-links {
    margin-top: auto; /* Push to bottom of flex container */
    padding-top: 20px;
    line-height: 1.5;
}

/* Media page specific override - ONLY for media page, not other pages */
.media-container .main-content,
.main-content:has(.media-container) {
    width: auto !important;
    max-width: none !important;
    min-width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    text-align: left !important;
}

/* Copyright notice */
.copyright {
    margin-top: 20px;
    font-size: 0.9em;
    color: #666;
}

/* Mouse tracker */
.mouse-tracker {
    position: fixed;
    pointer-events: none; /* Ensures it doesn't interfere with other elements */
    z-index: 9999;
    background-color: rgba(0, 0, 0, 0.8); 
    color: #c999ff;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    transform: translate(10px, 10px); /* Offset from cursor */
    opacity: 0;
    transition: opacity 0.3s ease;
    font-family: Helvetica, Arial, sans-serif;
}

/* Visit Counter Styles */
.visit-counter {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    font-family: Helvetica, Arial, sans-serif;
}

.counter-display {
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid #c999ff;
    border-radius: 6px;
    padding: 8px 12px;
    color: #c999ff;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.counter-display:hover {
    background: rgba(201, 153, 255, 0.1);
    border-color: #ffffff;
    color: #ffffff;
}

.city-card {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 10px;
    background: rgba(0, 0, 0, 0.95);
    border: 1px solid #c999ff;
    border-radius: 8px;
    padding: 12px;
    min-width: 250px;
    max-width: 300px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    backdrop-filter: blur(15px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
}

.city-card.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.city-card-header {
    color: #c999ff;
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 8px;
    text-align: center;
    border-bottom: 1px solid #333;
    padding-bottom: 6px;
}

.city-ranking-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 12px;
    color: #e0e0e0;
}

.city-ranking-item:not(:last-child) {
    border-bottom: 1px solid #222;
}

.city-ranking-item .rank {
    color: #c999ff;
    font-weight: bold;
    min-width: 25px;
}

.city-ranking-item .city-name {
    flex: 1;
    margin: 0 8px;
    text-align: left;
}

.city-ranking-item .visit-count {
    color: #999;
    font-size: 11px;
    min-width: 30px;
    text-align: right;
}

.no-data {
    color: #666;
    font-style: italic;
    text-align: center;
    padding: 8px 0;
}

/* Only hide carousels on very small mobile screens */
@media (max-width: 768px) {
    .main-content {
        width: calc(90vw - 40px); /* Use more width on mobile */
        min-width: 280px;
        margin: 10px auto;
        padding: 15px;
    }

    .visit-counter {
        bottom: 10px;
        right: 10px;
    }
    
    .city-card {
        min-width: 200px;
        max-width: 250px;
    }
}
