/* ================================================
   OBLIVIONSAGE BLOG - CUSTOM CSS
   Terminal Theme with Neon Glow
================================================ */

/* ========== THEME VARIABLES ========== */
:root {
    --bg-dark: #010409;
    --bg-light: #ffffff;
    --fg-dark: #ffffff;
    --fg-light: #1a1a1a;
    --accent-color: #ff6600;
}

[data-theme="dark"] {
    --background: var(--bg-dark);
    --foreground: var(--fg-dark);
    --accent: var(--accent-color);
}

[data-theme="light"] {
    --background: var(--bg-light);
    --foreground: var(--fg-light);
    --accent: var(--accent-color);
}

html[data-theme="light"] body {
    background-color: var(--bg-light);
    color: var(--fg-light);
}

html[data-theme="light"] .terminal-logo {
    color: var(--bg-light);
}

/* ========== CUSTOM SCROLLBAR ========== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--background);
    border: 1px solid rgba(255, 102, 0, 0.2);
}

::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 0;
}

::-webkit-scrollbar-thumb:hover {
    background: #ff8533;
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--accent) var(--background);
}

/* ========== LAYOUT - FULL WIDTH ========== */
.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 25px 50px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.content-wrapper {
    display: flex;
    gap: 60px;
    justify-content: space-between;
}

main {
    flex: 1;
    min-width: 0;
    max-width: 1000px;
}

/* ========== HEADER ========== */
.terminal-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 2px solid var(--accent);
    box-shadow: 0 4px 8px rgba(255, 102, 0, 0.1);
}

.logo-link {
    text-decoration: none;
}

.terminal-logo {
    background: var(--accent);
    color: var(--background);
    padding: 10px 18px;
    font-weight: bold;
    font-size: 1rem;
    white-space: nowrap;
    box-shadow: 0 0 10px rgba(255, 102, 0, 0.3);
    transition: box-shadow 0.3s;
}

.terminal-logo:hover {
    box-shadow: 0 0 15px rgba(255, 102, 0, 0.5);
}

.terminal-bar {
    color: var(--accent);
    letter-spacing: -5px;
    overflow: hidden;
    flex: 1;
    font-weight: bold;
    font-size: 1.8rem;
}

.cursor {
    animation: blink 1s infinite;
    text-shadow: 0 0 8px rgba(255, 102, 0, 0.8);
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.theme-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: var(--accent);
    transition: transform 0.3s;
}

.theme-toggle:hover {
    transform: rotate(180deg);
}

.theme-icon {
    display: block;
}

/* ========== NAVIGATION ========== */
.nav {
    display: flex;
    gap: 30px;
    margin-bottom: 35px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--accent);
    box-shadow: 0 4px 8px rgba(255, 102, 0, 0.15);
    flex-wrap: wrap;
    align-items: center;
}

.nav a {
    color: var(--foreground);
    text-decoration: none;
    transition: color 0.2s, text-shadow 0.2s;
    font-size: 1.05rem;
}

.nav a:hover {
    color: var(--accent);
    text-shadow: 0 0 8px rgba(255, 102, 0, 0.5);
}

/* ========== HERO SECTION ========== */
.hero {
    text-align: center;
    padding: 70px 0;
    margin-bottom: 45px;
    border-bottom: 1px solid var(--accent);
}

.hero-title {
    font-size: 3.2rem;
    margin-bottom: 18px;
}

.hero-subtitle {
    font-size: 1.3rem;
    color: var(--accent);
    margin-bottom: 12px;
}

.hero-skills {
    color: var(--accent);
    font-size: 1.05rem;
    margin-bottom: 18px;
    letter-spacing: 0.5px;
}

.hero-tagline {
    font-size: 1.1rem;
    opacity: 0.6;
}

/* ========== SIDEBAR - RIGHT ALIGNED ========== */
.sidebar {
    width: 280px;
    flex-shrink: 0;
    position: sticky;
    top: 25px;
    height: fit-content;
    align-self: flex-start;
}

.sidebar-section {
    background: rgba(255, 102, 0, 0.03);
    border: 1px solid var(--accent);
    padding: 18px;
    margin-bottom: 18px;
}

.sidebar-title {
    font-size: 0.85rem;
    text-transform: lowercase;
    color: var(--foreground);
    opacity: 0.6;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--accent);
}

.sidebar-search {
    width: 100%;
    padding: 12px 14px;
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--foreground);
    font-family: inherit;
    font-size: 0.9rem;
}

.sidebar-search:focus {
    outline: none;
    box-shadow: 0 0 8px rgba(255, 102, 0, 0.3);
}

.sidebar-search::placeholder {
    color: var(--foreground);
    opacity: 0.4;
}

.sidebar-search-results {
    margin-top: 12px;
}

.sidebar-no-results {
    font-size: 0.85rem;
    opacity: 0.5;
    padding: 5px 0;
}

.sidebar-posts {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 280px;
    overflow-y: auto;
    padding-right: 10px;
}

.sidebar-posts::-webkit-scrollbar {
    width: 6px;
}

