/* ===== EXPLOITS.SH - Modern Terminal Simulator ===== */

/* CSS Variables for theming */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-terminal: rgba(10, 15, 25, 0.85);
    --border-glow: rgba(0, 255, 136, 0.3);
    --text-primary: #e0e0e0;
    --text-accent: #00ff88;
    --text-secondary: #00d4ff;
    --accent-purple: #bf00ff;
    --accent-cyan: #00d4ff;
    --sidenav-bg: rgba(20, 25, 35, 0.95);
    --terminal-glow: 0 0 20px rgba(0, 255, 136, 0.15);
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

/* Selection styling */
::selection {
    background: var(--accent-purple);
    color: white;
}

/* Base styles */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

body {
    font-size: 14px;
    font-family: var(--font-mono);
    color: var(--text-primary);
    background: var(--bg-primary);
    background-image:
        radial-gradient(ellipse at 50% 0%, rgba(0, 212, 255, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(191, 0, 255, 0.05) 0%, transparent 40%),
        linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Subtle grid pattern overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(0, 255, 136, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 136, 0.02) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
}

/* CRT scanline effect */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.1) 2px,
            rgba(0, 0, 0, 0.1) 4px);
    pointer-events: none;
    z-index: 1000;
    opacity: 0.3;
}

/* Terminal container */
#container {
    position: relative;
    padding: 2rem;
    margin-left: 70px;
    margin-right: 20px;
    margin-top: 20px;
    margin-bottom: 20px;
    background: var(--bg-terminal);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-glow);
    border-radius: 12px;
    box-shadow:
        var(--terminal-glow),
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 4px 30px rgba(0, 0, 0, 0.5);
    min-height: calc(100vh - 40px);
    z-index: 1;
}

/* Terminal header bar */
#container::before {
    content: '● ● ●';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 35px;
    background: linear-gradient(180deg, rgba(30, 35, 45, 0.9) 0%, rgba(20, 25, 35, 0.9) 100%);
    border-bottom: 1px solid rgba(0, 255, 136, 0.1);
    border-radius: 12px 12px 0 0;
    display: flex;
    align-items: center;
    padding-left: 15px;
    font-size: 10px;
    letter-spacing: 4px;
    color: #ff5f56;
    text-shadow: 0 0 5px rgba(255, 95, 86, 0.5);
}

/* Adjust content for header */
#output,
#input-line {
    position: relative;
    z-index: 2;
}

#output {
    clear: both;
    width: 100%;
    padding-top: 25px;
    line-height: 1.6;
    word-wrap: break-word;
}

/* Command line input */
#cmdline {
    outline: none;
    background-color: transparent;
    margin: 0;
    width: 100%;
    font: inherit;
    border: none;
    color: var(--text-primary);
    caret-color: var(--text-accent);
    font-size: 14px;
}

#cmdline::placeholder {
    color: rgba(255, 255, 255, 0.2);
}

/* Prompt styling */
#prompt {
    white-space: nowrap;
    display: flex;
    align-items: center;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
}

.prompt-color {
    color: var(--text-accent);
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
    font-weight: 500;
}

/* Input line container */
.input-line {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    clear: both;
    margin-top: 5px;
}

.input-line>div:nth-child(2) {
    flex: 1;
}

/* Blinking cursor effect */
@keyframes blink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0;
    }
}

#cmdline:focus {
    animation: none;
}

/* ===== SIDENAV STYLES ===== */

#sidenav {
    height: 100%;
    width: 60px;
    position: fixed;
    z-index: 100;
    top: 0;
    left: 0;
    background: var(--sidenav-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-right: 1px solid rgba(0, 255, 136, 0.2);
    overflow-x: hidden;
    overflow-y: auto;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding-top: 20px;
    box-shadow: 4px 0 30px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
}

#sidenav::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 2px;
    height: 100%;
    background: linear-gradient(180deg,
            var(--text-accent) 0%,
            var(--accent-cyan) 50%,
            var(--accent-purple) 100%);
    opacity: 0.5;
}

/* Logo in sidenav */
#sidenavLogo {
    width: 40px;
    height: auto;
    opacity: 0.9;
    transition: all 0.3s ease;
    filter: drop-shadow(0 0 10px rgba(0, 255, 136, 0.3));
    margin-bottom: 20px;
    flex-shrink: 0;
    order: 1;
}

#sidenav:hover #sidenavLogo,
#sidenav[style*="width: 300px"] #sidenavLogo {
    width: 150px;
    opacity: 1;
}

/* Profile pic at bottom */
#profilePic {
    display: block;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid var(--text-accent);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
    transition: all 0.3s ease;
    opacity: 0;
    object-fit: cover;
    margin-top: auto;
    margin-bottom: 80px;
    flex-shrink: 0;
    order: 3;
}

