@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=VT323&display=swap');

body {
    font-family: 'Fira Code', monospace;
    background-color: #000000;
    color: #e0e0e0;
    overflow-x: hidden;
}

.terminal {
    background-color: #121212;
    max-width: 100vw;
    margin: 0;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    overflow: hidden;
}


.terminal-body {
    padding: 0.1rem 1.5rem;
    height: 100vh;
    overflow-y: auto;
}

.command-line {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.prompt {
    color: #27c93f;
    font-weight: bold;
}

.cursor {
    display: inline-block;
    width: 10px;
    height: 20px;
    background-color: #e0e0e0;
    animation: blink 1s infinite;
}

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

/* Executed command styling */
.command-line.executed {
    margin-bottom: 1rem;
}

.command-line.executed .prompt {
    color: #27c93f;
    font-weight: bold;
}

.command-line.executed .command-text {
    color: #e0e0e0;
    font-family: 'Fira Code', monospace;
}

.command-output {
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.link {
    color: #4dabf7;
    text-decoration: none;
    transition: all 0.2s;
}

.link:hover {
    text-decoration: underline;
    color: #74c0fc;
}

.skill-tag {
    display: inline-block;
    background-color: #333;
    color: #e0e0e0;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    margin: 0.25rem;
    font-size: 0.9rem;
}

.project-card {
    background-color: #222;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
    border-left: 3px solid #27c93f;
}

/* Retro Game Title with Pixel Logo Border Effect */
.welcome-container {
    text-align: center;
    margin: 0.2rem 0;
    position: relative;
    padding: 0 1rem;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Pixel Logo Container with Layered Border */
.pixel-logo-container {
    background-color: #000000;
    text-align: center;
    padding: 40px 80px;
    margin-top: -2rem;  /* Pull the container up */
    
    /* Layered border effect from your logo design */
    box-shadow:
        0 0 0 10px #00ffff, /* Inner light blue border */
        0 0 0 20px #ffffff; /* Outer white border */
    
    /* Pixel-perfect rendering */
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: grayscale;
    image-rendering: pixelated;
    
    position: relative;
    z-index: 10;
    
    /* Prevent resizing and maintain stable dimensions */
    min-width: 280px;
    width: fit-content;
    max-width: 100%;
    
    /* Ensure stable layout */
    box-sizing: border-box;
    overflow: hidden;
}

/* Text Container for Proper Alignment */
.text-container {
    position: relative;
    z-index: 10;
    display: inline-block;
    text-align: center;
    line-height: 1.4;
}

/* Welcome Text Styling */
.welcome-text {
    font-family: 'Press Start 2P', monospace;
    font-size: 1.4rem;
    letter-spacing: 0.15em;
    line-height: 1.3;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    white-space: nowrap;
    overflow: hidden;
    display: inline-block;
    padding-right: 4px;
}

.typing {
    border-right: 2px solid #e0e0e0;
    white-space: nowrap;
    overflow: hidden;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end 3.5s forwards;
}

/* Enhanced Welcome Text for Pixel Logo */
.welcome-text {
    font-family: 'Press Start 2P', monospace;
    font-size: 1.4rem;
    letter-spacing: 0.15em;
    line-height: 1.3;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    white-space: nowrap;
    overflow: hidden;
    display: inline-block;
    padding-right: 4px;
}

.matrix-char {
    display: inline-block;
    color: white;
    text-shadow: 0 0 5px white;
    margin-right: 0.15em;  /* Add consistent spacing between characters */
    width: auto;
    position: relative;
    font-family: 'Press Start 2P', monospace; /* Ensure consistent font */
}

.matrix-char.rgb-on {
    animation: matrix-color 2s ease-in-out infinite;
}

/* Remove margin from space characters */
.matrix-char span:empty {
    margin-right: 0.3em;  /* Larger space for word separation */
}

/* Ensure text stays centered and stable after typing animation completes */
.welcome-text.typing-complete {
    animation: none;
    white-space: nowrap;
    overflow: visible;
    width: fit-content;
    text-align: center;
    word-break: keep-all;
    word-wrap: normal;
    line-height: 1.6;
    letter-spacing: 0.15em;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
}


/* Star Field Container */
.star-field {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    animation: twinkle 3s ease-in-out infinite;
}

.star.small {
    width: 2px;
    height: 2px;
    box-shadow: 0 0 3px rgba(255, 255, 255, 0.8);
}

.star.medium {
    width: 3px;
    height: 3px;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.9);
}

.star.large {
    width: 4px;
    height: 4px;
    box-shadow: 0 0 8px rgba(255, 255, 255, 1);
}

/* Sparkle Effects */
.sparkle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: radial-gradient(circle,
        rgba(255, 255, 255, 1) 0%,
        rgba(255, 255, 255, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 15;
}

.sparkle.rainbow {
    background: radial-gradient(circle,
        #ff0080 0%, #00ff80 25%, #0080ff 50%, #ff8000 75%, #ff0080 100%);
    animation: sparkleRainbow 1.5s ease-in-out infinite;
}

/* Shooting Stars */
.shooting-star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: linear-gradient(45deg,
        transparent 0%,
        rgba(255, 255, 255, 0.8) 50%,
        transparent 100%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 3;
}

/* Individual character styling */
.matrix-char {
    display: inline-block;
    color: #ffffff;
    text-shadow:
        0 0 2px rgba(255, 255, 255, 0.8),
        0 0 4px rgba(0, 255, 255, 0.6),
        0 0 6px rgba(255, 0, 255, 0.4);
    position: relative;
    font-family: 'Press Start 2P', monospace;
    vertical-align: top;
    line-height: 1.4;
    margin-right: 0.15em;
    width: auto;
}

/* Special case for spaces */
.matrix-char span:empty {
    margin-right: 0.3em;
}

.matrix-char.rgb-on {
    animation: matrix-color 3s ease-in-out infinite;
}

.matrix-char.sparkle::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    animation: charSparkle 2s ease-in-out infinite;
}


/* Responsive sizing for different screen sizes */
@media (max-width: 768px) {
    .terminal-body {
        height: 100vh;
        padding: 0.1rem 1rem;
    }
    
    .welcome-container {
        margin: 0.5rem 0;
        padding: 0.5rem;
        min-height: 80px;
    }
    
    .pixel-logo-container {
        padding: 20px 30px;
    }
    
    .welcome-text {
        font-size: 1rem;
        letter-spacing: 0.1em;
        line-height: 1.5;
        padding: 0 0.1em;
        width: auto;
        white-space: pre;
    }
    
    .text-container {
        font-size: 0.8em;
        width: 100%;
        text-align: center;
    }
    
    .star {
        opacity: 0.6;
    }
}

@media (min-width: 1200px) {
    .welcome-container {
        margin: 3rem 0;
        padding: 3rem;
        min-height: 140px;
    }
    
    .pixel-logo-container {
        padding: 50px 70px;
    }
    
    .welcome-text {
        font-size: 2.2rem;
        letter-spacing: 0.25em;
    }
    
    /* Use font scaling instead of transform to avoid layout conflicts */
    .text-container {
        font-size: 1.05em;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .terminal-body {
        height: 100vh;
        padding: 0.1rem 0.8rem;
    }
    
    .welcome-container {
        padding: 0.3rem;
        min-height: 60px;
    }
    
    .pixel-logo-container {
        padding: 15px 20px;
    }
    
    .welcome-text {
        font-size: 0.9rem;
        letter-spacing: 0.08em;
    }
    
    /* Use font scaling instead of transform to avoid layout conflicts */
    .text-container {
        font-size: 0.7em;
    }
    
    .sparkle {
        width: 2px;
        height: 2px;
    }
}

/* High DPI displays for sharper text */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .welcome-text {
        text-rendering: optimizeLegibility;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Remove focus styling from command input */
#current-command {
    outline: none;
    border: none;
    background: transparent;
    color: inherit;
    font-family: inherit;
    font-size: inherit;
}

#current-command:focus {
    outline: none;
    border: none;
    box-shadow: none;
}

/* Remove any default styling from focusable elements */
#current-command:focus-visible {
    outline: none;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #1e1e1e;
}

::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Mode Selection Styles */
.mode-selection {
    margin: 1rem 0;
}

.mode-button {
    display: block;
    width: 100%;
    background: transparent;
    border: 2px solid #27c93f;
    color: #27c93f;
    padding: 12px 16px;
    margin: 8px 0;
    border-radius: 4px;
    font-family: 'Fira Code', monospace;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.mode-button:hover {
    background-color: #0d1117;
    color: #00ff00;
    transform: translateX(1px);
    border-color: #00ff00;
    box-shadow: inset 0 0 0 1px #00ff00, 0 0 5px rgba(0, 255, 0, 0.3);
    text-shadow: 0 0 5px #00ff00;
}

.mode-button:active {
    transform: translateX(2px) scale(0.98);
}

.mode-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(39, 201, 63, 0.3);
}

.button-prefix {
    color: #27c93f;
    font-weight: bold;
    margin-right: 12px;
    font-size: 16px;
}

.button-text {
    font-weight: bold;
    font-size: 16px;
    margin-right: 12px;
}

.button-description {
    color: #888;
    font-size: 12px;
    margin-right: auto;
}

.button-arrow {
    font-size: 18px;
    font-weight: bold;
    transition: transform 0.1s ease;
}

.mode-button:hover .button-arrow {
    transform: translateX(5px);
}

/* Technical Button Specific */
.technical-button:hover {
    border-color: #00ff00;
    background-color: #0d1117;
    color: #00ff00;
    box-shadow: inset 0 0 0 1px #00ff00, 0 0 5px rgba(0, 255, 0, 0.3);
    text-shadow: 0 0 5px #00ff00;
}

/* Easy Button Specific */
.easy-button:hover {
    border-color: #00ff00;
    background-color: #0d1117;
    color: #00ff00;
    box-shadow: inset 0 0 0 1px #00ff00, 0 0 5px rgba(0, 255, 0, 0.3);
    text-shadow: 0 0 5px #00ff00;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.loading-content {
    text-align: center;
    color: #27c93f;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #333;
    border-top: 3px solid #27c93f;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.loading-text {
    font-family: 'Fira Code', monospace;
    font-size: 16px;
    color: #27c93f;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}