/* apollinaria/app/static/css/sidebar.css */

.sidenav {
    height: 85%; /* было: 100% - уменьшаем общую высоту */
    width: 0;
    position: fixed;
    z-index: 1;
    top: 5%; /* добавляем отступ сверху для уменьшения высоты */
    left: 0;
    background-color: white;
    overflow-x: hidden;
    overflow-y: auto;
    padding-top: 40px;
    transition: 0.5s;
    border-radius: 0 0 10px 0; /* добавляем закругление снизу */
}

/* Sidebar content layout */
.sidebar-content {
    display: flex;
    height: calc(100vh - 60px);
    gap: 10px;
    padding: 0 10px;
}

.sidebar-menu {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-widget {
    width: 140px;
    min-width: 140px;
    padding: 10px 5px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    position: relative;
    border-left: 1px solid #ddd;
}

.sidenav a {
    padding: 6px 8px 6px 32px; /* было: 8px 8px 8px 32px */
    text-decoration: none;
    font-size: 20px; /* было: 25px */
    color: #252525;
    display: block;
    transition: 0.3s;
}

.sidebar-menu a {
    padding: 6px 8px 6px 32px; /* было: 8px 8px 8px 32px */
    text-decoration: none;
    font-size: 20px; /* было: 25px */
    color: #252525;
    display: block;
    transition: 0.3s;
}

.sidebar-menu a:hover {
    color: #777777;
}

.sidenav a:hover {
    color: #777777;
}

.sidenav .closebtn {
    position: absolute;
    top: 0;
    right: 25px;
    font-size: 36px;
    margin-left: 50px;
}

.icon.open-nav {
    position: fixed;
    top: 10px;
    left: 10px;
    padding: 10px;
    cursor: pointer;
    font-size: 24px;
    z-index: 0;
    color: #444;
}

#content {
    transition: margin-left .5s, margin-top .3s ease-in-out;
    padding: 20px;
}

/* Horizontal Nav Styles */
#horizontal-nav {
    display: flex;
    justify-content: space-between;
    padding: 10px 20px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    gap: 20px;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-sizing: border-box;
}

.horizontal-nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    flex: 1;
}

.horizontal-nav-links a {
    padding: 6px 12px; /* было: 8px 12px */
    text-decoration: none;
    font-size: 14px; /* было: 16px */
    color: #252525;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.horizontal-nav-links a:hover {
    background-color: #e9ecef;
    color: #007bff;
}

.horizontal-nav-widget {
    min-width: 150px;
    max-width: 200px;
    margin-right: 50px;
}

/* Horizontal Cyber Stats Widget */
.cyber-stats-horizontal {
    margin: 0;
    padding: 8px;
    min-height: auto;
    font-size: 9px;
}

.cyber-stats-horizontal .cyber-stats-header {
    margin-bottom: 6px;
}

.cyber-stats-horizontal .cyber-stats-title {
    font-size: 9px;
}

.cyber-stats-horizontal .cyber-eye {
    width: 6px;
    height: 6px;
}

.cyber-stats-horizontal .stat-row {
    margin-bottom: 6px;
}

.cyber-stats-horizontal .stat-label {
    min-width: 25px;
    font-size: 8px;
}

.cyber-stats-horizontal .stat-bar {
    height: 10px;
}

.cyber-stats-horizontal .stat-value {
    min-width: 30px;
    font-size: 7px;
}

.cyber-stats-horizontal .psycho-level {
    margin-top: 8px;
    padding-top: 6px;
}

.cyber-stats-horizontal .psycho-status {
    font-size: 9px;
}

/* ENHANCED EDGERUNNERS-STYLE CYBER STATS WIDGET */
.cyber-stats {
    background: 
        radial-gradient(ellipse at center, rgba(0, 255, 255, 0.02) 0%, transparent 70%),
        linear-gradient(135deg, #000509 0%, #0a0f1c 30%, #1a1a2e 100%);
    border: 2px solid #00ffff;
    border-radius: 6px;
    margin: 5px 0;
    padding: 8px;
    box-shadow: 
        0 0 20px rgba(0, 255, 255, 0.4),
        0 0 40px rgba(0, 255, 255, 0.2),
        inset 0 0 20px rgba(0, 255, 255, 0.1),
        inset 0 0 5px rgba(255, 255, 255, 0.1);
    font-family: 'Courier New', 'Consolas', monospace;
    color: #00ffff;
    position: relative;
    overflow: hidden;
    width: 100%;
    backdrop-filter: blur(1px);
}

/* Enhanced scanning effect */
.cyber-stats:before {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 150%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(0, 255, 255, 0.05) 20%,
        rgba(0, 255, 255, 0.3) 50%, 
        rgba(255, 255, 255, 0.2) 60%,
        rgba(0, 255, 255, 0.05) 80%,
        transparent 100%);
    animation: scanline 6s infinite ease-in-out;
    pointer-events: none;
    z-index: 1;
}

