/* Local IBM Plex Mono fonts */
@font-face {
    font-family: 'IBM Plex Mono';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/static/fonts/ibm-plex-mono-regular.woff2') format('woff2'),
         url('/static/fonts/ibm-plex-mono-regular.ttf') format('truetype');
}

@font-face {
    font-family: 'IBM Plex Mono';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('/static/fonts/ibm-plex-mono-medium.woff2') format('woff2'),
         url('/static/fonts/ibm-plex-mono-medium.ttf') format('truetype');
}

body {
    margin: 0;
    font-family: 'IBM Plex Mono', monospace;
    background: #ffffff;
    font-size: 15px;
    color: #606266;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    transition: background 0.5s, color 0.5s;
}

* {
    box-sizing: border-box;
}

.container {
    width: 1200px;
    max-width: 100%;
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    margin-top: 20px;
}

.header h1 {
    font-size: 27px;
    color: #606266;
    display: flex;
    align-items: center;
    text-transform: uppercase;
}

.header h1 svg {
    width: 64px;
    height: 64px;
    margin-right: 10px;
}

.tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.tab {
    display: flex;
    align-items: center;
    justify-content: center;  /* Ensures the text is centered horizontally */
    padding: 10px 20px;
    cursor: pointer;
    background: #f3f3f3;
    border-radius: 8px;
    transition: 0.2s ease;
    height: 40px; /* You can adjust this to your desired height */
    line-height: 20px; /* Ensure this matches the line-height of your text */
}

.tab.active {
    background: #e0e0e0;
    font-weight: bold;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: flex;
    justify-content: center;
    width: 100%;
}

.three-columns-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    width: 100%;
}

.search-results-container {
    display: flex;
    justify-content: center;
    width: 100%;
}

.posts {
    width: 32%;
    display: flex;
    flex-direction: column;
}

.posts.single-column {
    width: 60%;
    max-width: 800px;
}

.column {
    display: flex;
    flex-direction: column;
    padding: 12px 10px;
    gap: 10px;
    background: #fcfcfd;
    border-radius: 12px;
}

.column h2 {
    font-size: 17px;
    margin-bottom: 10px;
    color: #636b71;
    text-align: center;
    text-transform: uppercase;
    font-weight: 500;
}

/* Stat label/value classes — replaces h2+p pattern in stat columns */
.stats-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.stat-label {
    font-size: 17px;
    margin-bottom: 10px;
    color: #636b71;
    text-align: center;
    text-transform: uppercase;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.stat-value {
    font-size: 25px;
    font-weight: bold;
    text-align: center;
    color: #606266;
    margin: 0;
}

.subreddit-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.subreddit {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    width: 100%;
}

.subreddit-links {
    display: flex;
    gap: 5px;
}

.subreddit-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-grow: 1;
}

.subreddit-name-container {
    display: flex;
    align-items: center;
    flex-grow: 1;
}

.rank {
    font-size: 12px;
    color: #2b343b;
    font-weight: bold;
}

.subreddit h3 {
    font-size: 14px;
    margin: 0;
    color: #2b343b;
    line-height: 20px;
    font-weight: 200 !important;
    margin-right: 10px;
}

.subreddit a {
    color: #2b343b;
    text-decoration: none;
    font-weight: 500;
}

.subreddit img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.subreddit span.subscribers,
.subreddit span.growth {
    font-size: 12px;
    color: inherit;
    line-height: 16px;
    text-align: right;
    white-space: nowrap;
    margin-left: auto;
}

#nsfw .subreddit a, #non-verify .subreddit a, #karma-friendly .subreddit a {
    color: #cc6d7d !important;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}

.btn {
    border: 0;
    height: 32px;
    gap: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    font-size: 14px;
    font-family: 'IBM Plex Mono', monospace;
    border-radius: 8px;
    transition: 0.2s ease;
    --background: transparent;
    border: 1px solid transparent;
    background-color: var(--background);
}

.btn.ghost {
    --background: #f3f3f3;
}

.btn.ghost:hover {
    background-color: var(--background);
}

.btn.grey {
    font-weight: 500;
    padding: 0 12px 0 4px;
    background: #f3f3f3;
}

