html { scroll-behavior: smooth; }
body { font-family: 'Outfit', sans-serif; background: #0a0a0a; color: #efefef; overflow-x: hidden; }

#offnav-menu, #search-trigger, #announcement-close, #notice-toggle, #share-toggle, #profile-trigger { position: fixed; top: 0; left: 0; opacity: 0; pointer-events: none; width: 0; height: 0; }

.sidebar { position: fixed; top: 0; left: -300px; width: 280px; height: 100%; background: #111; z-index: 9000; transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1); border-right: 1px solid #222; -ms-overflow-style: none; scrollbar-width: none; }
.sidebar::-webkit-scrollbar { display: none; }
#offnav-menu:checked ~ .sidebar { left: 0; }
#offnav-menu:checked ~ .overlay { display: block; }
@media (min-width: 1024px) { .sidebar { left: 0; } body { padding-left: 280px; } .sidebar-toggle-btn { display: none !important; } }

.search-modal { position: fixed; inset: 0; background: rgba(10, 10, 10, 0.98); z-index: 5000; display: none; padding: 40px 24px; backdrop-filter: blur(20px); }
#search-trigger:checked ~ .search-modal { display: block; }
.notice-modal { position: fixed; inset: 0; background: #0a0a0a; z-index: 6000; display: none; padding: 40px 24px; overflow-y: auto; }
#notice-toggle:checked ~ .notice-modal { display: block; }
.share-modal { position: fixed; inset: 0; background: rgba(10, 10, 10, 0.98); z-index: 7000; display: none; padding: 40px 24px; backdrop-filter: blur(20px); }
#share-toggle:checked ~ .share-modal { display: block; }

.overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.8); backdrop-filter: blur(2px); z-index: 3000; display: none; }
#offnav-menu:checked ~ .overlay, #search-trigger:checked ~ .overlay, #notice-toggle:checked ~ .overlay, #share-toggle:checked ~ .overlay, #profile-trigger:checked ~ .overlay { display: block; }

.profile-menu { position: absolute; top: 100%; right: 0; width: 240px; background: rgba(17, 17, 17, 0.95); backdrop-filter: blur(20px); border: 1px solid #222; border-radius: 20px; padding: 12px; margin-top: 12px; transform: translateY(10px); opacity: 0; pointer-events: none; transition: 0.3s; z-index: 4600; box-shadow: 0 10px 40px rgba(0,0,0,0.5); }
#profile-trigger:checked ~ header .profile-menu { transform: translateY(0); opacity: 1; pointer-events: auto; }
.profile-item { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-radius: 12px; color: #888; transition: 0.2s; cursor: pointer; font-size: 13px; font-weight: 600; text-decoration: none; }
.profile-item:hover { background: rgba(255,255,255,0.05); color: #fff; }
.profile-item svg { width: 18px; height: 18px; opacity: 0.6; }
.profile-item:hover svg { opacity: 1; color: #3b82f6; }

header { position: sticky; top: 0; z-index: 4500; background: rgba(10, 10, 10, 0.9); backdrop-filter: blur(12px); border-bottom: 1px solid #1a1a1a; }
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; height: 64px; background: #111; border-top: 1px solid #222; display: flex; align-items: stretch; z-index: 4000; padding-bottom: env(safe-area-inset-bottom); }
.nav-link { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #666; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; transition: 0.2s; cursor: pointer; }
.nav-link svg { width: 22px; height: 22px; margin-bottom: 4px; fill: currentColor; }
.nav-link:hover, .nav-link-active { color: #fff; }

.announcement-bar { background: #111; border-bottom: 1px solid #222; padding: 8px 16px; text-align: center; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: #888; display: flex; align-items: center; justify-content: center; gap: 12px; position: relative; z-index: 2000; }
#announcement-close:checked ~ .announcement-bar { display: none; }

.btn-premium { display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 14px 24px; border-radius: 16px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; font-size: 11px; transition: 0.3s; cursor: pointer; }
.btn-secondary { background: #1a1a1a; color: #888; border: 1px solid #222; }
.btn-secondary:hover { border-color: #333; color: #fff; transform: translateY(-2px); }
.btn-primary { background: #3b82f6; color: #fff; }
.btn-primary:hover { background: #2563eb; transform: translateY(-2px); }

.share-item { background: #111; border: 1px solid #222; border-radius: 20px; padding: 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; transition: 0.3s; color: #888; text-decoration: none; }
.share-item:hover { border-color: #444; color: #fff; background: #161616; transform: translateY(-3px); }

/* GLOWING EFFECT FOR ANNOUNCEMENT BAR */
.announcement-bar-glow {
    position: relative;
    background: #111;
    border-bottom: 2px solid #3b82f6;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
    animation: glow-pulse 3s infinite;
}
@keyframes glow-pulse {
    0% { box-shadow: 0 0 5px rgba(59, 130, 246, 0.2); border-bottom-color: rgba(59, 130, 246, 0.5); }
    50% { box-shadow: 0 0 20px rgba(59, 130, 246, 0.6); border-bottom-color: rgba(59, 130, 246, 1); }
    100% { box-shadow: 0 0 5px rgba(59, 130, 246, 0.2); border-bottom-color: rgba(59, 130, 246, 0.5); }
}

/* Jumper Bar (Index Only) */
.jumper-bar { position: sticky; top: 68px; z-index: 4400; background: rgba(10, 10, 10, 0.8); backdrop-filter: blur(20px); border-bottom: 1px solid rgba(255,255,255,0.05); padding: 12px 0; -ms-overflow-style: none; scrollbar-width: none; overflow-x: auto; white-space: nowrap; }
.jumper-bar::-webkit-scrollbar { display: none; }
.chip { display: inline-block; padding: 8px 20px; border-radius: 20px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); color: #888; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; transition: 0.3s; text-decoration: none; margin-right: 8px; }
.chip:hover { background: rgba(255,255,255,0.1); color: #fff; }
.chip.active { background: #3b82f6; border-color: #3b82f6; color: #fff; }

.pdf-container { position: relative; width: 100%; padding-top: 141.4%; background: #161616; border-radius: 12px; overflow: hidden; border: 1px solid #222; margin-bottom: 30px; }
.pdf-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; }

/* Post Card Styling */
.card { background: #111; border: 1px solid #222; border-radius: 20px; padding: 20px; transition: 0.4s ease; height: 100%; display: flex; flex-direction: column; text-decoration: none; }
.card:hover { border-color: #444; transform: translateY(-4px); background: #161616; box-shadow: 0 20px 40px rgba(0,0,0,0.4); }

/* Desktop Ad Rail Layout */
.layout-wrapper { display: flex; flex-direction: column; min-height: 100vh; width: 100%; }
@media (min-width: 1024px) {
    .layout-main-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 0; align-items: start; width: 100%; }
    .right-ad-rail { 
        position: sticky; 
        top: 68px; 
        height: calc(100vh - 68px); 
        padding: 40px 20px; 
        border-left: 1px solid #1a1a1a; 
        background: #0a0a0a;
        display: block !important;
        z-index: 4300;
        overflow-y: auto;
    }
}

/* AUTO-STYLING FOR RICH NOTICES (No manual tailwind needed) */
.notice-rich-content { font-size: 14px; line-height: 1.6; color: #aaa; }
.notice-rich-content b, .notice-rich-content strong { color: #fff; font-weight: 700; }
.notice-rich-content p { margin-bottom: 1.25rem; }

.notice-table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; background: #111; border: 1px solid #222; border-radius: 12px; overflow: hidden; }
.notice-table th { background: #161616; padding: 12px 16px; text-align: left; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; color: #555; border-bottom: 1px solid #222; }
.notice-table td { padding: 12px 16px; border-bottom: 1px solid #222; color: #efefef; font-size: 13px; }
.notice-table tr:last-child td { border-bottom: none; }
.notice-table tr:nth-child(even) { background: rgba(255,255,255,0.02); }

.notice-list { margin: 1.5rem 0; padding-left: 0; list-style: none; }
.notice-list li { position: relative; padding-left: 1.5rem; margin-bottom: 0.75rem; display: flex; align-items: start; }
.notice-list li::before { content: "▹"; position: absolute; left: 0; color: #3b82f6; font-weight: bold; }

.notice-img { max-width: 100%; height: auto; border-radius: 12px; border: 1px solid #222; margin: 1.5rem 0; }

/* COUNTDOWN STYLING */
.notice-timer { display: inline-flex; gap: 8px; margin-top: 10px; background: rgba(59, 130, 246, 0.05); padding: 10px 16px; border-radius: 16px; border: 1px solid rgba(59, 130, 246, 0.2); font-family: inherit; align-items: center; }
.timer-unit { display: flex; flex-direction: column; align-items: center; min-width: 40px; overflow: hidden; }
.timer-val { font-size: 20px; font-weight: 900; color: #fff; line-height: 1; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.timer-lbl { font-size: 8px; text-transform: uppercase; color: #3b82f6; font-weight: 800; margin-top: 4px; letter-spacing: 0.05em; }
.timer-sep { color: rgba(59, 130, 246, 0.3); font-weight: 900; font-size: 16px; margin-bottom: 12px; }
.timer-suffix { font-size: 11px; font-weight: 800; color: #3b82f6; text-transform: uppercase; margin-left: 8px; letter-spacing: 0.05em; }

/* Digit Change Animation */
.digit-animate { animation: digit-pop 0.3s ease-out; }
@keyframes digit-pop {
    0% { transform: translateY(10px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}
/* Reading Progress Bar */
#reading-progress-container { position: fixed; top: 0; left: 0; width: 100%; height: 3px; background: transparent; z-index: 9999; }
#reading-progress-bar { height: 100%; background: linear-gradient(to right, #3b82f6, #8b5cf6); width: 0%; transition: width 0.1s ease-out; box-shadow: 0 0 10px rgba(59, 130, 246, 0.5); }

/* Dyslexic Font Support */
@font-face { font-family: 'OpenDyslexic'; src: url('https://antijingoist.github.io/opendyslexic/fonts/OpenDyslexic-Regular.woff2') format('woff2'); font-weight: normal; font-style: normal; }
.dyslexic-mode, .dyslexic-mode * { font-family: 'OpenDyslexic', sans-serif !important; letter-spacing: 0.1ch !important; word-spacing: 0.3ch !important; }

/* Side TOC ScrollSpy Polish */
.toc-link.active { color: #3b82f6 !important; font-weight: 700; transform: translateX(4px); }

/* Animations */
@keyframes zoomIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.animate-zoom-in { animation: zoomIn 0.3s ease-out forwards; }
.animate-fade-in-up { animation: fadeInUp 0.4s ease-out forwards; }

/* SKELETON LOADING UI */
.skeleton {
    background: #222;
    background: linear-gradient(90deg, #222 25%, #2a2a2a 50%, #222 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 8px;
}
@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.skeleton-text { height: 1em; margin-bottom: 0.5em; width: 100%; }
.skeleton-img { width: 100%; height: 200px; display: block; }
.loading-image { min-height: 200px; background: #1a1a1a; animation: pulse-bg 1.5s infinite; }
@keyframes pulse-bg { 0% { background: #1a1a1a; } 50% { background: #222; } 100% { background: #1a1a1a; } }
