/* Night/Dark mode styles */

body, .gl-page-background { background: #1a1a1a; }

.gl-entry { color: #e0e0e0; }
.gl-entry-metadata-box { color: #a0a0a0; }

.gl-entry mark
{
    background: #d4a017;
    color: #1a1a1a;
}

.gl-entry u[gl-unusual="ungrammatical"]
{
    border-bottom-color: #6b8cff;
}
.gl-entry u[gl-unusual="misspelled"]
{
    border-bottom-color: #ff6b6b;
}

.gl-entry pre
{
    background: #2d2d2d;
    color: #e0e0e0;
}
.gl-entry :not(pre) > code
{
    background: #3d2a2f;
    color: #ff7b8a;
}
.gl-entry :not(pre) > samp
{
    background: #1e3d1e;
    color: #7dff7d;
}
.gl-entry kbd
{
    color: #e0e0e0;
    background: #3d3d3d;
    border-color: #3d3d3d;
    border-bottom-color: #555;
}
.gl-entry blockquote
{
    border-color: #666;
    color: #b0b0b0;
}

.gl-entry h1, .gl-entry h2 { border-color: #444; }

.gl-entry table > thead > tr > th, .gl-entry table > tbody > tr > td
{ border-color: #444; }

.gl-entry table:not(.gl-suppress-banding) > tbody > tr:nth-child(2n+5),
.gl-entry table:not(.gl-suppress-banding) > tbody > tr:first-child:not(:nth-last-child(-n+3)),
.gl-entry table:not(.gl-suppress-banding) > tbody > tr:nth-child(3):not(:last-child)
{ background-color: rgba(255, 255, 255, 0.03); }

/* Main color for dark mode - softer blue */
.gl-entry a[href]:link { color: #6bb8ff; }
.gl-entry a[href]:visited { color: #9b8cff; }
.gl-entry a[href]:hover { color: #8ecfff; }
.gl-entry a[href]:active { color: #4a9eff; }

.gl-entry footer
{
    color: #888;
}

.gl-entry .gl-dark-theme-forbidden { display: none !important; }

/* Email SVG Styles (Night Mode) - use same color as links */
.gl-eml {
    color: #6bb8ff;
}

.gl-eml svg {
    vertical-align: middle;
}

/* Theme toggle button styles */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid #444;
    background: #2d2d2d;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    /* Prevent text selection on mobile */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.theme-toggle:hover {
    background: #3d3d3d;
    transform: scale(1.1);
}

.theme-toggle:focus {
    outline: 2px solid #6bb8ff;
    outline-offset: 2px;
}

.theme-toggle:active {
    transform: scale(0.95);
}

/* Mobile optimizations */
@media only screen and (max-width: 600px) {
    .theme-toggle {
        top: 12px;
        right: 12px;
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}

/* Touch devices */
@media (hover: none) {
    .theme-toggle:hover {
        transform: none;
    }
}

/* Hide theme toggle when printing */
@media print
{
    .theme-toggle {
        display: none !important;
    }
    
    .gl-entry mark
    {
        border-width: 2px;
        border-style: solid;
        border-color: #d4a017;
        font-weight: bolder;
        padding: 0 0.2em 0.1em 0.2em;
    }
    body, .gl-page-background { background: white !important; }
    .gl-entry { color: black !important; }
    .gl-entry-metadata-box { color: #5a5a5a !important; }
    .gl-entry a[href]:link { color: #0078d7 !important; }
    .gl-entry a[href]:visited { color: #0078d7 !important; }
    .gl-entry a[href]:hover { color: #0078d7 !important; }
    .gl-entry a[href]:active { color: #004275 !important; }
    
    .gl-entry-metadata-box a[href][href]:link { color: #5a5a5a; }
    .gl-entry-metadata-box a[href][href]:hover { color: #5a5a5a; }
    .gl-entry-metadata-box a[href][href]:visited { color: #5a5a5a; }
    .gl-entry-metadata-box a[href][href]:active { color: #5a5a5a; }
    .gl-entry blockquote figcaption a[href][href]:link { color: #444; }
    .gl-entry blockquote figcaption a[href][href]:hover { color: #444; }
    .gl-entry blockquote figcaption a[href][href]:visited { color: #444; }
    .gl-entry blockquote figcaption a[href][href]:active { color: #444; }
    .gl-entry figcaption a[href][href]:link { color: #222; }
    .gl-entry figcaption a[href][href]:hover { color: #222; }
    .gl-entry figcaption a[href][href]:visited { color: #222; }
    .gl-entry figcaption a[href][href]:active { color: #222; }
    footer a[href][href]:link { color: #222; }
    footer a[href][href]:hover { color: #222; }
    footer a[href][href]:visited { color: #222; }
    footer a[href][href]:active { color: #222; }
}