.btn.grey:hover {
    background: #f9f9f9;
}

.btn.outlined {
    border-radius: 12px;
    --background: #e7e7e7;
    background-color: #fcfcfd;
    color: #2b343b;
    border-color: var(--background);
}

.btn.outlined:hover {
    background: #f6f6f6;
}

/* ── Footer ── */
.footer {
    clear: both;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    color: #606266;
    font-size: 13px;
}

.footer-divider {
    border: none;
    height: 1px;
    background: #e0e0e0;
    margin: 2rem 0 1.5rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 2rem;
    padding-bottom: 1.5rem;
}

.footer-col h4 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #999;
    margin: 0 0 0.75rem 0;
    font-weight: 500;
}

.footer-col p,
.footer-col a {
    margin: 0.35rem 0;
    display: block;
    color: #606266;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-col a:hover {
    color: #fd7e14;
}

.footer-stat {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.footer-stat .label {
    color: #999;
}

.footer-stat .value {
    font-weight: 500;
    color: #606266;
}

.footer-bottom {
    border-top: 1px solid #e0e0e0;
    padding: 1rem 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #606266;
    font-weight: 500;
    font-size: 14px;
}

.footer-brand svg {
    width: 20px;
    height: 20px;
    color: #fd7e14;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: #999;
    text-decoration: none;
    font-size: 12px;
    letter-spacing: 0.5px;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #fd7e14;
}

.footer-cta-row {
    display: flex;
    gap: 10px;
    justify-content: flex-start;
}

.footer-cta {
    font-family: inherit;
    font-size: 12px;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: default;
    transition: transform 0.15s, box-shadow 0.15s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.footer-cta:hover {
    transform: none;
    box-shadow: none;
}

.footer-cta:active {
    transform: none;
    box-shadow: none;
}

.footer-cta.cta-pink {
    background: #FF4E88;
    border-color: #FF4E88;
}

.footer-cta.cta-orange {
    background: #FF8343;
    border-color: #FF8343;
}

/* Night mode footer */
body.night-mode .footer {
    color: #a0a0a0;
}

body.night-mode .footer-divider,
body.night-mode .footer-bottom {
    border-color: #333;
}

body.night-mode .footer-col h4 {
    color: #666;
}

body.night-mode .footer-col p,
body.night-mode .footer-stat .value {
    color: #c0c0c0;
}

body.night-mode .footer-stat .label {
    color: #666;
}

body.night-mode .footer-col a {
    color: #c0c0c0;
}

body.night-mode .footer-col a:hover {
    color: #fd7e14;
}

body.night-mode .footer-brand {
    color: #F8F8F2;
}

body.night-mode .footer-links a {
    color: #666;
}

body.night-mode .footer-links a:hover {
    color: #fd7e14;
}

/* Footer responsive */
@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .footer-bottom {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .footer-links {
        justify-content: center;
    }

    .footer-cta-row {
        justify-content: center;
    }
}

.stats-and-chart {
    display: flex;
    justify-content: space-between;
    width: 100%;
    gap: 3rem;
    margin-bottom: 1rem;
    align-items: center;
}

.stats-container {
    width: 50%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chart-container {
    width: 50%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.row {
    display: flex;
    justify-content: space-between;
    width: 100%;
    gap: 1rem;
}

.column.stat {
    width: 48%;
    text-align: center;
    font-size: 25px;
    font-weight: bold;
}

.full-width {
    width: 100%;
}

/* Toggle Button */
#theme-toggle {
    display: none;
}

.theme-toggle-label {
    position: fixed;
    bottom: 20px;
    left: 20px;
    cursor: pointer;
    z-index: 1000;
}

.toggle-container {
    width: 70px;
    height: 30px;
    background-color: #0d1117;
    border-radius: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
    padding: 5px;
    position: relative;
    transition: background 0.5s;
    overflow: hidden;
}

.icon svg {
    stroke: #fff;
    stroke-width: 1.5px;
    width: 19px;
}

.toggle-dark-icon {
    margin-left: 12px;
    margin-top: 1px;
}

.toggle-dark-icon svg {
    transition: transform 0.9s;
    transform: translateX(0px);
}

.toggle-light-icon {
    margin-top: 2px;
}

.toggle-light-icon svg {
    transform-origin: center;
    transform: scale(0.7) rotate(0deg);
    position: relative;
    right: 30px;
    transition: transform 0.9s, right 0.5s;
}

.toggle-circle {
    width: 24px;
    height: 24px;
    position: absolute;
    background-color: #fff;
    border-radius: 50%;
    left: 5%;
    transition: left 0.5s;
}

#theme-toggle:checked ~ .theme-toggle-label .toggle-container {
    background: #fd7e14;
}

#theme-toggle:checked ~ .theme-toggle-label .toggle-circle {
    left: 62%;
}

#theme-toggle:checked ~ .theme-toggle-label .toggle-light-icon svg {
    transform: scale(1) rotate(180deg);
    right: 0px;
}