.sidebar-posts::-webkit-scrollbar-track {
    background: rgba(255, 102, 0, 0.1);
    border: 1px solid rgba(255, 102, 0, 0.3);
}

.sidebar-posts::-webkit-scrollbar-thumb {
    background: var(--accent);
}

.sidebar-posts::-webkit-scrollbar-thumb:hover {
    background: #ff8533;
}

.sidebar-post {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    text-decoration: none;
    color: var(--foreground);
    font-size: 0.9rem;
    padding: 10px 0;
    border-bottom: 1px dashed rgba(255, 102, 0, 0.2);
    transition: color 0.2s;
}

.sidebar-post:last-child {
    border-bottom: none;
}

.sidebar-post:hover {
    color: var(--accent);
}

.sidebar-post-title {
    flex: 1;
    line-height: 1.4;
}

.sidebar-post-date {
    font-size: 0.8rem;
    opacity: 0.5;
    white-space: nowrap;
}

.sidebar-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-links a {
    color: var(--foreground);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.sidebar-links a:hover {
    color: var(--accent);
}

.sidebar-info {
    font-size: 0.85rem;
    opacity: 0.6;
}

.sidebar-top-btn {
    width: 100%;
    padding: 14px;
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.sidebar-top-btn:hover {
    background: var(--accent);
    color: var(--background);
    box-shadow: 0 0 10px rgba(255, 102, 0, 0.3);
}

/* ========== POST LIST ========== */
.post-list {
    list-style: none;
    margin-left: 0;
    padding: 0;
}

.post-list li {
    padding: 22px 0;
    border-bottom: 1px solid var(--accent);
}

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

.post-title {
    font-size: 1.25rem;
    margin-bottom: 10px;
}

.post-date {
    color: var(--foreground);
    opacity: 0.6;
    font-size: 0.95rem;
}

/* ========== POST META ========== */
.post-meta {
    color: var(--foreground);
    opacity: 0.7;
    font-size: 1rem;
    margin-bottom: 18px;
}

.reading-time {
    margin-left: 5px;
}

/* ========== TAGS ========== */
.post-tags {
    margin-bottom: 28px;
}

.tag {
    display: inline-block;
    background: transparent;
    color: var(--accent);
    padding: 6px 14px;
    margin-right: 12px;
    margin-bottom: 10px;
    border: 1px solid var(--accent);
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.tag:hover {
    background: var(--accent);
    color: var(--background);
    box-shadow: 0 0 12px rgba(255, 102, 0, 0.5);
}

.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.tag-cloud-item {
    display: inline-block;
    background: transparent;
    color: var(--accent);
    padding: 8px 16px;
    border: 1px solid var(--accent);
    text-decoration: none;
    transition: all 0.2s;
}

.tag-cloud-item:hover {
    background: var(--accent);
    color: var(--background);
}

.tag-count {
    opacity: 0.7;
    font-size: 0.85em;
}

/* ========== FOOTER ========== */
.footer {
    margin-top: 70px;
    padding-top: 30px;
    border-top: 2px solid var(--accent);
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}

.footer-links a {
    color: var(--accent);
    text-decoration: none;
    padding: 6px 14px;
    border: 1px solid transparent;
    transition: all 0.3s;
    font-size: 1rem;
}

.footer-links a:hover {
    border-color: var(--accent);
    box-shadow: 0 0 12px rgba(255, 102, 0, 0.4);
    text-shadow: 0 0 8px rgba(255, 102, 0, 0.5);
}

.copyright {
    color: var(--foreground);
    opacity: 0.6;
    font-size: 0.95rem;
}

/* ========== ARTICLE CONTENT ========== */
article {
    line-height: 1.85;
    font-size: 1.1rem;
}

article p {
    margin-bottom: 1.6em;
}

article h1 {
    font-size: 2.2rem;
    margin-bottom: 22px;
}

article h2 {
    font-size: 1.6rem;
    margin-top: 45px;
    margin-bottom: 22px;
}

article h3 {
    font-size: 1.35rem;
    margin-top: 35px;
    margin-bottom: 18px;
}

/* ========== ARTICLE IMAGES - FIXED ========== */
article img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 28px 0;
    border: 4px solid var(--accent);
    padding: 8px;
    background: var(--background);
}

.img-wrapper {
    position: relative;
    display: block;
    cursor: pointer;
    margin: 28px 0;
    max-width: 100%;
}

.img-wrapper img {
    max-width: 100%;
    height: auto;
    margin: 0;
}

.expand-hint {
    position: absolute;
    bottom: 22px;
    right: 22px;
    background: var(--accent);
    color: var(--background);
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.2s;
}

.img-wrapper:hover .expand-hint {
    opacity: 1;
}

.img-wrapper:hover img {
    box-shadow: 0 0 15px rgba(255, 102, 0, 0.3);
}

/* ========== CODE BLOCKS - ALWAYS DARK ========== */
pre {
    background: #0d1117 !important;
    border: 1px solid #30363d !important;
    border-radius: 6px !important;
    padding: 22px !important;
    overflow-x: auto;
    position: relative;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5), inset 0 0 30px rgba(255, 102, 0, 0.03);
    margin: 28px 0;
    font-size: 1rem;
}

pre code {
    background: transparent !important;
    color: #c9d1d9 !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

code {
    background: #0d1117;
    color: #c9d1d9;
    padding: 4px 10px;
    border: 1px solid #30363d;
    border-radius: 4px;
    font-size: 0.92em;
}

.copy-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--accent);
    color: #000;
    border: none;
    padding: 6px 14px;
    font-size: 0.85rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
}