/* Data stream effect */
.cyber-stats:after {
    content: '';
    position: absolute;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(-45deg, 
        transparent 0%, 
        rgba(0, 255, 0, 0.03) 25%,
        rgba(255, 0, 255, 0.03) 50%, 
        rgba(255, 255, 0, 0.03) 75%,
        transparent 100%);
    animation: datastream 8s infinite linear;
    pointer-events: none;
    z-index: 1;
}

@keyframes scanline {
    0% { left: -150%; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { left: 150%; opacity: 0; }
}

@keyframes datastream {
    0% { right: -100%; }
    100% { right: 100%; }
}

.cyber-stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    border-bottom: 1px solid #00ffff;
    padding-bottom: 8px;
    position: relative;
    z-index: 2;
}

.cyber-stats-title {
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 1px;
    text-shadow: 
        0 0 5px #00ffff,
        0 0 10px #00ffff,
        0 0 20px #00ffff;
    position: relative;
}

/* Enhanced eye container */
.cyber-eye-container {
    display: flex;
    gap: 6px;
    position: relative;
}

/* EDGERUNNERS-STYLE CYBER EYES WITH DOUBLING EFFECT */
.cyber-eye {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #ffffff 15%, #00ffff 35%, #0066ff 70%, #001133 100%);
    box-shadow: 
        0 0 8px #00ffff,
        0 0 16px rgba(0, 255, 255, 0.5),
        inset 0 0 3px rgba(255, 255, 255, 0.3);
    animation: pulse 2.5s infinite ease-in-out;
    position: relative;
    z-index: 3;
}

/* White reflection dot */
.cyber-eye:before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 3px;
    height: 3px;
    background: radial-gradient(circle, #ffffff 0%, rgba(255, 255, 255, 0.8) 50%, transparent 100%);
    border-radius: 50%;
    opacity: 0.9;
    z-index: 4;
}

/* Iris detail */
.cyber-eye:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 4px;
    background: radial-gradient(circle, #001133 30%, #0066ff 70%);
    border-radius: 50%;
    z-index: 3;
}

@keyframes pulse {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1);
        box-shadow: 
            0 0 8px #00ffff,
            0 0 16px rgba(0, 255, 255, 0.5);
    }
    50% { 
        opacity: 0.8; 
        transform: scale(1.05);
        box-shadow: 
            0 0 12px #00ffff,
            0 0 24px rgba(0, 255, 255, 0.7);
    }
}

.cyber-stats-body {
    font-size: 10px;
    position: relative;
    z-index: 2;
}

.stat-row {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    gap: 8px;
}

.stat-label {
    min-width: 35px;
    font-weight: bold;
    text-shadow: 
        0 0 3px #00ffff,
        0 0 6px #00ffff;
    font-size: 10px;
    letter-spacing: 0.5px;
}

.stat-bar-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
}

.stat-bar {
    flex: 1;
    height: 16px;
    background: 
        linear-gradient(90deg, rgba(0, 255, 255, 0.1) 0%, rgba(0, 255, 255, 0.05) 100%),
        linear-gradient(0deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.3) 100%);
    border: 1px solid #00ffff;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    box-shadow: 
        inset 0 0 10px rgba(0, 255, 255, 0.2),
        0 0 5px rgba(0, 255, 255, 0.3);
}

/* Enhanced stat fill with gradient and glow */
.stat-fill {
    height: 100%;
    background: linear-gradient(90deg, 
        #00ffff 0%, 
        #00cccc 25%,
        #0099ff 50%,
        #0066ff 75%,
        #003399 100%);
    border-radius: 6px;
    transition: width 0.8s ease-out;
    position: relative;
    width: 0%;
    box-shadow: 
        0 0 10px rgba(0, 255, 255, 0.6),
        inset 0 0 5px rgba(255, 255, 255, 0.3);
}

/* Enhanced glow sweep effect */
.stat-glow {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 30%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.4) 30%,
        rgba(255, 255, 255, 0.6) 50%,
        rgba(255, 255, 255, 0.4) 70%,
        transparent 100%);
    border-radius: 6px;
    opacity: 0;
    animation: glow-sweep 3s infinite ease-in-out;
    pointer-events: none;
}