#theme-toggle:checked ~ .theme-toggle-label .toggle-dark-icon svg {
    transform: translateX(30px);
}

/* Night mode styles */
body.night-mode {
    background: #212121;
    color: #F8F8F2;
}

body.night-mode .header h1 {
    color: #ffffff;
}

body.night-mode .column {
    background: #27292c;
}

body.night-mode .column h2 {
    color: #d0f2ff;
}

body.night-mode .stat-label {
    color: #d0f2ff;
}

body.night-mode .stat-value {
    color: #F8F8F2;
}

body.night-mode .subreddit {
    color: #F8F8F2;
}

body.night-mode .subreddit a {
    color: #ccf7ff;
}

body.night-mode #nsfw .subreddit a,
body.night-mode #non-verify .subreddit a,
body.night-mode #karma-friendly .subreddit a {
    color: #ffcdfc !important;
}

body.night-mode .pagination .btn {
    color: #F8F8F2;
    border-color: #75715E;
}

body.night-mode .pagination .btn:hover {
    background-color: #75715E;
}

body.night-mode .pagination .btn.outlined {
    background-color: #272822;
    color: #A6E22E;
    border-color: #A6E22E;
}

body.night-mode .pagination .btn.outlined:hover {
    background: #49483E;
}

body.night-mode .tab {
    background: #2a2a2a;
    color: #d1d5db;
}

body.night-mode .tab.active {
    background: #3a3a3a;
    color: #ffffff;
}

body.night-mode .link-icon {
    filter: invert(1) sepia(1) saturate(5) hue-rotate(180deg);
}

body.night-mode .column.full-width.heatmap {
    background: none;
}

#spinning-svg {
    animation: spin 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards,
               pop 0.2s ease-out 1s forwards; /* Pop after spin ends */
    color: #FF5700;
}

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

@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); } /* Expand slightly */
    100% { transform: scale(1); }  /* Return to original size */
}

/* Media Queries */
@media screen and (max-width: 768px) {
    .header h1 {
        font-size: 20px;
    }
    .stats-and-chart h2,
    .stats-and-chart .stat-label {
        font-size: 16px !important;
    }
    #spinning-svg {
        width: 48px !important;
        height: 48px !important;
    }
    .container {
        width: 95%;
        padding: 0 10px;
    }
    .tab-content {
        flex-direction: column;
    }
    .three-columns-container {
        flex-direction: column;
        gap: 1rem;
    }
    .posts {
        width: 100% !important;
    }
    .posts.single-column {
        width: 100%;
    }
    .stats-and-chart {
        flex-direction: column;
    }
    .stats-container,
    .chart-container {
        width: 100%;
    }
    .row {
        flex-wrap: wrap;
    }

    .search-filter-container {
        gap: 10px;
        margin-bottom: 15px;
    }
    
    .type-buttons {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .type-btn {
        font-size: 12px;
        padding: 6px 12px;
    }

    .filter-buttons {
        gap: 5px;
        justify-content: center;
        flex-wrap: wrap;
    }
}

/* Search and Filter */
.search-filter-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.search-filter-container input {
    padding: 8px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-family: 'IBM Plex Mono', monospace;
    transition: border-color 0.2s;
}

.search-filter-container input:focus {
    border-color: #999;
    outline: none;
}

.filter-buttons {
    display: flex;
    gap: 10px;
}

.filter-btn {
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-family: 'IBM Plex Mono', monospace;
    background: #f3f3f3;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    color: black;
}

