/* Additional custom styles beyond Tailwind */

/* Ensure smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection color */
::selection {
    background: #00ff41;
    color: #000;
}

/* Focus styles for accessibility */
*:focus-visible {
    outline: 2px solid #00ff41;
    outline-offset: 2px;
}

/* Prevent horizontal scroll */
body {
    overflow-x: hidden;
}

/* Animation for skill bars on scroll */
@keyframes fillBar {
    from { width: 0%; }
}

.skill-progress.animate {
    animation: fillBar 1.5s ease-out forwards;
}

/* Hover glow enhancement */
.hover-glow:hover {
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.4);
}

/* Terminal window styling */
.terminal-window {
    background: rgba(10, 10, 10, 0.95);
    border: 1px solid #333;
    position: relative;
}

.terminal-window::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    height: 2px;
    background: linear-gradient(90deg, #00ff41, #00ffff);
}

/* Custom animations */
@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 5px rgba(0, 255, 65, 0.5); }
    50% { box-shadow: 0 0 20px rgba(0, 255, 65, 0.8), 0 0 40px rgba(0, 255, 65, 0.4); }
}

.pulse-glow {
    animation: pulse-glow 2s infinite;
}

/* Matrix character styling */
.matrix-char {
    position: absolute;
    color: #00ff41;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    opacity: 0;
    animation: fall linear forwards;
    pointer-events: none;
}

@keyframes fall {
    to {
        transform: translateY(100vh);
        opacity: 0.3;
    }
}

/* Responsive typography adjustments */
@media (max-width: 768px) {
    .glitch {
        font-size: 2.5rem;
    }
}

/* Ensure images don't overflow */
img {
    max-width: 100%;
    height: auto;
}

/* Link hover states */
a {
    transition: all 0.3s ease;
}

/* Button press effect */
button:active, a:active {
    transform: scale(0.98);
}

/* Loading spinner alternative */
.loader-ring {
    display: inline-block;
    width: 80px;
    height: 80px;
}

.loader-ring:after {
    content: " ";
    display: block;
    width: 64px;
    height: 64px;
    margin: 8px;
    border-radius: 50%;
    border: 6px solid #00ff41;
    border-color: #00ff41 transparent #00ff41 transparent;
    animation: loader-ring 1.2s linear infinite;
}

@keyframes loader-ring {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Glassmorphism effect for overlays */
.glass {
    background: rgba(5, 5, 5, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 255, 65, 0.1);
}

/* Text scramble effect base */
.scramble-text {
    display: inline-block;
}

/* Binary background animation */
@keyframes binary-move {
    0% { transform: translateY(0); }
    100% { transform: translateY(-50%); }
}

/* Ensure proper z-index stacking */
nav {
    z-index: 1000;
}

#loader {
    z-index: 10000;
}

/* Print styles */
@media print {
    .scanlines,
    #matrix-canvas,
    #loader,
    nav {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
}

/* --- Moved from inline index.html styles --- */
body {
    font-family: 'JetBrains Mono', monospace;
    background-color: #050505;
    color: #e0e0e0;
}

/* Scanline effect */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    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;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.3;
}

/* Glow effects */
.glow-text {
    text-shadow: 0 0 10px #00ff41, 0 0 20px #00ff41, 0 0 30px #00ff41;
}

.glow-cyan {
    text-shadow: 0 0 10px #00ffff, 0 0 20px #00ffff;
}

.glow-box {
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.3), inset 0 0 20px rgba(0, 255, 65, 0.1);
}

.glow-box-cyan {
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3), inset 0 0 20px rgba(0, 255, 255, 0.1);
}

/* Glitch effect */
.glitch {
    position: relative;
    animation: glitch-skew 3s infinite linear alternate-reverse;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 #ff00ff;
    clip: rect(24px, 550px, 90px, 0);
    animation: glitch-anim-2 3s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -2px 0 #00ffff;
    clip: rect(85px, 550px, 140px, 0);
    animation: glitch-anim 2.5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% { clip: rect(10px, 9999px, 85px, 0); }
    20% { clip: rect(63px, 9999px, 130px, 0); }
    40% { clip: rect(25px, 9999px, 145px, 0); }
    60% { clip: rect(89px, 9999px, 55px, 0); }
    80% { clip: rect(45px, 9999px, 99px, 0); }
    100% { clip: rect(12px, 9999px, 120px, 0); }
}

@keyframes glitch-anim-2 {
    0% { clip: rect(65px, 9999px, 100px, 0); }
    20% { clip: rect(20px, 9999px, 75px, 0); }
    40% { clip: rect(90px, 9999px, 40px, 0); }
    60% { clip: rect(15px, 9999px, 110px, 0); }
    80% { clip: rect(55px, 9999px, 85px, 0); }
    100% { clip: rect(30px, 9999px, 130px, 0); }
}

@keyframes glitch-skew {
    0% { transform: skew(0deg); }
    10% { transform: skew(-2deg); }
    20% { transform: skew(2deg); }
    30% { transform: skew(0deg); }
    100% { transform: skew(0deg); }
}

/* Cursor blink */
.cursor-blink {
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Loading screen */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-family: 'JetBrains Mono', monospace;
}

.boot-text {
    color: #00ff41;
    font-size: 14px;
    line-height: 1.6;
    max-width: 800px;
    padding: 20px;
}

.progress-bar {
    width: 300px;
    height: 4px;
    background: #111;
    margin-top: 20px;
    position: relative;
    overflow: hidden;
    border: 1px solid #00ff41;
}

.progress-fill {
    height: 100%;
    background: #00ff41;
    width: 0%;
    transition: width 0.1s;
    box-shadow: 0 0 10px #00ff41;
}

/* Matrix rain canvas */
#matrix-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.05;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #050505;
}

::-webkit-scrollbar-thumb {
    background: #00ff41;
    border-radius: 0;
}

::-webkit-scrollbar-thumb:hover {
    background: #00ffff;
}

/* Skill bars */
.skill-bar {
    background: #111;
    border: 1px solid #333;
    height: 30px;
    position: relative;
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    background: linear-gradient(90deg, #00ff41 0%, #00ffff 100%);
    position: relative;
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
}

.skill-progress::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 2px;
    height: 100%;
    background: #fff;
    box-shadow: 0 0 10px #fff;
}

/* Card hover effects */
.project-card {
    transition: all 0.3s ease;
    border: 1px solid #333;
}

.project-card:hover {
    border-color: #00ff41;
    box-shadow: 0 0 30px rgba(0, 255, 65, 0.2);
    transform: translateY(-5px);
}

/* Timeline */
.timeline-node {
    width: 20px;
    height: 20px;
    background: #00ff41;
    border: 2px solid #000;
    box-shadow: 0 0 10px #00ff41;
}

/* Navigation */
.nav-link {
    position: relative;
    overflow: hidden;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #00ff41;
    transition: width 0.3s;
    box-shadow: 0 0 10px #00ff41;
}

.nav-link:hover::after {
    width: 100%;
}

/* Binary background pattern */
.binary-bg {
    background-image: radial-gradient(circle at 50% 50%, rgba(0, 255, 65, 0.03) 1px, transparent 1px);
    background-size: 30px 30px;
}