html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    width: 100%;
    background-color: #000000;
    font-family: var(--terminal-font);
    color: var(--terminal-text-color);
    overflow-x: hidden;
    position: relative;
}

/* Custom Scrollbar Styles */
::-webkit-scrollbar {
    width: 0;
    height: 0;
    background: transparent;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: transparent;
}

/* Firefox Scrollbar */
* {
    scrollbar-width: none;
    scrollbar-color: transparent transparent;
}

:root {
    --terminal-font: 'Fira Code', monospace;
    --terminal-font-size: 14px;
    --terminal-line-height: 1.6;
    --terminal-text-color: #0f0;
    --terminal-padding: 20px;
    --terminal-bottom-padding: 120px; /* Added more bottom padding */
}

@media (max-width: 600px) {
    :root {
        --terminal-font-size: 12px;
        --terminal-padding: 15px;
        --terminal-bottom-padding: 150px; /* Even more padding for mobile */
    }

    .terminal-content {
        padding: var(--terminal-padding);
        padding-bottom: var(--terminal-bottom-padding) !important;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: contain;
    }

    /* Remove fixed positioning that was blocking scrolling */
    body {
        width: 100%;
        height: 100%;
        overflow-y: auto;
    }

    .terminal {
        min-height: 100vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Terminal Styles */
.terminal {
    width: 100%;
    max-width: none;
    min-height: 100vh;
    margin: 0 auto;
    background-color: #000000;
    overflow: hidden;
    z-index: 1;
    position: relative;
    background: radial-gradient(
        circle at center,
        rgb(13 14 13) 0%,
        rgb(0 0 0) 100%
    );
    display: flex;
    flex-direction: column;
}

/* Terminal Styles */
.terminal-content {
    font-family: var(--terminal-font);
    font-size: var(--terminal-font-size);
    line-height: var(--terminal-line-height);
    padding: var(--terminal-padding);
    padding-bottom: var(--terminal-bottom-padding);
    width: 100%;
    position: relative;
    z-index: 2;
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.8);
    box-sizing: border-box;
    overflow-x: hidden;
    flex: 1;
}

.line {
    margin: 10px 0;
    display: flex;
    align-items: flex-start;
    position: relative;
    min-height: calc(var(--terminal-line-height) * 1em);
}

/* Pulsing Text Effect */
@keyframes textPulse {
    0% {
        opacity: 1;
        color: #ffff00;
        text-shadow: 0 0 5px #ffff00;
    }
    50% {
        opacity: 0;
        color: #ffff00;
        text-shadow: 0 0 5px #ffff00;
    }
    100% {
        opacity: 1;
        color: #ffff00;
        text-shadow: 0 0 5px #ffff00;
    }
}

.pulsing-text {
    animation: textPulse 1.5s step-end infinite;
    display: inline-block;
    font-weight: bold;
    color: #ffff00 !important;
    text-shadow: 0 0 5px #ffff00 !important;
}

.pulsing-text2 {
    animation: textPulse 1.5s step-end infinite;
    display: inline-block;
    font-weight: bold;
    color: #ffff00 !important;
    text-shadow: 0 0 5px #ffff00 !important;
}

.prompt {
    color: var(--terminal-text-color);
    margin-right: 10px;
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.7);
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.command {
    color: #ffffff;
    text-shadow: 0 0 3px rgba(255, 255, 255, 0.7);
}

.cursor {
    display: inline-block;
    width: 8px;
    height: 18px;
    background-color: var(--terminal-text-color);
    margin-left: 2px;
    vertical-align: middle;
    animation: blink 1s step-end infinite;
    box-shadow: 0 0 5px var(--terminal-text-color);
}

.line:not(:last-child) .cursor {
    display: none;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.output {
    color: var(--terminal-text-color);
    line-height: 1.5;
    margin: 10px 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    text-shadow: 0 0 3px rgba(0, 255, 0, 0.7);
    max-width: 100%;
    overflow-x: hidden;
}

.output span {
    display: inline;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Add specific styling for scrambled text */
.scrambled-text {
    font-family: "Noto Sans", "Segoe UI", "Arial Unicode MS", sans-serif;
    letter-spacing: 0.05em; /* Add slight spacing to prevent overlapping */
    line-height: 1.4; /* Adjust line height for better mark rendering */
    display: inline-block; /* Prevent marks from affecting other text */
    vertical-align: baseline;
}

/* Terminal Navigation */
.terminal-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 40px;
    background-color: #000;
    border-bottom: 1px solid var(--terminal-text-color);
    display: flex;
    align-items: center;
    padding: 0 20px;
    z-index: 1000;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.1);
}

.terminal-nav a {
    color: var(--terminal-text-color);
    text-decoration: none;
    font-family: var(--terminal-font);
    font-size: 14px;
    padding: 5px 15px;
    border: 1px solid var(--terminal-text-color);
    margin-right: 10px;
    transition: all 0.3s ease;
    background: rgba(0, 255, 0, 0.1);
    text-shadow: 0 0 5px var(--terminal-text-color);
}

.terminal-nav a:hover {
    background: var(--terminal-text-color);
    color: #000;
    box-shadow: 0 0 10px var(--terminal-text-color);
}

.terminal-title {
    flex-grow: 1;
    text-align: center;
    color: var(--terminal-text-color);
    margin-left: 20px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 2px var(--terminal-text-color);
}

/* Animations */
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* Media Queries */
@media (max-width: 600px) {
    .loading-content {
        width: 90%;
        padding: 15px;
    }

    .loading-header {
        font-size: 20px;
    }

    .terminal {
        width: 100%;
        height: 100vh;
    }

    .terminal-content {
        padding: 10px;
    }

    .terminal-nav {
        padding: 0 10px;
    }

    .terminal-title {
        font-size: var(--terminal-font-size);
    }
}

.terminal-header {
    background-color: #2d2d2d;
    padding: 8px;
    display: flex;
    align-items: center;
}

.terminal-buttons {
    display: flex;
    gap: 8px;
}

.terminal-button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.close {
    background-color: #ff5f56;
}

.minimize {
    background-color: #ffbd2e;
}

.maximize {
    background-color: #27c93f;
}

.terminal-title {
    color: #9c9c9c;
    margin-left: 20px;
    font-size: 14px;
}

/* Biometric Authentication Effects */
.retinal-scan {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, transparent 0%, rgba(0, 255, 0, 0.2) 100%);
    pointer-events: none;
    opacity: 0;
    z-index: 1000;
    animation: scanEffect 3s ease-in-out;
}

