@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600&display=swap');

:root {
    --primary: #ff7b25;
    --secondary: #1a1a1a;
    --typing-speed: 10ms;
}

/* FOUC handling - with special exception for the terminal */
html, body {
    min-height: 100vh;
    background-color: var(--secondary);
}

/* Make sure the initial console is always visible */
#console-gate {
    opacity: 1 !important;
    visibility: visible !important;
}

#initial-welcome, 
.console-output,
.terminal-command,
.terminal-cursor,
#terminal-input-container {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Only hide the main website during loading, not the console */
body.js-loading > *:not(#console-gate) {
    opacity: 0;
}

body > *:not(#console-gate) {
    transition: opacity 0.4s ease;
}

body {
    font-family: 'Fira Code', monospace;
    background-color: var(--secondary);
    color: white;
    overflow-x: hidden;
    /* Prevent content shift during loading */
    min-height: 100vh;
}

.console-container {
    font-family: 'Fira Code', monospace;
    cursor: text;
}

/* Typewriter effects */
.typewriter {
    position: relative;
    overflow: hidden;
    max-width: 100%;
}

.type-text {
    visibility: visible;
    position: relative;
}

.typing {
    visibility: visible;
    display: inline-block;
    position: relative;
    width: 100%;
}

/* Make sure all characters in the typing element are visible */
.typing span, .typing div, .typing p, .typing ul, .typing li {
    visibility: visible !important;
}

/* Hide any text that should be revealed by the typewriter effect */
.typewriter[style*="visibility: hidden"] * {
    visibility: hidden !important;
}

/* Make sure terminal output is visible and clickable */
#initial-welcome, #command-history, #hero-terminal-content {
    cursor: text;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Hide any text that should be revealed by the typewriter effect */
.typing[style*="visibility: hidden"] * {
    visibility: hidden !important;
}

/* Make sure all characters in the typing element are visible when not hidden */
.typing:not([style*="visibility: hidden"]) * {
    visibility: visible !important;
}

.terminal-input::before {
    content: "> ";
    color: var(--primary);
}

/* Terminal cursor styles - Now using native caret with blinking animation */

/* Terminal command container */
.terminal-command {
    margin-bottom: 8px;
    width: 100%;
    position: relative;
    padding-left: 2px;
    border-left: 2px solid transparent;
}

.terminal-command:hover {
    border-left: 2px solid var(--primary);
    background-color: rgba(255, 123, 37, 0.05);
}

/* Terminal output */
.terminal-output {
    padding-left: 8px;
    width: 100%;
    position: relative;
    margin-bottom: 12px;
    color: #e0e0e0;
    text-shadow: 0 0 1px rgba(255, 255, 255, 0.3);
    cursor: text;
    transition: none !important;
}

/* Terminal command styling */
.terminal-command .text-white {
    text-shadow: 0 0 1px rgba(255, 255, 255, 0.3);
}

.typewriter .text-green-400 {
    color: #4ade80;
    text-shadow: 0 0 2px rgba(74, 222, 128, 0.2);
}

.typewriter .text-orange-500 {
    color: #f97316;
    text-shadow: 0 0 2px rgba(249, 115, 22, 0.2);
}

/* Terminal input container */
#terminal-input-container, #hero-input-container {
    margin-top: 12px;
    display: flex;
    align-items: center;
    border-top: 1px solid rgba(255, 123, 37, 0.2);
    padding-top: 8px;
    position: relative;
    cursor: text;
    min-height: 30px;
}

/* Terminal input styling - ensure native cursor is visible */
#terminal-input, #hero-terminal-input {
    position: relative;
    background-color: transparent;
    color: white;
    outline: none;
    width: 100%;
    font-family: 'Fira Code', monospace;
    padding: 4px 0;
    min-height: 24px;
    border: none;
    box-shadow: none;
    caret-color: #ff6600 !important; /* Force orange flashing cursor */
}

/* Ensure proper focus styling and cursor visibility */
#terminal-input:focus, #hero-terminal-input:focus {
    outline: none !important;
    box-shadow: none !important;
    caret-color: #ff6600 !important; /* Force orange flashing cursor */
}