@keyframes glow-sweep {
    0% { 
        transform: translateX(-150%); 
        opacity: 0; 
    }
    20% { 
        opacity: 1; 
    }
    80% { 
        opacity: 1; 
    }
    100% { 
        transform: translateX(400%); 
        opacity: 0; 
    }
}

.stat-value {
    min-width: 40px;
    text-align: right;
    font-weight: bold;
    text-shadow: 
        0 0 3px #00ffff,
        0 0 6px #00ffff;
    font-size: 9px;
    letter-spacing: 0.5px;
}

.psycho-level {
    margin-top: 18px;
    text-align: center;
    border-top: 1px solid #00ffff;
    padding-top: 12px;
    position: relative;
}

.psycho-status {
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 1.5px;
    text-shadow: 0 0 8px currentColor;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

/* EDGERUNNERS-INSPIRED CYBERPSYCHOSIS LEVELS */

/* Level 0: Stable - Classic Cyan */
.psycho-level-0 .psycho-status {
    color: #00ff00;
    text-shadow: 
        0 0 8px #00ff00,
        0 0 16px #00ff00;
}

/* Level 1: Minor Glitch - Yellow with subtle doubling */
.psycho-level-1 .psycho-status {
    color: #ffff00;
    text-shadow: 
        0 0 8px #ffff00,
        0 0 16px #ffff00,
        1px 0 0 rgba(255, 255, 0, 0.5);
    animation: glitch-light 3s infinite;
}

.psycho-level-1 .cyber-eye {
    animation: pulse 2s infinite, eye-glitch-light 4s infinite;
}

.psycho-level-1 .cyber-eye:after {
    animation: iris-flicker 2s infinite;
}

/* Level 2: System Strain - Orange with more doubling */
.psycho-level-2 .psycho-status {
    color: #ff8800;
    text-shadow: 
        0 0 8px #ff8800,
        0 0 16px #ff8800,
        2px 0 0 rgba(255, 136, 0, 0.6),
        -1px 0 0 rgba(255, 136, 0, 0.4);
    animation: glitch-medium 2s infinite;
}

.psycho-level-2 .cyber-eye {
    animation: pulse 1.5s infinite, eye-glitch-medium 3s infinite;
}

.psycho-level-2 .cyber-eye:before {
    animation: pupil-duplicate 1.5s infinite;
}

.psycho-level-2 .cyber-stats {
    animation: widget-shake 4s infinite;
}

/* Level 3: Critical Error - Red-Orange with heavy distortion */
.psycho-level-3 .psycho-status {
    color: #ff4400;
    text-shadow: 
        0 0 10px #ff4400,
        0 0 20px #ff4400,
        3px 0 0 rgba(255, 68, 0, 0.7),
        -2px 0 0 rgba(255, 68, 0, 0.5),
        0 2px 0 rgba(255, 68, 0, 0.4);
    animation: glitch-heavy 1.2s infinite;
}

.psycho-level-3 .cyber-eye {
    animation: pulse 1s infinite, eye-glitch-heavy 2s infinite;
}

.psycho-level-3 .cyber-eye:before {
    animation: pupil-duplicate 1s infinite, pupil-scatter 2s infinite;
}

.psycho-level-3 .cyber-eye:after {
    animation: iris-chaos 1.5s infinite;
}

.psycho-level-3 .cyber-stats {
    animation: widget-shake 2s infinite, widget-glitch 3s infinite;
}

/* Level 4: CYBERPSYCHOSIS - Full Edgerunners chaos */
.psycho-level-4 .psycho-status {
    color: #ff0000;
    text-shadow: 
        0 0 12px #ff0000,
        0 0 24px #ff0000,
        0 0 36px #ff0000,
        4px 0 0 rgba(255, 0, 0, 0.8),
        -3px 0 0 rgba(255, 0, 0, 0.6),
        0 3px 0 rgba(255, 0, 0, 0.5),
        0 -2px 0 rgba(255, 0, 0, 0.4),
        2px 2px 0 rgba(255, 255, 0, 0.3);
    animation: glitch-critical 0.4s infinite;
}

/* EDGERUNNERS DOUBLED EYES EFFECT */
.psycho-level-4 .cyber-eye {
    animation: pulse 0.3s infinite, eye-glitch-critical 0.8s infinite;
}

.psycho-level-4 .cyber-eye:before {
    animation: pupil-duplicate 0.5s infinite, pupil-chaos 0.3s infinite;
}

.psycho-level-4 .cyber-eye:after {
    animation: iris-chaos 0.4s infinite, iris-multiply 0.6s infinite;
}

/* Create the signature "doubled eyes" effect */
.psycho-level-4 .cyber-eye-container:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: inherit;
    opacity: 0.7;
    animation: eye-double-phantom 0.2s infinite;
}

