/**
 * CSS Styling for Bug Mohol Cyberpunk / Security Theme
 */

/* Baseline Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html {
    width: 100%;
    height: 100vh;
    background-color: #030a03; /* Very dark green-black */
    background-image: radial-gradient(circle at center, #0a140a 0%, #000 100%);
    font-family: 'Share Tech Mono', 'Courier New', Courier, monospace;
    color: #00ff00; /* Hacker Green */
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

/* CRT Scanlines and Flickering overlay */
.overlay-scanline {
    position: absolute;
    top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(
        to bottom,
        rgba(255,255,255,0),
        rgba(255,255,255,0) 50%,
        rgba(0,0,0,0.2) 50%,
        rgba(0,0,0,0.2)
    );
    background-size: 100% 4px;
    z-index: 10;
    pointer-events: none;
    opacity: 0.8;
}

/* Frosted Glass Navigation Bar */
.glass-nav {
    position: absolute;
    top: 20px; left: 50%;
    transform: translateX(-50%);
    width: 90%;
    height: 70px;
    /* Glassmorphism properties */
    background: rgba(0, 255, 0, 0.03); /* slight green tint */
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(0, 255, 0, 0.15);
    box-shadow: 0 8px 32px 0 rgba(0, 100, 0, 0.2);
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    z-index: 1000;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.nav-logo span {
    color: #00ff00;
    animation: blink 1s step-end infinite;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: #00ff00;
    text-decoration: none;
    font-size: 1.1rem;
    padding: 8px 12px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.nav-links a:hover {
    background: rgba(0, 255, 0, 0.15);
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.3);
    text-shadow: 0 0 5px #00ff00;
}

/* Main Container centered layout */
.container {
    padding-top: 100px;
    position: relative;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem; /* Spacing between logo and terminal */
}

/* ==========================================
   GLITCH ANIMATION CONFIGURATION
   ========================================== */
.glitch-wrapper {
    position: relative;
    width: 150px;
    height: 150px;
}

.logo-img {
    width: 100%;
    height: 100%;
    display: block;
    border: 1px solid #00ff00;
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.4);
    filter: drop-shadow(0 0 5px #00ff00);
}

/* Red and Blue pseudo-element copies for glitch slicing */
.glitch-wrapper::before,
.glitch-wrapper::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* We match the src of the logo image here */
    background-image: url('Bug Mohol Logo (2).png');
    background-size: cover;
    border-radius: 50%;
    opacity: 0; /* Hidden by default perfectly hiding the glitch */
}

.glitch-wrapper::before {
    left: 3px;
    filter: drop-shadow(-2px 0 red);
    animation: glitch-slice-1 4s infinite linear alternate-reverse;
}

.glitch-wrapper::after {
    left: -3px;
    filter: drop-shadow(2px 0 cyan);
    animation: glitch-slice-2 5s infinite linear alternate-reverse;
}

/* The glitch animations trigger only at the end of the % cycle for brevity/subtlety */
@keyframes glitch-slice-1 {
    0%, 90% { opacity: 0; clip-path: inset(0 0 0 0); transform: translate(0); }
    91% { opacity: 0.8; clip-path: inset(20% 0 70% 0); transform: translate(-3px, 1px) skewX(2deg); }
    93% { opacity: 0.8; clip-path: inset(60% 0 10% 0); transform: translate(3px, -1px) skewX(-2deg); }
    95% { opacity: 0.8; clip-path: inset(10% 0 50% 0); transform: translate(-2px, 2px); }
    97%, 100% { opacity: 0; clip-path: inset(50% 0 50% 0); transform: translate(0); }
}

@keyframes glitch-slice-2 {
    0%, 85% { opacity: 0; clip-path: inset(0 0 0 0); transform: translate(0); }
    86% { opacity: 0.9; clip-path: inset(80% 0 5% 0); transform: translate(3px, -2px) skewX(-3deg); }
    88% { opacity: 0.9; clip-path: inset(5% 0 80% 0); transform: translate(-3px, 2px) skewX(3deg); }
    90% { opacity: 0.9; clip-path: inset(40% 0 40% 0); transform: translate(2px, 1px); }
    92%, 100% { opacity: 0; clip-path: inset(50% 0 50% 0); transform: translate(0); }
}

/* ==========================================
   TERMINAL WINDOW STYLE
   ========================================== */
.terminal-wrapper {
    width: 600px;
    max-width: 90vw;
    background-color: rgba(0, 15, 0, 0.85);
    border: 1px solid #005500;
    border-top: 25px solid #002200;
    border-radius: 6px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.9), 0 0 20px rgba(0, 255, 0, 0.15) inset;
    position: relative;
}

/* Pseudo window controls */
.terminal-wrapper::before {
    content: "● ● ●";
    color: #005500;
    position: absolute;
    top: -18px;
    right: 15px;
    font-size: 11px;
    letter-spacing: 2px;
}

.terminal-header {
    position: absolute;
    top: -20px;
    left: 10px;
    color: #44aa44;
    font-size: 11px;
    letter-spacing: 1px;
}

.terminal-content {
    padding: 20px;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    font-size: 1.1rem;
    line-height: 1.5;
}

#output-history {
    width: 100%;
}

.input-line {
    display: flex;
    align-items: center;
    width: 100%;
    margin-top: 5px;
}

#cmd-input {
    background: transparent;
    border: none;
    color: #00ff00;
    font-family: inherit;
    font-size: inherit;
    flex-grow: 1;
    outline: none;
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.6);
}

#cmd-input::placeholder {
    color: rgba(0, 255, 0, 0.5);
}

.prompt {
    color: #00ff00;
    margin-right: 12px;
    user-select: none;
}

.text-bengali {
    font-family: 'Hind Siliguri', sans-serif;
    letter-spacing: 0.5px;
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.6);
}

.cursor {
    display: inline-block;
    width: 10px;
    height: 1.1em;
    background-color: #00ff00;
    vertical-align: text-bottom;
    margin-left: 4px;
    animation: blink 1s step-end infinite;
    box-shadow: 0 0 5px #00ff00;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; background-color: transparent; box-shadow: none; }
}

/* Responsive adjustments */
@media (max-width: 700px) {
    .terminal-wrapper {
        width: 90vw;
    }
    .terminal-content {
        font-size: 1rem;
        min-height: 100px;
    }
}