pre:hover .copy-btn {
    opacity: 1;
}

.copy-btn:hover {
    opacity: 0.8 !important;
}

/* Syntax highlighting */
.highlight .k, .highlight .kd, .highlight .kn, .highlight .kp, .highlight .kr, .highlight .kt { color: #ff7b72; }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sb, .highlight .sc, .highlight .sd, .highlight .se, .highlight .sh, .highlight .si, .highlight .sx { color: #a5d6ff; }
.highlight .c, .highlight .c1, .highlight .cm, .highlight .cp, .highlight .cs { color: #8b949e; font-style: italic; }
.highlight .nf, .highlight .fm { color: #d2a8ff; }
.highlight .nn, .highlight .nc { color: #ffa657; }
.highlight .mi, .highlight .mf, .highlight .mh, .highlight .mo { color: #79c0ff; }
.highlight .o, .highlight .ow { color: #ff7b72; }
.highlight .p { color: #c9d1d9; }
.highlight .n, .highlight .na, .highlight .nb, .highlight .ni, .highlight .nl, .highlight .no, .highlight .nv { color: #c9d1d9; }

/* ========== VIDEO EMBED ========== */
.video-container {
    margin: 28px 0;
    border: 4px solid var(--accent);
    padding: 8px;
    background: var(--background);
}

.video-container video {
    width: 100%;
    display: block;
}

/* ========== LIGHTBOX ========== */
.lightbox-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(1, 4, 9, 0.95);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.lightbox-overlay.active {
    display: flex;
}

.lightbox-close-btn {
    position: fixed;
    top: 25px;
    right: 25px;
    width: 50px;
    height: 50px;
    background: transparent;
    border: 2px solid var(--accent);
    color: var(--accent);
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.lightbox-close-btn:hover {
    background: var(--accent);
    color: var(--background);
}

.lightbox-img {
    max-width: 95vw;
    max-height: 90vh;
    border: 4px solid var(--accent);
    padding: 8px;
    background: var(--background);
}

/* ========== PROGRESS BAR ========== */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--accent);
    z-index: 9999;
    transition: width 0.1s;
    width: 0%;
}

/* ========== BACK TO TOP ========== */
.back-to-top {
    position: fixed;
    bottom: 35px;
    right: 35px;
    width: 55px;
    height: 55px;
    background: var(--accent);
    color: var(--background);
    border: none;
    cursor: pointer;
    font-size: 1.6rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 12px rgba(255, 102, 0, 0.5);
}

/* ========== NEON GLOW EFFECTS ========== */
a:hover {
    text-shadow: 0 0 8px rgba(255, 102, 0, 0.5);
}

h1, h2, h3, h4, h5, h6 {
    color: var(--accent);
}

h1 {
    text-shadow: 0 0 6px rgba(255, 102, 0, 0.3);
}

h2 {
    text-shadow: 0 0 4px rgba(255, 102, 0, 0.2);
}

::selection {
    background: var(--accent);
    color: var(--background);
    text-shadow: none;
}

::-moz-selection {
    background: var(--accent);
    color: var(--background);
    text-shadow: none;
}

/* ========== MOBILE RESPONSIVE ========== */
@media (max-width: 1400px) {
    .container {
        padding: 25px 35px;
    }
    
    .sidebar {
        width: 260px;
    }
}

@media (max-width: 1200px) {
    .container {
        max-width: 100%;
        padding: 22px 30px;
    }
    
    main {
        max-width: none;
    }
    
    .sidebar {
        width: 240px;
    }
}

@media (max-width: 900px) {
    .content-wrapper {
        flex-direction: column;
    }
    
    .sidebar {
        display: none;
    }
    
    .container {
        padding: 20px;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 15px;
    }

    .terminal-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .terminal-bar {
        display: none;
    }

    .theme-toggle {
        position: absolute;
        top: 20px;
        right: 15px;
    }

    .terminal-logo {
        font-size: 1rem;
        padding: 10px 20px;
    }

    .nav {
        gap: 15px;
    }

    .hero {
        padding: 35px 0;
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .footer-links {
        gap: 15px;
    }

    article h1 {
        font-size: 1.6rem;
    }

    article h2 {
        font-size: 1.35rem;
    }

    pre {
        padding: 16px !important;
        font-size: 0.9rem !important;
    }

    .copy-btn {
        opacity: 1;
    }

    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 48px;
        height: 48px;
    }

    .expand-hint {
        bottom: 25px;
        right: 25px;
    }

    .img-wrapper {
        display: block;
        width: 100%;
    }

    .img-wrapper img {
        width: 100%;
    }
}