.psycho-level-4 .cyber-eye-container:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: inherit;
    opacity: 0.5;
    animation: eye-triple-phantom 0.3s infinite;
}

.psycho-level-4 .cyber-stats {
    animation: 
        widget-shake 0.3s infinite, 
        widget-glitch 0.8s infinite, 
        widget-distort 1.5s infinite,
        widget-fracture 2s infinite;
}

/* ENHANCED GLITCH ANIMATIONS */

@keyframes glitch-light {
    0%, 90%, 100% { transform: translateX(0); }
    92% { transform: translateX(1px); }
    94% { transform: translateX(-1px); }
    96% { transform: translateX(0.5px); }
}

@keyframes glitch-medium {
    0%, 85%, 100% { 
        transform: translateX(0) scaleX(1); 
        filter: hue-rotate(0deg);
    }
    87% { 
        transform: translateX(2px) scaleX(1.1); 
        filter: hue-rotate(10deg);
    }
    89% { 
        transform: translateX(-2px) scaleX(0.9); 
        filter: hue-rotate(-10deg);
    }
    91% { 
        transform: translateX(1px) scaleX(1.05); 
        filter: hue-rotate(5deg);
    }
}

@keyframes glitch-heavy {
    0%, 80%, 100% { 
        transform: translateX(0) scaleX(1) skew(0deg); 
        opacity: 1; 
        filter: hue-rotate(0deg) saturate(1);
    }
    82% { 
        transform: translateX(4px) scaleX(1.2) skew(2deg); 
        opacity: 0.8; 
        filter: hue-rotate(30deg) saturate(1.5);
    }
    84% { 
        transform: translateX(-4px) scaleX(0.8) skew(-3deg); 
        opacity: 0.9; 
        filter: hue-rotate(-20deg) saturate(0.8);
    }
    86% { 
        transform: translateX(3px) scaleX(1.15) skew(1deg); 
        opacity: 0.7; 
        filter: hue-rotate(15deg) saturate(1.2);
    }
    88% { 
        transform: translateX(-2px) scaleX(0.95) skew(-1deg); 
        opacity: 1; 
        filter: hue-rotate(-5deg) saturate(1.1);
    }
}

@keyframes glitch-critical {
    0%, 70%, 100% { 
        transform: translateX(0) scaleX(1) skew(0deg) rotateZ(0deg); 
        opacity: 1; 
        filter: hue-rotate(0deg) saturate(1) contrast(1);
    }
    72% { 
        transform: translateX(6px) scaleX(1.4) skew(3deg) rotateZ(1deg); 
        opacity: 0.6; 
        filter: hue-rotate(90deg) saturate(2) contrast(1.5);
    }
    74% { 
        transform: translateX(-5px) scaleX(0.6) skew(-4deg) rotateZ(-2deg); 
        opacity: 0.8; 
        filter: hue-rotate(180deg) saturate(0.5) contrast(2);
    }
    76% { 
        transform: translateX(4px) scaleX(1.2) skew(2deg) rotateZ(0.5deg); 
        opacity: 0.4; 
        filter: hue-rotate(270deg) saturate(1.8) contrast(0.8);
    }
    78% { 
        transform: translateX(-3px) scaleX(0.8) skew(-2deg) rotateZ(-1deg); 
        opacity: 0.9; 
        filter: hue-rotate(45deg) saturate(1.3) contrast(1.2);
    }
}

/* EYE GLITCH ANIMATIONS - EDGERUNNERS STYLE */

@keyframes eye-glitch-light {
    0%, 95%, 100% { 
        opacity: 1; 
        transform: scale(1); 
    }
    97% { 
        opacity: 0.7; 
        transform: scale(1.1); 
    }
}