.scan-line {
    position: absolute;
    width: 100%;
    height: 2px;
    background: rgba(0, 255, 0, 0.8);
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.8);
    transform-origin: left;
    animation: scanLine 3s linear;
}

.biometric-progress {
    width: 100%;
    height: 20px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #00ff00;
    margin: 10px 0;
    position: relative;
    overflow: hidden;
}

.biometric-progress-bar {
    height: 100%;
    background: #00ff00;
    width: 0%;
    transition: width 0.3s ease-in-out;
    position: relative;
}

.biometric-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: progressGlow 1s linear infinite;
}

@keyframes scanEffect {
    0% { opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes scanLine {
    0% { transform: scaleX(0); opacity: 0; }
    5% { opacity: 1; }
    95% { opacity: 1; }
    100% { transform: scaleX(1); opacity: 0; }
}

/* Access Denied Effects */
.access-denied-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 0, 0, 0.3);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.access-denied-overlay.active {
    opacity: 1;
}

.access-denied-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ff0000;
    font-family: var(--terminal-font);
    font-size: 2em;
    text-align: center;
    text-shadow: 0 0 10px #ff0000;
    opacity: 0;
    animation: glitchText 0.3s infinite;
    width: 80%;
    max-width: 800px;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.terminal-reboot {
    animation: rebootFlicker 0.5s ease-in-out;
}

@keyframes glitchText {
    0% { transform: translate(-50%, -50%) skew(0deg); }
    20% { transform: translate(-52%, -50%) skew(-4deg); }
    40% { transform: translate(-48%, -50%) skew(4deg); }
    60% { transform: translate(-50%, -48%) skew(0deg); }
    80% { transform: translate(-51%, -52%) skew(2deg); }
    100% { transform: translate(-50%, -50%) skew(0deg); }
}

@keyframes rebootFlicker {
    0% { opacity: 1; }
    10% { opacity: 0.8; }
    20% { opacity: 0.4; }
    30% { opacity: 0.6; }
    40% { opacity: 0.2; }
    50% { opacity: 0.8; }
    60% { opacity: 0.4; }
    70% { opacity: 1; }
    80% { opacity: 0.2; }
    90% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* Glitch Processing Effects */
.glitch-processing {
    margin: 20px 0 0;
    padding: 20px;
    border: 1px solid #0f0;
    position: relative;
    overflow: hidden;
    margin-right: 60px;
}

.glitch-processing .scanner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: #0f0;
    box-shadow: 0 0 10px #0f0;
    animation: scan 2s linear infinite;
}

.glitch-processing p {
    text-align: center;
    color: #0f0;
    margin: 10px 0;
    animation: glitchText 0.3s infinite;
}

@keyframes scan {
    0% {
        top: 0;
    }
    100% {
        top: 100%;
    }
}

@keyframes glitchText {
    0% {
        transform: skew(0deg);
    }
    20% {
        transform: skew(-4deg);
    }
    40% {
        transform: skew(4deg);
    }
    60% {
        transform: skew(-4deg);
    }
    80% {
        transform: skew(4deg);
    }
    100% {
        transform: skew(0deg);
    }
}

/* Add glitch effect for processed images */
.output img {
    position: relative;
    z-index: 1;
    transition: filter 0.3s;
}

.output img:hover {
    filter: hue-rotate(90deg) saturate(200%) brightness(150%);
    animation: imageGlitch 0.3s infinite;
}

@keyframes imageGlitch {
    0% {
        transform: translate(0);
        filter: hue-rotate(0deg);
    }
    25% {
        transform: translate(2px, -2px);
        filter: hue-rotate(90deg);
    }
    50% {
        transform: translate(-2px, 2px);
        filter: hue-rotate(180deg);
    }
    75% {
        transform: translate(2px, -2px);
        filter: hue-rotate(270deg);
    }
    100% {
        transform: translate(0);
        filter: hue-rotate(360deg);
    }
}

/* Glitch Result Controls */
.glitch-result {
    position: relative;
    margin: 20px 0;
    width: 100%;
}

.glitch-result img {
    display: block;
    width: 100%;
    max-width: 800px; /* Limit maximum width */
    height: auto;
    margin: 10px auto;
    object-fit: contain;
    border: 1px solid var(--terminal-text-color);
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.2);
    transition: transform 0.3s ease;
}

