/* ============================================
   SHARED STYLES — fenekkult's web place
   Спільні стилі для сторінок із сайдбаром:
   index, gallery, videos, texts, ttrpg
   ============================================ */

/* --- ЗМІННІ --- */
:root {
    --main-bg: #050505;
    --accent-yellow: #FFD000;
    --text-white: #E0E0E0;
    --dim-gray: #555555;
    --glitch-red: #ff3333;
}

* { box-sizing: border-box; }

body {
    background-color: #000000;
    color: var(--text-white);
    font-family: Verdana, Geneva, sans-serif;
    margin: 0;
    padding: 20px;
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* --- CRT SCANLINE EFFECT --- */
body::before {
    content: " ";
    display: block;
    position: fixed;
    top: 0; left: 0; bottom: 0; right: 0;
    background: 
        linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%), 
        linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    z-index: 100;
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
}

/* --- SCROLLBAR --- */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #000; }
::-webkit-scrollbar-thumb { background: var(--accent-yellow); border: 1px solid #000; }
::-webkit-scrollbar-thumb:hover { background: #fff; }

/* --- SELECTION --- */
::selection { background: var(--accent-yellow); color: #000000; }

/* --- LAYOUT --- */
.layout {
    display: flex;
    max-width: 1200px;
    margin: 50px auto;
    gap: 30px;
    align-items: flex-start;
    position: relative;
    z-index: 1;
}

/* --- SIDEBAR (LEFT COLUMN) --- */
.left-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 200px;
    flex-shrink: 0;
}

.sidebar {
    width: 100%;
    border: 2px solid var(--accent-yellow);
    background-color: #000;
    padding: 15px;
    text-align: left;
    font-family: "Courier New", Courier, monospace;
}

.sidebar ul { list-style-type: none; padding: 0; margin: 0; }
.sidebar li { margin-bottom: 15px; border-bottom: 1px dashed #333; padding-bottom: 5px; }

/* --- LINKS --- */
a {
    color: var(--accent-yellow);
    text-decoration: none;
    font-weight: bold;
    font-family: "Courier New", Courier, monospace;
    display: block;
    transition: 0.2s;
}

a:hover {
    background-color: var(--accent-yellow);
    color: #000000;
    cursor: help;
    padding-left: 10px;
}

/* --- SYS HOME BUTTON (на підсторінках) --- */
.sys-home-btn {
    display: block;
    text-align: center;
    margin-bottom: 20px;
    color: var(--accent-yellow);
    border: 1px solid var(--accent-yellow);
    padding: 5px;
    text-decoration: none;
    transition: 0.3s;
    white-space: nowrap;
    overflow: hidden;
    font-weight: bold;
}

.sys-home-btn:hover {
    background-color: var(--accent-yellow);
    color: #000 !important;
    cursor: pointer;
    box-shadow: 0 0 5px var(--accent-yellow);
    padding-left: 5px;
}

/* --- CONTENT AREA --- */
.content {
    flex: 1;
    border: 2px solid var(--accent-yellow);
    padding: 30px;
    background-color: #000;
    min-width: 0;
}

/* --- TYPOGRAPHY --- */
h1 {
    font-family: "Courier New", Courier, monospace;
    font-size: 2.5em;
    color: var(--accent-yellow);
    text-transform: uppercase;
    letter-spacing: -2px;
    margin-top: 0;
    text-shadow: 2px 2px 0px #333;
    border-bottom: 1px dashed var(--accent-yellow);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

/* --- FOOTER TEXT --- */
.footer-text {
    font-family: "Courier New", Courier, monospace;
    font-size: small;
    color: var(--dim-gray);
    margin-top: 25px;
    border-top: 1px dashed var(--dim-gray);
    padding-top: 10px;
    text-align: center;
}

/* --- CUSTOM CURSOR --- */
body, body * {
    cursor: none !important;
}

.custom-cursor {
    position: fixed;
    top: 0; left: 0;
    width: 24px;
    height: 24px;
    pointer-events: none;
    z-index: 99999;
    mix-blend-mode: difference;
    transition: transform 0.05s ease-out, opacity 0.3s;
}

/* Хрестик через CSS */
.custom-cursor::before,
.custom-cursor::after {
    content: '';
    position: absolute;
    background: var(--accent-yellow);
}

.custom-cursor::before {
    width: 2px;
    height: 24px;
    left: 11px;
    top: 0;
}

.custom-cursor::after {
    width: 24px;
    height: 2px;
    left: 0;
    top: 11px;
}

/* Курсор збільшується при ховері на інтерактивних елементах */
.custom-cursor.cursor-hover {
    transform: scale(1.5);
}

.custom-cursor.cursor-hover::before,
.custom-cursor.cursor-hover::after {
    background: #fff;
}

/* --- IDLE GLITCH EFFECT --- */
/* --- IDLE GLITCH EFFECT --- */
@keyframes idle-jitter {
    0%, 85%, 100% { 
        transform: translate(0); 
        box-shadow: none; 
        text-shadow: none; 
    }
    87% { 
        transform: translate(-2px, 1px); 
        text-shadow: -2px 0 var(--glitch-red), 2px 0 rgba(0, 255, 255, 0.8); 
        box-shadow: -3px 0 0 rgba(255, 0, 0, 0.4); 
    }
    89% { 
        transform: translate(2px, -1px); 
        text-shadow: 2px 0 var(--glitch-red), -2px 0 rgba(0, 255, 255, 0.8); 
        box-shadow: 3px 0 0 rgba(0, 255, 255, 0.4); 
    }
    91% { 
        transform: translate(-1px, 2px); 
        text-shadow: none; 
        box-shadow: none; 
    }
    93% { 
        transform: translate(1px, -2px); 
        text-shadow: -1px 0 var(--glitch-red); 
    }
}

@keyframes idle-flicker {
    0%, 95%, 100% { opacity: 1; }
    96% { opacity: 0.8; }
    97% { opacity: 1; }
    98% { opacity: 0.6; }
    99% { opacity: 0.9; }
}

@keyframes idle-drift {
    0%, 100% { filter: hue-rotate(0deg) saturate(1); }
    50% { filter: hue-rotate(5deg) saturate(1.2); }
}

body.idle-active {
    animation: idle-flicker 4s infinite, idle-drift 8s infinite;
}

body.idle-active .content,
body.idle-active .sidebar {
    animation: idle-jitter 3s infinite;
}