@keyframes eye-glitch-medium {
    0%, 90%, 100% { 
        opacity: 1; 
        transform: scale(1) translateX(0); 
        filter: hue-rotate(0deg);
    }
    92% { 
        opacity: 0.6; 
        transform: scale(1.2) translateX(2px); 
        filter: hue-rotate(20deg);
    }
    94% { 
        opacity: 0.8; 
        transform: scale(0.9) translateX(-2px); 
        filter: hue-rotate(-15deg);
    }
}

@keyframes eye-glitch-heavy {
    0%, 85%, 100% { 
        opacity: 1; 
        transform: scale(1) translateX(0) translateY(0); 
        filter: brightness(1) contrast(1);
    }
    87% { 
        opacity: 0.5; 
        transform: scale(1.4) translateX(3px) translateY(2px); 
        filter: brightness(1.5) contrast(1.3);
    }
    89% { 
        opacity: 0.7; 
        transform: scale(0.7) translateX(-3px) translateY(-2px); 
        filter: brightness(0.8) contrast(1.8);
    }
    91% { 
        opacity: 0.6; 
        transform: scale(1.2) translateX(2px) translateY(3px); 
        filter: brightness(1.2) contrast(0.9);
    }
}

@keyframes eye-glitch-critical {
    0%, 80%, 100% { 
        opacity: 1; 
        transform: scale(1) translateX(0) translateY(0) rotate(0deg); 
        filter: brightness(1) contrast(1) hue-rotate(0deg);
    }
    82% { 
        opacity: 0.3; 
        transform: scale(1.6) translateX(4px) translateY(3px) rotate(8deg); 
        filter: brightness(2) contrast(2) hue-rotate(60deg);
    }
    84% { 
        opacity: 0.6; 
        transform: scale(0.5) translateX(-4px) translateY(-3px) rotate(-8deg); 
        filter: brightness(0.5) contrast(3) hue-rotate(-45deg);
    }
    86% { 
        opacity: 0.4; 
        transform: scale(1.3) translateX(3px) translateY(4px) rotate(5deg); 
        filter: brightness(1.8) contrast(0.7) hue-rotate(120deg);
    }
    88% { 
        opacity: 0.7; 
        transform: scale(0.8) translateX(-2px) translateY(-2px) rotate(-3deg); 
        filter: brightness(1.1) contrast(1.5) hue-rotate(-20deg);
    }
}

/* PUPIL AND IRIS EFFECTS */

@keyframes iris-flicker {
    0%, 85%, 100% { opacity: 1; }
    90% { opacity: 0.3; }
    95% { opacity: 0.8; }
}

@keyframes pupil-duplicate {
    0%, 60%, 100% { 
        opacity: 0.9; 
        transform: translateX(0); 
    }
    65% { 
        opacity: 1; 
        transform: translateX(4px); 
    }
    70% { 
        opacity: 0.6; 
        transform: translateX(-3px); 
    }
    75% { 
        opacity: 0.9; 
        transform: translateX(2px); 
    }
}

@keyframes pupil-scatter {
    0%, 70%, 100% { 
        transform: translateX(0) translateY(0); 
    }
    75% { 
        transform: translateX(2px) translateY(-1px); 
    }
    80% { 
        transform: translateX(-3px) translateY(2px); 
    }
    85% { 
        transform: translateX(1px) translateY(-2px); 
    }
}

@keyframes pupil-chaos {
    0%, 50%, 100% { 
        transform: translateX(0) translateY(0) scale(1); 
        opacity: 0.8; 
    }
    20% { 
        transform: translateX(3px) translateY(-2px) scale(1.5); 
        opacity: 1; 
    }
    40% { 
        transform: translateX(-4px) translateY(3px) scale(0.5); 
        opacity: 0.6; 
    }
    60% { 
        transform: translateX(2px) translateY(2px) scale(1.2); 
        opacity: 0.9; 
    }
    80% { 
        transform: translateX(-2px) translateY(-3px) scale(0.8); 
        opacity: 0.7; 
    }
}

@keyframes iris-chaos {
    0%, 60%, 100% { 
        transform: scale(1) rotate(0deg); 
        opacity: 1; 
    }
    70% { 
        transform: scale(1.5) rotate(45deg); 
        opacity: 0.8; 
    }
    80% { 
        transform: scale(0.6) rotate(-30deg); 
        opacity: 0.9; 
    }
    90% { 
        transform: scale(1.2) rotate(90deg); 
        opacity: 0.7; 
    }
}