#profilePic:focus {
    outline: none;
}

/* Sidenav toggle button */
#sidenavBtn {
    position: fixed;
    padding: 8px;
    top: 12px;
    left: 10px;
    font-size: 24px;
    background: var(--sidenav-bg);
    border: 1px solid var(--border-glow);
    border-radius: 8px;
    color: var(--text-accent);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 200;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

#sidenavBtn:hover {
    color: var(--accent-cyan);
    transform: scale(1.1);
}

/* Sidenav buttons */
#sidenav button:not(#sidenavBtn) {
    padding: 12px 20px;
    cursor: pointer;
    text-decoration: none;
    font-size: 13px;
    order: 2;
    font-family: var(--font-mono);
    color: var(--text-primary);
    display: block;
    width: 100%;
    text-align: left;
    transition: all 0.3s ease;
    background: transparent;
    border: none;
    border-left: 3px solid transparent;
    opacity: 0;
    transform: translateX(-20px);
}

#sidenav button:not(#sidenavBtn):hover {
    color: var(--text-accent);
    background: rgba(0, 255, 136, 0.1);
    border-left-color: var(--text-accent);
    padding-left: 25px;
}

/* Moltbook Bot link */
#moltbookLink {
    padding: 12px 20px;
    text-decoration: none;
    font-size: 13px;
    font-family: var(--font-mono);
    color: var(--accent-cyan);
    display: block;
    width: 100%;
    text-align: left;
    transition: all 0.3s ease;
    background: transparent;
    border-left: 3px solid var(--accent-cyan);
    opacity: 0;
    transform: translateX(-20px);
    order: 2;
    margin-top: 20px;
    cursor: pointer;
    z-index: 10;
}

#moltbookLink:hover {
    color: var(--text-accent);
    background: rgba(0, 255, 136, 0.15);
    border-left-color: var(--text-accent);
    padding-left: 25px;
    text-shadow: 0 0 10px var(--accent-cyan);
}

/* Discord link */
#discordLink {
    padding: 12px 20px;
    text-decoration: none;
    font-size: 13px;
    font-family: var(--font-mono);
    color: var(--accent-purple);
    display: block;
    width: 100%;
    text-align: left;
    transition: all 0.3s ease;
    background: transparent;
    border-left: 3px solid var(--accent-purple);
    opacity: 0;
    transform: translateX(-20px);
    order: 2;
    cursor: pointer;
    z-index: 10;
}

#discordLink:hover {
    color: var(--text-accent);
    background: rgba(138, 43, 226, 0.15);
    border-left-color: var(--text-accent);
    padding-left: 25px;
    text-shadow: 0 0 10px var(--accent-purple);
}

/* ===== ANIMATIONS ===== */

/* Typing animation for output */
@keyframes typeGlow {

    0%,
    100% {
        text-shadow: 0 0 5px rgba(0, 255, 136, 0.3);
    }

    50% {
        text-shadow: 0 0 15px rgba(0, 255, 136, 0.6);
    }
}

/* Matrix effect container */
.matrix-effect {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
    overflow: hidden;
}

.matrix-column {
    position: absolute;
    top: -100%;
    color: var(--text-accent);
    font-family: var(--font-mono);
    font-size: 14px;
    text-shadow: 0 0 10px var(--text-accent);
    animation: matrixFall linear infinite;
    opacity: 0.8;
}

@keyframes matrixFall {
    0% {
        transform: translateY(-100%);
    }

    100% {
        transform: translateY(100vh);
    }
}

/* Progress bar for simulations */
.progress-bar {
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid var(--text-accent);
    border-radius: 4px;
    height: 20px;
    width: 100%;
    max-width: 400px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--text-accent), var(--accent-cyan));
    box-shadow: 0 0 10px var(--text-accent);
    transition: width 0.3s ease;
}

/* Hack animation text colors */
.hack-success {
    color: var(--text-accent);
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.hack-warning {
    color: #ffcc00;
    text-shadow: 0 0 10px rgba(255, 204, 0, 0.5);
}

.hack-danger {
    color: #ff4444;
    text-shadow: 0 0 10px rgba(255, 68, 68, 0.5);
}

.hack-info {
    color: var(--accent-cyan);
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.hack-purple {
    color: var(--accent-purple);
    text-shadow: 0 0 10px rgba(191, 0, 255, 0.5);
}

/* ASCII art styling */
.ascii-art {
    color: var(--text-accent);
    font-size: 10px;
    line-height: 1.2;
    white-space: pre;
    text-shadow: 0 0 5px rgba(0, 255, 136, 0.3);
}

/* Welcome logo image */
#welcomeLogo {
    max-width: 300px;
    margin: 20px 0;
    filter: drop-shadow(0 0 20px rgba(0, 255, 136, 0.4));
}

/* ===== RESPONSIVE DESIGN ===== */

/* Tablet styles */
@media screen and (max-width: 1024px) {
    #container {
        margin-left: 80px;
        margin-right: 20px;
    }
}