.glitch-result img:hover {
    transform: scale(1.02);
}

.glitch-controls {
    display: flex;
    gap: 10px;
    margin: 10px 0;
    justify-content: center;
}

@media (max-width: 600px) {
    .glitch-result img {
        max-width: 100%;
        margin: 5px auto;
    }

    .glitch-controls {
        flex-direction: row;
        flex-wrap: wrap;
    }
}

@keyframes progressGlow {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 100% 0;
    }
}

/* Glitch Effect Classes */
.glitch-transition {
    animation: glitchTransition 0.3s ease-out;
    position: relative;
}

.glitch-transition::before,
.glitch-transition::after {
    content: attr(data-text);
    position: absolute;
    left: 0;
    text-shadow: 0 0 3px var(--terminal-text-color);
    opacity: 0.8;
    width: 100%;
}

.glitch-transition::before {
    animation: glitchTop 0.3s ease-out;
    clip-path: polygon(0 0, 100% 0, 100% 33%, 0 33%);
    top: -1px;
}

.glitch-transition::after {
    animation: glitchBottom 0.3s ease-out;
    clip-path: polygon(0 67%, 100% 67%, 100% 100%, 0 100%);
    bottom: -1px;
}

@keyframes glitchTransition {
    0% {
        transform: translate(0);
    }
    20% {
        transform: translate(-2px, 1px);
    }
    40% {
        transform: translate(2px, -1px);
    }
    60% {
        transform: translate(-1px, -1px);
    }
    80% {
        transform: translate(1px, 1px);
    }
    100% {
        transform: translate(0);
    }
}

@keyframes glitchTop {
    0% {
        transform: translate(0px, -1px);
    }
    20% {
        transform: translate(2px, 1px);
    }
    40% {
        transform: translate(-2px, -1px);
    }
    60% {
        transform: translate(1px, 1px);
    }
    80% {
        transform: translate(-1px, -1px);
    }
    100% {
        transform: translate(0px, 0px);
    }
}

@keyframes glitchBottom {
    0% {
        transform: translate(0px, 1px);
    }
    20% {
        transform: translate(-2px, -1px);
    }
    40% {
        transform: translate(2px, 1px);
    }
    60% {
        transform: translate(-1px, -1px);
    }
    80% {
        transform: translate(1px, 1px);
    }
    100% {
        transform: translate(0px, 0px);
    }
}

.prompt {
    color: #0f0;  /* Keep all prompts in cyberpunk green */
    display: flex;
    align-items: center;
}

/* Authentication Interface Styles */
.auth-verification-container {
    margin: 20px 0;
    padding: 20px;
    background: rgba(0, 255, 0, 0.05);
    border: 1px solid #0f0;
}

.auth-interface {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 30px;
}

.auth-interface-center {
    text-align: center;
}

.auth-header {
    color: #0f0;
    font-size: 1.8em;
    margin-bottom: 30px;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow: 0 0 8px #0f0;
}

.status-text {
    color: #0f0;
    margin: 20px 0;
    font-size: 1.2em;
    text-shadow: 0 0 5px #0f0;
}

.encrypted-message-container {
    display: none;
    margin-top: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #0f0;
}

.encrypted-message {
    font-family: monospace;
    color: #0f0;
    font-size: 1.1em;
    letter-spacing: 1px;
    text-shadow: 0 0 3px #0f0;
}