@keyframes iris-multiply {
    0%, 50%, 100% { 
        box-shadow: 
            0 0 0 rgba(0, 102, 255, 0.8),
            0 0 0 rgba(255, 0, 0, 0.6); 
    }
    25% { 
        box-shadow: 
            3px 0 0 rgba(0, 102, 255, 0.8),
            -2px 1px 0 rgba(255, 0, 0, 0.6); 
    }
    75% { 
        box-shadow: 
            -2px -1px 0 rgba(0, 102, 255, 0.8),
            1px 2px 0 rgba(255, 0, 0, 0.6); 
    }
}

/* EDGERUNNERS DOUBLED EYES PHANTOM EFFECTS */

@keyframes eye-double-phantom {
    0%, 80%, 100% { 
        transform: translateX(0) translateY(0); 
        opacity: 0; 
    }
    85% { 
        transform: translateX(12px) translateY(-2px); 
        opacity: 0.7; 
    }
    90% { 
        transform: translateX(-8px) translateY(3px); 
        opacity: 0.5; 
    }
    95% { 
        transform: translateX(6px) translateY(1px); 
        opacity: 0.6; 
    }
}

@keyframes eye-triple-phantom {
    0%, 70%, 100% { 
        transform: translateX(0) translateY(0) scale(1); 
        opacity: 0; 
    }
    75% { 
        transform: translateX(-10px) translateY(4px) scale(1.2); 
        opacity: 0.5; 
    }
    80% { 
        transform: translateX(15px) translateY(-3px) scale(0.8); 
        opacity: 0.4; 
    }
    85% { 
        transform: translateX(-5px) translateY(-2px) scale(1.1); 
        opacity: 0.6; 
    }
    90% { 
        transform: translateX(8px) translateY(5px) scale(0.9); 
        opacity: 0.3; 
    }
}

/* WIDGET EFFECTS */

@keyframes widget-shake {
    0%, 95%, 100% { 
        transform: translateX(0) translateY(0); 
    }
    97% { 
        transform: translateX(2px) translateY(1px); 
    }
    98% { 
        transform: translateX(-2px) translateY(-1px); 
    }
    99% { 
        transform: translateX(1px) translateY(2px); 
    }
}

@keyframes widget-glitch {
    0%, 85%, 100% { 
        border-color: #00ffff; 
        box-shadow: 
            0 0 20px rgba(0, 255, 255, 0.4),
            0 0 40px rgba(0, 255, 255, 0.2); 
    }
    87% { 
        border-color: #ff0000; 
        box-shadow: 
            0 0 30px rgba(255, 0, 0, 0.6),
            0 0 60px rgba(255, 0, 0, 0.3); 
    }
    89% { 
        border-color: #ffff00; 
        box-shadow: 
            0 0 35px rgba(255, 255, 0, 0.5),
            0 0 70px rgba(255, 255, 0, 0.2); 
    }
    91% { 
        border-color: #ff00ff; 
        box-shadow: 
            0 0 25px rgba(255, 0, 255, 0.7),
            0 0 50px rgba(255, 0, 255, 0.3); 
    }
}

@keyframes widget-distort {
    0%, 90%, 100% { 
        transform: perspective(1000px) rotateX(0deg) rotateY(0deg) skew(0deg, 0deg); 
        filter: blur(0px);
    }
    92% { 
        transform: perspective(1000px) rotateX(3deg) rotateY(2deg) skew(2deg, 0deg); 
        filter: blur(0.5px);
    }
    94% { 
        transform: perspective(1000px) rotateX(-2deg) rotateY(-3deg) skew(0deg, 2deg); 
        filter: blur(1px);
    }
    96% { 
        transform: perspective(1000px) rotateX(2deg) rotateY(2deg) skew(-2deg, -1deg); 
        filter: blur(0.3px);
    }
}

@keyframes widget-fracture {
    0%, 88%, 100% { 
        clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%); 
    }
    90% { 
        clip-path: polygon(0% 0%, 98% 2%, 97% 98%, 2% 100%); 
    }
    92% { 
        clip-path: polygon(2% 1%, 100% 0%, 99% 97%, 0% 99%); 
    }
    94% { 
        clip-path: polygon(1% 0%, 99% 1%, 100% 99%, 1% 98%); 
    }
}

