/* Dark theme styles - X.com-inspired text colors */
html.dark,
body.dark {
    background-color: #000000;
    color: #e7e9ea; /* X.com's primary text color */
    min-height: 100vh;
    height: 100%;
}

html.dark body,
body.dark {
    background-color: #000000;
    color: #e7e9ea;
}

html.dark .main-content,
html.dark .content-wrapper,
html.dark .page-container,
body.dark .main-content,
body.dark .content-wrapper,
body.dark .page-container {
    background-color: #000000;
    min-height: 100vh;
}

@media (max-width: 768px) {
    html.dark,
    body.dark {
        background-color: #000000 !important;
        min-height: 100vh !important;
        height: 100% !important;
    }

    html.dark .main-content,
    html.dark .content-wrapper,
    html.dark .page-container,
    body.dark .main-content,
    body.dark .content-wrapper,
    body.dark .page-container {
        background-color: #000000 !important;
        min-height: 100vh !important;
    }
}

/* Text Hierarchy (X.com standards) */
html.dark .category-content ul li a:link,
body.dark .category-content ul li a:link {
    color: #e7e9ea !important; /* Soft white */
    transition: color 0.3s ease;
}

html.dark .category-content ul li a:visited,
body.dark .category-content ul li a:visited {
    color: #71767b !important; /* X.com's secondary text */
}

html.dark .category-content ul li a:hover,
body.dark .category-content ul li a:hover {
    color: #e7e9ea !important;
    opacity: 0.8;
}

/* Top Ribbon */
html.dark .top-ribbon,
html.dark .footer-banner,
body.dark .top-ribbon,
body.dark .footer-banner {
    background: #000000 !important;
    color: #e7e9ea;
    box-shadow: 0 4px 25px rgba(255, 255, 255, 0.15);
}

html.dark .top-ribbon .nav-toggle div,
body.dark .top-ribbon .nav-toggle div {
    background: #e7e9ea; /* Soft white */
}

html.dark .top-ribbon .brand-name,
body.dark .top-ribbon .brand-name {
    color: #e7e9ea !important;
}

/* Sidebar */
html.dark .sidebar,
body.dark .sidebar {
    background: #000000 !important;
    color: #e7e9ea;
}

html.dark .sidebar a,
body.dark .sidebar a {
    color: #e7e9ea;
}

/* Links */
html.dark a,
body.dark a {
    color: #e7e9ea !important;
}

/* Category Tiles */
html.dark .category-tile,
body.dark .category-tile {
    background: #000000 !important;
    border-color: rgba(100, 100, 100, 0.3);
    color: #e7e9ea;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.25);
}

html.dark .category-tile:hover,
body.dark .category-tile:hover {
    box-shadow: 0 0 35px rgba(255, 255, 255, 0.25);
}

html.dark .category-tile::after,
body.dark .category-tile::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 4px;
    box-shadow: 
        0 0 35px rgba(255, 255, 255, 0.1),
        0 0 15px rgba(255, 255, 255, 0.05);
    pointer-events: none;
    opacity: 0.8;
    z-index: -1;
}

/* Comments */
html.dark .comments .comment,
body.dark .comments .comment {
    background-color: #000000;
    border-color: rgba(100, 100, 100, 0.3);
}

html.dark .comments .comment-meta,
body.dark .comments .comment-meta {
    color: #71767b; /* X.com's secondary text */
}

html.dark .comments .comment-meta strong,
body.dark .comments .comment-meta strong {
    color: #e7e9ea;
}

html.dark .comments .comment-form,
body.dark .comments .comment-form {
    background-color: rgba(0, 0, 0, 0.9);
    border: 1px solid rgba(100, 100, 100, 0.3);
}

/* Search Results */
html.dark .search-results,
html.dark .search-result-item,
html.dark .search-container,
body.dark .search-results,
body.dark .search-result-item,
body.dark .search-container {
    background-color: #000000 !important;
    color: #e7e9ea !important;
    border-color: #444 !important;
}

html.dark .search-input,
html.dark .search-box,
body.dark .search-input,
body.dark .search-box {
    background-color: #333 !important;
    color: #e7e9ea !important;
    border-color: #555 !important;
}

html.dark .search-result-item a,
body.dark .search-result-item a {
    color: #71767b !important;
    transition: color 0.2s ease;
}

html.dark .search-result-item a:hover,
body.dark .search-result-item a:hover {
    color: #e7e9ea !important;
    opacity: 0.9;
}

/* Theme Toggle */
.theme-toggle {
    background: none;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    transition: background 0.3s ease;
}

.theme-toggle:hover {
    background: rgba(0, 0, 0, 0.1);
}

html.dark .theme-toggle:hover,
body.dark .theme-toggle:hover {
    background: rgba(231, 233, 234, 0.1); /* Using X.com's text color */
}

.theme-toggle svg {
    width: 24px;
    height: 24px;
}

.theme-toggle .sun {
    display: block;
    stroke: #000;
    fill: none;
}

.theme-toggle .moon {
    display: none;
    stroke: #e7e9ea; /* Soft white */
    fill: #e7e9ea;
}

html.dark .theme-toggle .moon,
body.dark .theme-toggle .moon {
    display: block;
}

html.dark .theme-toggle .sun,
body.dark .theme-toggle .sun {
    display: none;
}