/* Ensure cursor is visible in all states */
#terminal-input:active, #hero-terminal-input:active,
#terminal-input:hover, #hero-terminal-input:hover {
    caret-color: #ff6600 !important;
}

#terminal-input::selection, #hero-terminal-input::selection {
    background: rgba(255, 102, 0, 0.3);
}

/* Force hide any browser-specific caret implementations */
#terminal-input::-webkit-text-fill-color, #hero-terminal-input::-webkit-text-fill-color {
    color: white;
}

/* Additional cursor visibility rules */
input[type="text"] {
    caret-color: #ff6600 !important;
}

/* Ensure cursor is never hidden */
.terminal-input {
    caret-color: #ff6600 !important;
}

/* Override any potential cursor hiding */
* {
    caret-color: inherit;
}

/* Cursor container - simplified since we use native caret */
.cursor-container {
    position: relative;
    display: inline-flex;
    width: 100%;
    min-height: 24px;
    cursor: text;
}

/* Transitions for page elements */
#console-gate, #main-website {
    transition: opacity 0.8s ease-in-out;
}

/* Hero terminal styles */
.terminal-container {
    border: 1px solid #333;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    cursor: text;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

#hero-terminal {
    background-color: #000;
    color: #d1d5db;
    padding: 1.5rem;
    height: 33rem;
    font-family: 'Fira Code', monospace;
    font-size: 0.875rem;
    overflow-y: auto;
    scroll-behavior: smooth;
    /* Ensure scrolling is contained within this element */
    position: relative;
    isolation: isolate;
}

#hero-terminal .cursor-container {
    position: relative;
    display: inline-flex;
    width: 100%;
    min-height: 24px;
    cursor: text;
}

#hero-terminal-input {
    caret-color: transparent !important; /* Hide native caret completely */
    position: relative;
    background-color: transparent;
    color: white;
    outline: none;
    width: 100%;
    font-family: 'Fira Code', monospace;
    padding: 4px 0;
    min-height: 24px;
    border: none;
    box-shadow: none;
}

#hero-input-container {
    margin-top: 12px;
    display: flex;
    align-items: center;
    border-top: 1px solid rgba(255, 123, 37, 0.2);
    padding-top: 8px;
    position: relative;
    cursor: text;
    min-height: 30px;
    width: 100%;
}

/* Custom scrollbar */
.console-output::-webkit-scrollbar,
#hero-terminal::-webkit-scrollbar {
    width: 8px;
}

.console-output::-webkit-scrollbar-track,
#hero-terminal::-webkit-scrollbar-track {
    background: #2d2d2d;
}

.console-output::-webkit-scrollbar-thumb,
#hero-terminal::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

/* Card hover effects */
.card-hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 25px -5px rgba(255, 123, 37, 0.1), 0 10px 10px -5px rgba(255, 123, 37, 0.04);
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background-color: var(--primary);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--primary);
    margin: 10px auto;
}

/* ASCII Game Styles */
.ascii-game {
    font-family: 'Fira Code', monospace;
    white-space: pre;
    line-height: 1;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #333;
    overflow-x: auto;
    margin: 15px 0;
    font-size: 14px;
    letter-spacing: -0.5px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Ensure consistent styling for both terminals */
.terminal-output, #hero-terminal .terminal-output {
    padding-left: 8px;
    width: 100%;
    position: relative;
    margin-bottom: 12px;
    color: #e0e0e0;
    text-shadow: 0 0 1px rgba(255, 255, 255, 0.3);
    cursor: text;
}

/* Command output container */
.command-output {
    margin-bottom: 12px;
    padding-left: 8px;
    /* Remove any transitions */
    transition: none !important;
}

/* Remove transitions from terminal elements */
#terminal-input-container,
#hero-input-container,
.terminal-command,
.typing,
.typewriter,
#command-history > div,
#hero-terminal-content > div {
    transition: none !important;
}

/* Ensure no height animations */
.terminal-output,
.command-output,
#command-history > div,
#hero-terminal-content > div {
    height: auto !important;
    overflow: visible !important;
}

/* Project card styles */
.project-card {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.project-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* Typewriter response styling */
.typewriter-response {
    transition: opacity 0.2s ease-in-out;
} 