/* Global CRT Effects */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        repeating-linear-gradient(
            0deg,
            rgb(131, 249, 76, 0.2) 0px,
            rgba(0, 0, 0, 0.2) 1px,
            transparent 1px,
            transparent 2px
        );
    pointer-events: none;
    z-index: 99999;
    opacity: 0.7;
    animation: scanline 8s linear infinite;
    mix-blend-mode: screen;
}

@keyframes scanline {
    0% { 
        background-position: 0 0;
        opacity: 0.7;
    }
    50% { opacity: 0.5; }
    100% { 
        background-position: 0 100%;
        opacity: 0.7;
    }
}

/* Loading Screen Styles */
.loading-screen.crt {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #030303;
    color: #00ff00;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--terminal-font);
    overflow: hidden;
    background-image: 
        repeating-linear-gradient(
            0deg,
            rgba(0, 0, 0, 0.2) 0px,
            rgba(0, 0, 0, 0.2) 1px,
            transparent 1px,
            transparent 2px
        ),
        url("https://media.giphy.com/media/oEI9uBYSzLpBK/giphy.gif");
    background-size: 100% 100%, cover;
    background-repeat: repeat, no-repeat;
    background-blend-mode: overlay;
}

.loading-screen.crt::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        180deg,
        rgba(0, 0, 0, 0) 0,
        rgba(0, 0, 0, 0.3) 50%,
        rgba(0, 0, 0, 0) 100%
    );
    background-size: 100% 4px;
    pointer-events: none;
    animation: scanline 8s linear infinite;
}

.loading-content {
    width: 80%;
    max-width: 600px;
    text-align: center;
    position: relative;
    z-index: 2;
}

.loading-ascii {
    text-align: center;
    color: #00ff00;
    text-shadow: 0 0 5px #00ff00;
    margin-bottom: 20px;
    position: relative;
    z-index: 3;
}

.loading-header {
    text-align: center;
    font-size: 24px;
    margin-bottom: 30px;
    text-shadow: 0 0 5px #00ff00;
    position: relative;
    z-index: 3;
    animation: glitchTransition 0.3s ease-out;
}

.loading-steps {
    margin-bottom: 20px;
    position: relative;
    z-index: 3;
}

.loading-step {
    opacity: 0.3;
    margin: 10px 0;
    transition: opacity 0.3s, transform 0.3s;
    text-shadow: 0 0 5px #00ff00;
}

.loading-step.active {
    opacity: 1;
    animation: glitchStep 0.3s ease-out;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #111;
    border: 1px solid #00ff00;
    margin: 20px 0;
    position: relative;
    overflow: hidden;
    z-index: 3;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.2);
}

.progress {
    width: 0%;
    height: 100%;
    background: linear-gradient(
        90deg,
        #00ff00,
        #33ff33,
        #00ff00
    );
    transition: width 0.8s ease-in-out;
    position: relative;
    box-shadow: 0 0 15px #00ff00;
    animation: progressGlitch 2s infinite linear;
}

.loading-status {
    text-align: center;
    margin-top: 20px;
    opacity: 0;
    transition: opacity 0.3s;
    position: relative;
    z-index: 3;
}

.loading-status.active {
    opacity: 1;
    animation: statusGlitch 1s infinite;
}

/* Add new keyframe animations for loading screen glitch effects */
@keyframes glitchStep {
    0% { transform: translate(0); }
    20% { transform: translate(-2px, 1px); }
    40% { transform: translate(2px, -1px); }
    60% { transform: translate(-1px, -1px); }
    80% { transform: translate(1px, 1px); }
    100% { transform: translate(0); }
}

@keyframes progressGlitch {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes statusGlitch {
    0% { transform: skew(0deg); }
    20% { transform: skew(-2deg); }
    40% { transform: skew(2deg); }
    60% { transform: skew(-2deg); }
    80% { transform: skew(2deg); }
    100% { transform: skew(0deg); }
}

/* Copy button specific styles */
.copy-button {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border: 1px solid var(--terminal-text-color);
    background: rgba(0, 255, 0, 0.1);
    color: var(--terminal-text-color);
    padding: 5px 15px;
    font-family: var(--terminal-font);
    font-size: var(--terminal-font-size);
    cursor: pointer;    transition: all 0.3s ease;
    text-shadow: 0 0 5px var(--terminal-text-color);
    pointer-events: auto;
    touch-action: manipulation;
}

.copy-button:hover, .copy-button:focus {
    background: var(--terminal-text-color);
    color: #000;
    box-shadow: 0 0 10px var(--terminal-text-color);
    outline: none;
}

.copy-button:active {
    transform: scale(0.98);
}

/* Addto existing styles */
.copy-input {
    position: absolute;
    left: -99999px;
    opacity: 0;
    pointer-events: none;
    user-select: none;
    readonly: true;
}