/* Terminal Popup - Modern UI */
.terminal-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.4s ease;
    transform: scale(0.95);
}

.terminal-popup.active {
    display: block;
    opacity: 1;
    transform: scale(1);
}

.terminal-popup .terminal-header {
    background: #000000;
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(220, 38, 38, 0.3);
    border-radius: 12px 12px 0 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 10;
}

.terminal-popup.minimized .terminal-header {
    border-radius: 12px;
}

.terminal-popup .terminal-title {
    color: #ffffff;
    font-size: 1.3rem;
    font-weight: 700;
    position: relative;
}

.terminal-popup .terminal-title::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 50%;
    height: 2px;
    background: linear-gradient(to right, #DC2626, transparent);
}

.terminal-popup .terminal-controls {
    display: flex;
    gap: 12px;
}

.terminal-popup .terminal-controls button {
    background: none;
    border: none;
    color: #A1A1AA;
    font-size: 1rem;
    transition: color 0.3s ease, transform 0.3s ease;
    pointer-events: auto;
}

.terminal-popup .terminal-controls button:hover {
    color: #DC2626;
    transform: scale(1.15);
}

.terminal-popup .terminal-close i {
    animation: none;
}

.terminal-popup .terminal-body {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    border: none;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    margin: 0 20px;
    padding: 1.5rem;
    border-radius: 0 0 12px 12px;
    max-height: 80vh;
    overflow-y: auto;
    transition: opacity 0.3s ease, height 0.3s ease;
    position: relative;
    z-index: 5;
}

.terminal-popup.minimized .terminal-body {
    height: 0;
    opacity: 0;
    overflow: hidden;
    padding: 0;
    margin: 0;
}

/* Custom Scrollbar for Modern Look */
.terminal-popup .terminal-body::-webkit-scrollbar {
    width: 6px;
}

.terminal-popup .terminal-body::-webkit-scrollbar-track {
    background: #2A2A3D;
    border-radius: 10px;
}

.terminal-popup .terminal-body::-webkit-scrollbar-thumb {
    background: #DC2626;
    border-radius: 10px;
}

.terminal-popup .terminal-body::-webkit-scrollbar-thumb:hover {
    background: #B91C1C;
}

.terminal-popup .terminal-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.terminal-popup .terminal-menu li {
    margin-bottom: 10px;
    position: relative; /* For hover positioning */
}

.terminal-popup .terminal-menu-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(220, 38, 38, 0.2);
    color: #ffffff;
    padding: 0.75rem 1.25rem;
    width: 100%;
    text-align: left;
    font-size: 1.1rem;
    font-weight: 500;
    border-radius: 8px;
    transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    pointer-events: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.terminal-popup .terminal-menu-btn i {
    font-size: 0.9rem;
    color: #A1A1AA;
    transition: transform 0.3s ease, color 0.3s ease;
}

.terminal-popup .terminal-menu-btn:hover {
    background: linear-gradient(90deg, #DC2626, #B91C1C);
    transform: translateX(5px);
    box-shadow: 0 2px 10px rgba(220, 38, 38, 0.3);
}

.terminal-popup .terminal-menu-btn:hover i {
    color: #ffffff;
    transform: rotate(90deg); /* Rotate arrow on hover/expand */
}

.terminal-popup .terminal-submenu {
    display: none;
    list-style: none;
    padding: 0.5rem 1.5rem;
    margin: 0;
    background: rgba(255, 255, 255, 0.03);
    border-left: 2px solid rgba(220, 38, 38, 0.4);
    border-radius: 0 8px 8px 0;
    position: relative;
}

.terminal-popup .terminal-submenu.active {
    display: block;
}

.terminal-popup .terminal-submenu li {
    margin-bottom: 8px;
    position: relative;
}

.terminal-popup .terminal-submenu a {
    color: #D1D1D6;
    font-size: 1rem;
    font-weight: 400;
    text-decoration: none;
    display: block;
    padding: 0.25rem 0.5rem;
    transition: color 0.3s ease, transform 0.3s ease;
    pointer-events: auto;
    position: relative;
}

.terminal-popup .terminal-submenu a::before {
    content: '>';
    position: absolute;
    left: -1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #DC2626;
    font-size: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.terminal-popup .terminal-submenu a:hover::before {
    opacity: 1;
}

.terminal-popup .terminal-submenu a:hover {
    color: #DC2626;
    transform: translateX(5px);
}

/* Hacking Rain Styles (Unchanged) */
.hacking-rain {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.95), rgba(20, 0, 0, 0.85));
    color: #DC2626;
    font-size: 1.2rem;
    overflow: hidden;
    z-index: 8;
    display: none;
    pointer-events: all;
}

.terminal-popup.minimized .hacking-rain {
    display: block;
}

.hacking-rain .rain-char {
    position: absolute;
    color: #DC2626;
    text-shadow: 0 0 5px rgba(220, 38, 38, 0.5);
    animation: rainFall 4s linear infinite;
    transition: transform 0.1s ease;
}

@keyframes rainFall {
    0% { transform: translateY(-100vh); opacity: 0.8; }
    100% { transform: translateY(100vh); opacity: 0.2; }
}

.hacking-rain .rain-char.repel {
    animation-play-state: paused;
}

.hacking-rain .site-title {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #DC2626;
    font-size: 3rem;
    font-weight: 700;
    z-index: 10;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(220, 38, 38, 0.7);
    pointer-events: none;
}