/* Scanline & CRT Effects */
.main-title-font:lang(ru),
[lang="ru"] .main-title-font {
    font-family: 'Pixelify Sans', 'VT323', monospace !important;
}

.scanlines {
    background: linear-gradient(
        to bottom,
        rgba(0, 255, 0, 0) 50%,
        rgba(0, 255, 0, 0.05) 50%
    );
    background-size: 100% 4px;
    z-index: 100;
}

.crt-flicker {
    animation: flicker 0.15s infinite;
    background: rgba(18, 16, 16, 0.1);
    opacity: 0.1;
    z-index: 101;
}

@keyframes flicker {
    0% { opacity: 0.1; }
    50% { opacity: 0.08; }
    100% { opacity: 0.1; }
}

/* Data Block / Node Styling */
.data-node {
    background: rgba(0, 255, 0, 0.02);
    border: 1px solid rgba(0, 255, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    height: 180px;
}

.data-node:hover {
    background: rgba(0, 255, 0, 0.08);
    border-color: rgba(0, 255, 0, 0.8);
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.2);
    transform: translateY(-5px);
}

.data-node::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 100%;
    background: #00FF00;
    transform: scaleY(0);
    transition: transform 0.3s ease;
    transform-origin: top;
}

.data-node:hover::before {
    transform: scaleY(1);
}

.data-node .node-id {
    font-size: 0.7rem;
    opacity: 0.4;
    letter-spacing: 2px;
}

.data-node .node-text {
    font-size: 0.9rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    line-clamp: 4;
    overflow: hidden;
}

.close-btn {
    z-index: 300;
    pointer-events: auto;
}

/* Modal / Expanded View Animations */
#modal-overlay {
    transition: opacity 0.3s ease;
    overflow-y: auto;
}

#modal-content {
    transform: scale(0.9) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    margin: auto;
    max-height: 85vh;
    overflow-y: auto;
    height: fit-content;
}

#modal-overlay:not(.hidden) {
    display: flex;
}

#modal-overlay:not(.hidden) #modal-content {
    transform: scale(1) translateY(0);
}

.modal-body-container {
    padding-bottom: 2rem;
    height: auto;
    display: flex;
    flex-direction: column;
}

#modal-body {
    height: auto;
    display: block;
}

/* Custom selection */
::selection {
    background: #00FF00;
    color: black;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: black;
}
::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 0, 0.3);
}
::-webkit-scrollbar-thumb:hover {
    background: #00FF00;
}

@media (max-width: 640px) {
    .data-node {
        height: 150px;
    }
    
    #modal-content {
        padding: 2.5rem 1rem 3rem 1rem;
        margin: 1.5rem auto;
        width: 95%;
        max-height: 85vh;
        overflow-y: auto;
        height: auto;
    }

    #modal-title {
        font-size: 1.25rem;
        line-height: 1.3;
        margin-bottom: 1.5rem;
    }

    #modal-body {
        font-size: 0.95rem;
        padding-left: 0.75rem;
    }

    .search-trigger-btn {
        width: 100%;
        text-align: left;
    }

    .close-btn {
        top: 0.5rem;
        right: 0.5rem;
        font-size: 1.5rem;
    }
}

/* Interactive Search Styling */
#search-overlay {
    animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease forwards;
}

.search-trigger-btn {
    background: rgba(0, 255, 0, 0.1);
    border: 1px solid #00FF00;
    color: #00FF00;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    font-family: 'VT323', monospace;
    letter-spacing: 2px;
    transition: all 0.2s ease;
    cursor: pointer;
    text-transform: uppercase;
}

.search-trigger-btn:hover {
    background: #00FF00;
    color: black;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.4);
}

.search-option-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid rgba(0, 255, 0, 0.2);
    background: rgba(0, 255, 0, 0.05);
    transition: all 0.2s ease;
    text-decoration: none;
    color: #00FF00;
}

.search-option-link:hover {
    border-color: #00FF00;
    background: rgba(0, 255, 0, 0.15);
    transform: translateX(10px);
}

.search-option-link i {
    opacity: 0.5;
}

.search-option-link:hover i {
    opacity: 1;
}