.filter-btn:hover {
    background: #e0e0e0;
}

.filter-btn.active {
    background: #ccc;
    border-color: #999;
}

@media screen and (max-width: 768px) {
    .search-filter-container {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }
}

/* Search Container */
.search-container {
    position: relative;
    width: 100%;
    margin-bottom: 1rem;
}

#search-input {
    width: 80%;
    display: block;
    margin: auto;
    padding: 8px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-family: 'IBM Plex Mono', monospace;
    transition: border-color 0.2s;
}

#search-input:focus {
    border-color: #999;
    outline: none;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 8px;
    z-index: 1000;
}

.search-result {
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-result:hover {
    background: #e6e6e6;
}

.link-icon, .search-icon {
    width: 15px !important;
    height: auto !important;
    border-radius: 0 !important;
}

body.night-mode .link-icon .search-icon {
    filter: invert(80%) !important; /* Change to grey for dark theme */
}

.visit-subreddit-button-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-top: 20px;
}

.button-74 {
    background-color: #ebeaea;
    border: 2px solid #422800;
    border-radius: 5px;
    box-shadow: #422800 4px 4px 0 0;
    color: #422800;
    cursor: pointer;
    display: inline-block;
    font-weight: 600;
    font-size: 25px;
    padding: 0 18px;
    line-height: 50px;
    text-align: center;
    text-decoration: none;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

.button-74:hover {
    background-color: #fff;
}

.button-74:active {
    box-shadow: #422800 2px 2px 0 0;
    transform: translate(2px, 2px);
}

@media (min-width: 768px) {
    .button-74 {
        min-width: 120px;
        padding: 0 25px;
    }
}

.visit-subreddit-button-container.upvote .button-74 {
    font-size: 15px;
    text-transform: uppercase;
    padding: 0 10px;
    margin: 5px;
    background-color: #fff8ea;
}

.column.full-width.heatmap {
    background: white;
}

.visit-subreddit-button-container.upvote svg {
    width: 15px;
    vertical-align: middle;
}

.stats-and-chart h2,
.stats-and-chart .stat-label {
    font-size: 15px;
}

span.growth {
    color: #75cd75 !important;
    margin-left: 5px !important;
}

/* Legacy footer-btn kept for backwards compat */
.footer-btn-wrapper { display: none; }    

.basic-information {
    margin: 2rem 0;
    background: none;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
}

.part-a, .part-b {
    width: 100% !important;
    min-width: 0;
    box-sizing: border-box;
    margin-bottom: 3rem;
}

.part-a {
    background: #fcfcfd;
    border-radius: 12px;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.part-b {
    background: #fcfcfd;
    border-radius: 12px;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.subreddit-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.subreddit-icon {
    width: 100px;
    height: 100px;
    border-radius: 100%;
}

.subreddit-header h2 {
    font-size: 24px;
    color: #2b343b;
    margin: 0;
}

.subreddit-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.detail-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.detail-icon {
    color: #606266;
    flex-shrink: 0;
}

.detail-text {
    color: #606266;
    font-size: 14px;
    line-height: 1.5;
}

/* Subreddit Summary styles */
.subreddit-summary {
    background: #fcfcfd;
    border-radius: 12px;
    padding: 0;
    border: none;
}

.subreddit-summary h2 {
    font-size: 17px;
    color: #636b71;
    margin: 0 0 1rem 0;
    font-weight: 500;
    text-align: center;
    text-transform: uppercase;
}

.summary-content {
    color: #2b343b;
    font-size: 14px;
    line-height: 1.6;
}

.summary-placeholder {
    color: #636b71;
    font-style: italic;
    text-align: center;
}

.summary-placeholder p {
    margin: 0;
    font-size: 14px;
}

/* Night mode styles */
body.night-mode .basic-information {
    background: none;
}

body.night-mode .part-a,
body.night-mode .part-b {
    background: #27292c;
}

body.night-mode .subreddit-header h2 {
    color: #ffffff;
}

body.night-mode .detail-icon,
body.night-mode .detail-text {
    color: #a0a0a0;
}

/* Mobile responsiveness */
@media screen and (max-width: 768px) {
    .basic-information {
        flex-direction: column;
        padding: 1rem;
    }

    .part-a, .part-b {
        width: 100%;
    }

    .subreddit-header {
        margin-bottom: 1rem;
    }

    .subreddit-icon {
        width: 80px;
        height: 80px;
    }

    .subreddit-header h2 {
        font-size: 20px;
    }
}

/* Add more styles as needed to match your design */

/* Night mode subreddit summary styles */
body.night-mode .subreddit-summary {
    background: #27292c;
}

body.night-mode .subreddit-summary h2 {
    color: #d0f2ff;
}

body.night-mode .summary-content {
    color: #F8F8F2;
}

body.night-mode .summary-placeholder {
    color: #a0a0a0;
}

/* === Layout tweaks for repositioning === */
.stats-and-chart .part-a {
    width: 50% !important;
    margin-bottom: 0;
}

/* Hide original part-a inside basic-information */
.basic-information .part-a {
    display: none;
}

.heatmap-and-chart {
    display: flex;
    justify-content: space-between;
    width: 100%;
    gap: 3rem;
    margin-top: 1rem;
    align-items: center;
}

.heatmap-and-chart .heatmap,
.heatmap-and-chart .chart-container {
    width: 50%;
}

.column.heatmap {
    background: white;
}

body.night-mode .column.heatmap {
    background: none;
}

@media screen and (max-width: 768px) {
    .heatmap-and-chart {
        flex-direction: column;
    }
    .heatmap-and-chart .heatmap,
    .heatmap-and-chart .chart-container {
        width: 100%;
    }
    .stats-and-chart .part-a {
        width: 100% !important;
        margin-bottom: 3rem;
    }
}
/* === End layout tweaks === */

.container > .basic-information {
    order: 5;
}

.type-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.type-btn {
    padding: 8px 16px;
    background: #f3f3f3;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    transition: 0.2s ease;
}

.type-btn:hover {
    background: #e8e8e8;
}

.type-btn.active {
    background: #e0e0e0;
    font-weight: bold;
}

body.night-mode .type-btn {
    background: #2a2a2a;
    color: #d1d5db;
}

body.night-mode .type-btn:hover {
    background: #333333;
}

body.night-mode .type-btn.active {
    background: #3a3a3a;
    color: #ffffff;
}

.no-results {
    text-align: center;
    padding: 30px 20px;
    color: #999;
    font-style: italic;
}

body.night-mode .no-results {
    color: #777;
}

/* Subranking Tips Card Styles */
.subranking-tips-card {
  width: 100%;
  max-width: 600px;
  margin: 20px auto;
  height: auto;
  border-radius: 8px;
  box-sizing: border-box;
  padding: 15px 20px;
  background-color: #ffffff;
  box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 15px;
}

.subranking-tips-icon-container {
  width: 35px;
  height: 35px;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #04e40048;
  border-radius: 50%;
  margin-left: 8px;
  flex-shrink: 0;
}

.subranking-tips-icon {
  width: 17px;
  height: 17px;
  color: #269b24;
}

.subranking-tips-message-text-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  flex-grow: 1;
}

.subranking-tips-message-text,
.subranking-tips-sub-text {
  margin: 0;
  cursor: default;
}

.subranking-tips-message-text {
  color: #269b24;
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 8px;
}

.subranking-tips-sub-text {
  font-size: 14px;
  color: #555;
  width: 100%;
}

.subranking-tips-sub-text ul {
  margin: 0;
  padding-left: 1rem;
  list-style-type: disc;
}

.subranking-tips-sub-text li {
  margin-bottom: 8px;
  line-height: 1.4;
}

/* Dark mode support for tips card */
body.night-mode .subranking-tips-card {
  background-color: #2a2a2a;
  box-shadow: rgba(0, 0, 0, 0.3) 0px 8px 24px;
}

body.night-mode .subranking-tips-sub-text {
  color: #ccc;
}

/* Responsive design for tips card */
@media screen and (max-width: 768px) {
  .subranking-tips-card {
    margin: 15px auto;
    padding: 12px 15px;
    gap: 12px;
    max-width: 95%;
  }
  
  .subranking-tips-icon-container {
    width: 30px;
    height: 30px;
    margin-left: 4px;
  }
  
  .subranking-tips-icon {
    width: 15px;
    height: 15px;
  }
  
  .subranking-tips-message-text {
    font-size: 16px;
  }
  
  .subranking-tips-sub-text {
    font-size: 13px;
  }
  
  .subranking-tips-sub-text ul {
    padding-left: 0.8rem;
  }
  
  .subranking-tips-sub-text li {
    margin-bottom: 6px;
  }
}

@media screen and (max-width: 480px) {
  .subranking-tips-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
  }
  
  .subranking-tips-icon-container {
    align-self: center;
    margin-left: 0;
  }
  
  .subranking-tips-message-text-container {
    align-items: center;
    text-align: center;
  }
  
  .subranking-tips-message-text {
    font-size: 15px;
  }
  
  .subranking-tips-sub-text {
    font-size: 12px;
  }
}

/* === v1.4 Content Sections === */

.content-section {
    background: #fcfcfd;
    border-radius: 12px;
    padding: 12px 10px;
    margin-top: 1rem;
}

.content-section h2 {
    font-size: 17px;
    color: #636b71;
    margin: 0 0 1rem 0;
    font-weight: 500;
    text-align: center;
    text-transform: uppercase;
}

.content-section h3 {
    font-size: 14px;
    color: #2b343b;
    font-weight: 500;
    margin: 0 0 0.25rem 0;
}

.content-section p {
    color: #606266;
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 0.75rem 0;
}

.content-section p:last-child {
    margin-bottom: 0;
}

.content-section .growth-trend {
    color: #636b71;
    font-style: italic;
}

/* Growth cards grid */
.growth-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.growth-card {
    background: #fff;
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid #e7e7e7;
    text-align: center;
}

.growth-card .label {
    font-size: 12px;
    color: #636b71;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.growth-card .value {
    font-size: 20px;
    font-weight: bold;
}

.growth-card .value.positive { color: #75cd75; }
.growth-card .value.negative { color: #cc6d7d; }

.growth-card .sub {
    font-size: 12px;
    color: #a4a4a4;
}

/* Milestones list */
.milestone-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.milestone-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e7e7e7;
    font-size: 14px;
}

.milestone-item:last-child {
    border-bottom: none;
}

.milestone-item .milestone-label {
    color: #2b343b;
}

.milestone-item .milestone-date {
    color: #a4a4a4;
    font-size: 13px;
}

/* FAQ section */
.faq-item {
    margin-bottom: 1rem;
}

.faq-item:last-child {
    margin-bottom: 0;
}

/* Compare section */
.compare-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.compare-list li {
    padding: 0.4rem 0;
    border-bottom: 1px solid #e7e7e7;
    font-size: 14px;
}

.compare-list li:last-child {
    border-bottom: none;
}

.compare-list a {
    color: #2b343b;
    text-decoration: none;
    font-weight: 500;
}

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

.compare-list .compare-subs {
    color: #a4a4a4;
    font-size: 13px;
    margin-left: 0.5rem;
}

/* Custom compare button */
.compare-custom {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e7e7e7;
}

.compare-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #f3f3f3;
    border: 1px solid #e7e7e7;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    color: #2b343b;
    transition: background 0.2s;
    width: 100%;
    justify-content: center;
}

.compare-btn:hover {
    background: #e8e8e8;
}

/* Compare search overlay */
.compare-search-wrapper {
    margin-top: 0.5rem;
    display: none;
}

.compare-search-wrapper.active {
    display: block;
}

.compare-search-input {
    width: 100%;
    padding: 8px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-family: 'IBM Plex Mono', monospace;
    transition: border-color 0.2s;
}

.compare-search-input:focus {
    border-color: #999;
    outline: none;
}

.compare-search-results {
    max-height: 200px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #e7e7e7;
    border-radius: 8px;
    margin-top: 4px;
}

.compare-search-results .search-result {
    padding: 8px 10px;
    cursor: pointer;
    font-size: 13px;
    color: #2b343b;
    border-bottom: 1px solid #f0f0f0;
}

.compare-search-results .search-result:last-child {
    border-bottom: none;
}

.compare-search-results .search-result:hover {
    background: #f3f3f3;
}

/* Related subreddits */
.related-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.related-list li {
    padding: 0.4rem 0;
    border-bottom: 1px solid #e7e7e7;
    font-size: 14px;
}

.related-list li:last-child {
    border-bottom: none;
}

.related-list a {
    color: #2b343b;
    text-decoration: none;
    font-weight: 500;
}

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

.related-list .subscriber-count {
    color: #a4a4a4;
    font-size: 13px;
    margin-left: 0.5rem;
}

/* Last updated */
.last-updated {
    font-size: 13px;
    color: #a4a4a4;
    text-align: right;
    margin-top: 1rem;
}

/* Night mode for v1.4 sections */
body.night-mode .content-section {
    background: #27292c;
}

body.night-mode .content-section h2 {
    color: #d0f2ff;
}

body.night-mode .content-section h3 {
    color: #F8F8F2;
}

body.night-mode .content-section p {
    color: #c0c0c0;
}

body.night-mode .content-section .growth-trend {
    color: #a0a0a0;
}

body.night-mode .growth-card {
    background: #1e1e1e;
    border-color: #3a3a3a;
}

body.night-mode .growth-card .label {
    color: #a0a0a0;
}

body.night-mode .growth-card .sub {
    color: #777;
}

body.night-mode .milestone-item {
    border-color: #3a3a3a;
}

body.night-mode .milestone-item .milestone-label {
    color: #F8F8F2;
}

body.night-mode .milestone-item .milestone-date {
    color: #777;
}

body.night-mode .compare-list li {
    border-color: #3a3a3a;
}

body.night-mode .compare-list a {
    color: #ccf7ff;
}

body.night-mode .compare-list .compare-subs {
    color: #777;
}

body.night-mode .compare-btn {
    background: #2a2a2a;
    border-color: #3a3a3a;
    color: #d1d5db;
}

body.night-mode .compare-btn:hover {
    background: #333;
}

body.night-mode .compare-search-input {
    background: #1e1e1e;
    border-color: #3a3a3a;
    color: #F8F8F2;
}

body.night-mode .compare-search-results {
    background: #1e1e1e;
    border-color: #3a3a3a;
}

body.night-mode .compare-search-results .search-result {
    color: #F8F8F2;
    border-color: #2a2a2a;
}

body.night-mode .compare-search-results .search-result:hover {
    background: #333;
}

body.night-mode .related-list li {
    border-color: #3a3a3a;
}

body.night-mode .related-list a {
    color: #ccf7ff;
}

body.night-mode .related-list .subscriber-count {
    color: #777;
}

body.night-mode .last-updated {
    color: #777;
}

body.night-mode .faq-item h3 {
    color: #F8F8F2;
}

body.night-mode .compare-custom {
    border-color: #3a3a3a;
}

/* Mobile for v1.4 sections */
@media screen and (max-width: 768px) {
    .growth-cards {
        grid-template-columns: 1fr;
    }

    .growth-card .value {
        font-size: 18px;
    }

    .milestone-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
}

/* === Breadcrumb === */
.breadcrumb {
    padding: 0;
    font-size: 13px;
    color: #a4a4a4;
    text-align: center;
}

.breadcrumb a {
    color: #636b71;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb-sep {
    margin: 0 0.4rem;
    color: #ccc;
}

.breadcrumb-current {
    color: #2b343b;
    font-weight: 500;
}

body.night-mode .breadcrumb a {
    color: #a0a0a0;
}

body.night-mode .breadcrumb-sep {
    color: #555;
}

body.night-mode .breadcrumb-current {
    color: #d1d5db;
}

/* === Subreddit Tabs === */
.subreddit-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 0.5rem;
    flex-wrap: nowrap;
    padding-bottom: 2px;
}

.subreddit-tabs::-webkit-scrollbar {
    display: none;
}

.subreddit-tabs .tab {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    padding: 8px 16px;
    font-size: 13px;
}

.subreddit-tabs .tab svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Subreddit tab content uses block layout (vertical) instead of flex */
#subreddit-stats .tab-content.active {
    display: block;
    width: 100%;
}

@media screen and (max-width: 768px) {
    .subreddit-tabs {
        justify-content: flex-start;
    }
}