/* BAR GLITCH EFFECTS */

.psycho-level-2 .stat-fill {
    animation: glow-sweep 2s infinite, bar-flicker 4s infinite;
}

.psycho-level-3 .stat-fill {
    animation: glow-sweep 1.5s infinite, bar-flicker 2s infinite, bar-distort 3s infinite;
}

.psycho-level-4 .stat-fill {
    animation: glow-sweep 1s infinite, bar-flicker 0.8s infinite, bar-distort 1.5s infinite, bar-corruption 2s infinite;
}

@keyframes bar-flicker {
    0%, 85%, 100% { opacity: 1; }
    87% { opacity: 0.5; }
    89% { opacity: 0.8; }
    91% { opacity: 0.3; }
    93% { opacity: 1; }
}

@keyframes bar-distort {
    0%, 90%, 100% { 
        transform: scaleY(1) skewX(0deg); 
        filter: hue-rotate(0deg);
    }
    92% { 
        transform: scaleY(1.3) skewX(2deg); 
        filter: hue-rotate(30deg);
    }
    94% { 
        transform: scaleY(0.7) skewX(-2deg); 
        filter: hue-rotate(-20deg);
    }
    96% { 
        transform: scaleY(1.1) skewX(1deg); 
        filter: hue-rotate(10deg);
    }
}

@keyframes bar-corruption {
    0%, 80%, 100% { 
        background: linear-gradient(90deg, #00ffff 0%, #0099ff 50%, #0066ff 100%); 
    }
    82% { 
        background: linear-gradient(90deg, #ff0000 0%, #ff4400 50%, #ff6600 100%); 
    }
    84% { 
        background: linear-gradient(90deg, #ffff00 0%, #ff8800 50%, #ffaa00 100%); 
    }
    86% { 
        background: linear-gradient(90deg, #ff00ff 0%, #8800ff 50%, #aa00ff 100%); 
    }
    88% { 
        background: linear-gradient(90deg, #00ff00 0%, #44ff00 50%, #66ff00 100%); 
    }
}

/* Mobile specific styles */
@media only screen and (max-width: 767px) {
    .sidebar-content {
        flex-direction: column;
        height: auto;
    }
    
    .sidebar-widget {
        width: 100%;
        min-width: auto;
        border-left: none;
        border-top: 1px solid #ddd;
        padding: 15px 10px;
        margin-top: 20px;
    }
    
    .cyber-stats {
        width: 100%;
        min-height: 15px;
        padding: 12px;
    }
    
    .cyber-stats-title {
        font-size: 13px;
    }
    
    .cyber-eye {
        width: 12px;
        height: 12px;
    }
    
    .stat-row {
        margin-bottom: 14px;
    }
    
    .stat-bar {
        height: 18px;
    }
    
    .stat-value {
        font-size: 11px;
        min-width: 45px;
    }
    
    .stat-label {
        font-size: 12px;
        min-width: 40px;
    }
    
    .psycho-status {
        font-size: 13px;
    }
    
    /* Скрыть горизонтальный навигационный виджет на мобильных */
    #horizontal-nav {
        display: none !important;
    }
    
    /* Скрыть кибер виджет в sidebar на мобильных */
    #cyber-stats-widget {
        display: none !important;
    }
}

/* Desktop specific styles */
@media only screen and (min-width: 768px) {
    .desktop-only {
        display: flex !important;
    }
    
    .mobile-only {
        display: none !important;
    }
}

@media screen and (max-height: 450px) {
    .sidenav {
        padding-top: 15px;
    }

    .sidebar-menu a {
        font-size: 18px;
        padding: 4px 4px 4px 16px;
    }
    
    .sidebar-widget {
        width: 120px;
        min-width: 120px;
        padding: 4px;
    }
    
    .cyber-stats {
        padding: 6px;
        min-height: 20px;
    }
    
    .cyber-stats-title {
        font-size: 9px;
    }
    
    .stat-value, .stat-label {
        font-size: 8px;
    }
    
    .psycho-status {
        font-size: 10px;
    }
}

/* Общие классы для адаптивности */
.mobile-only {
    display: none;
}

.desktop-only {
    display: block;
}

@media only screen and (max-width: 767px) {
    .mobile-only {
        display: block !important;
    }
    
    .desktop-only {
        display: none !important;
    }
}