/* Mobile landscape and tablet portrait */
@media screen and (max-width: 768px) {
    body {
        font-size: 13px;
    }

    #container {
        margin: 0;
        padding: 1rem;
        padding-top: 60px;
        padding-bottom: 80px;
        border-radius: 0;
        min-height: 100vh;
        min-height: 100dvh;
        /* Dynamic viewport height for mobile */
    }

    /* Hide sidenav by default on mobile */
    #sidenav {
        width: 0;
        border-right: none;
        overflow: hidden;
    }

    /* Sidenav open state - full screen overlay */
    #sidenav.open {
        width: 100%;
        max-width: 320px;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
    }

    /* Fixed hamburger button */
    #sidenavBtn {
        position: fixed !important;
        left: 10px !important;
        top: 10px !important;
        right: auto !important;
        background: var(--sidenav-bg) !important;
        border-radius: 8px !important;
        padding: 12px 14px !important;
        font-size: 18px !important;
        z-index: 200 !important;
        border: 1px solid var(--border-glow) !important;
    }

    /* Larger touch targets for sidenav buttons */
    #sidenav button:not(#sidenavBtn) {
        padding: 16px 20px;
        font-size: 14px;
    }

    /* External links touch targets */
    #moltbookLink,
    #discordLink {
        padding: 16px 20px;
        font-size: 14px;
    }

    /* Logo adjustments */
    #sidenavLogo {
        margin-top: 60px;
        margin-bottom: 30px;
    }

    /* Profile pic adjustments */
    #profilePic {
        margin-bottom: 100px;
    }

    /* Input line at bottom of screen */
    #input-line {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--bg-terminal);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        padding: 15px;
        border-top: 1px solid var(--border-glow);
        z-index: 50;
    }

    #cmdline {
        font-size: 16px;
        /* Prevents iOS zoom on focus */
        padding: 12px;
    }

    /* Remove scanlines on mobile for performance */
    body::after {
        display: none;
    }

    /* Adjust output area for fixed input */
    #output {
        padding-bottom: 20px;
    }
}

/* Small mobile phones */
@media screen and (max-width: 480px) {
    body {
        font-size: 12px;
    }

    #container {
        padding: 0.75rem;
        padding-top: 55px;
        padding-bottom: 75px;
    }

    #cmdline {
        font-size: 16px;
        padding: 10px;
    }

    #sidenavBtn {
        padding: 10px 12px !important;
        font-size: 16px !important;
    }

    /* Smaller logo on mobile */
    #sidenavLogo {
        width: 35px;
    }

    /* Adjust sidenav spacing */
    #sidenav button:not(#sidenavBtn),
    #moltbookLink,
    #discordLink {
        padding: 14px 16px;
        font-size: 13px;
    }

    /* Figlet output smaller */
    .ascii-art {
        font-size: 8px;
    }

    /* Welcome logo smaller */
    #welcomeLogo {
        max-width: 200px;
    }
}

/* Very small screens */
@media screen and (max-width: 360px) {
    body {
        font-size: 11px;
    }

    #container {
        padding: 0.5rem;
        padding-top: 50px;
        padding-bottom: 70px;
    }

    #cmdline {
        font-size: 16px;
        padding: 8px;
    }
}

/* Short screens (landscape mobile) */
@media screen and (max-height: 500px) {
    body {
        font-size: 11px;
    }

    #sidenav {
        padding-top: 50px;
    }

    #sidenavLogo {
        width: 30px;
        margin-bottom: 10px;
    }

    #profilePic {
        width: 40px;
        height: 40px;
        margin-bottom: 60px;
    }

    #input-line {
        padding: 10px;
    }

    #cmdline {
        padding: 8px;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {

    /* Increase touch targets */
    #sidenav button:not(#sidenavBtn),
    #moltbookLink,
    #discordLink {
        min-height: 48px;
        display: flex;
        align-items: center;
    }

    /* Remove hover effects that don't work on touch */
    #sidenav button:not(#sidenavBtn):hover,
    #moltbookLink:hover,
    #discordLink:hover {
        padding-left: 20px;
        /* Don't animate on touch */
    }

    /* Ensure active states are visible */
    #sidenav button:not(#sidenavBtn):active,
    #moltbookLink:active,
    #discordLink:active {
        background: rgba(0, 255, 136, 0.2);
        border-left-color: var(--text-accent);
    }
}

/* ===== SCROLLBAR STYLING ===== */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--text-accent), var(--accent-cyan));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--accent-cyan), var(--accent-purple));
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--text-accent) var(--bg-secondary);
}