/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Custom properties for retro color palette */
:root {
    --primary-bg: #0a0a0a;
    --secondary-bg: #1a1a1a;
    --accent-bg: #2a2a2a;
    --neon-green: #00ff00;
    --neon-blue: #00ffff;
    --neon-pink: #ff00ff;
    --neon-yellow: #ffff00;
    --neon-red: #ff0040;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --text-dim: #888888;
    --border-color: #333333;
}

/* Base typography */
body {
    font-family: 'Courier New', monospace;
    background-color: var(--primary-bg);
    color: var(--text-primary);
    line-height: 1.4;
    min-height: 100vh;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

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

/* Cursor trail particles */
.cursor-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--neon-green);
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
    opacity: 0.8;
    box-shadow: 0 0 6px currentColor;
    transition: all 0.1s ease-out;
}

/* Animated grid background */
.animated-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 255, 0, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 0, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: grid-move 20s linear infinite;
}

@keyframes grid-move {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

/* Floating orbs */
.floating-orb {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0.3;
    animation: float 8s ease-in-out infinite;
}

.floating-orb:nth-child(1) {
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, var(--neon-blue), transparent);
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.floating-orb:nth-child(2) {
    width: 15px;
    height: 15px;
    background: radial-gradient(circle, var(--neon-pink), transparent);
    top: 60%;
    right: 15%;
    animation-delay: -2s;
}

.floating-orb:nth-child(3) {
    width: 25px;
    height: 25px;
    background: radial-gradient(circle, var(--neon-yellow), transparent);
    bottom: 30%;
    left: 20%;
    animation-delay: -4s;
}

.floating-orb:nth-child(4) {
    width: 18px;
    height: 18px;
    background: radial-gradient(circle, var(--neon-green), transparent);
    top: 40%;
    right: 30%;
    animation-delay: -6s;
}

@keyframes float {
    0%, 100% { 
        transform: translateY(0px) rotate(0deg);
        opacity: 0.3;
    }
    50% { 
        transform: translateY(-20px) rotate(180deg);
        opacity: 0.6;
    }
}

/* Square Container */
.square-container {
    width: min(90vw, 1000px);
    min-height: min(90vh, 800px);
    max-width: 1000px;
    background: var(--secondary-bg);
    border: 3px solid var(--neon-green);
    border-radius: 12px;
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.3);
    display: flex;
    flex-direction: column;
    position: relative;
    margin-bottom: 2rem;
}

/* Header */
.header {
    background: var(--accent-bg);
    border-bottom: 2px solid var(--neon-green);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    border-radius: 8px 8px 0px 0px;
}

.logo {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--neon-green);
    text-shadow: 0 0 10px var(--neon-green);
}

.cursor-blink {
    animation: blink 1s infinite;
}

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

/* Navigation */
.nav {
    display: flex;
    gap: 1rem;
}

.nav-link {
    color: var(--text-primary);
    text-decoration: none;
    padding: 0.3rem 0.8rem;
    border: 1px solid transparent;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.nav-link:hover {
    color: var(--neon-blue);
    border-color: var(--neon-blue);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
    text-shadow: 0 0 5px var(--neon-blue);
}

/* Main Grid */
.main-grid {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    gap: 1rem;
    padding: 1rem;
    min-height: 0;
}

.grid-section {
    background: var(--accent-bg);
    border: 2px solid var(--neon-pink);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    min-height: 300px;
}

/* Section Titles */
.section-title {
    font-size: 1.2rem;
    text-align: center;
    margin-bottom: 1rem;
    color: var(--neon-green);
    text-shadow: 0 0 10px var(--neon-green);
    flex-shrink: 0;
}

.title-bracket {
    color: var(--neon-pink);
    text-shadow: 0 0 10px var(--neon-pink);
}

/* Terminal Windows */
.terminal-window,
.character-select-window,
.contact-terminal {
    background: var(--secondary-bg);
    border: 1px solid var(--neon-green);
    border-radius: 6px;
    overflow: hidden;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.terminal-header {
    background: var(--primary-bg);
    padding: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.terminal-title {
    color: var(--neon-blue);
    font-size: 0.8rem;
}

.terminal-buttons {
    display: flex;
    gap: 0.3rem;
}

.terminal-buttons span {
    width: 10px;
    height: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    cursor: pointer;
    border-radius: 2px;
}

.btn-close {
    background: var(--neon-red);
    color: var(--primary-bg);
}

.btn-minimize {
    background: var(--neon-yellow);
    color: var(--primary-bg);
}

.btn-maximize {
    background: var(--neon-green);
    color: var(--primary-bg);
}

.terminal-content {
    padding: 1rem;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Character Selection Screen */
.character-content {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.character-profile {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

/* Profile Picture */
.profile-picture {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.pixel-avatar {
    width: 120px;
    height: 120px;
    position: relative;
}

.avatar-frame {
    width: 100%;
    height: 100%;
    background: var(--primary-bg);
    border: 3px solid var(--neon-green);
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.avatar-inner {
    width: 100%;
    height: 100%;
    background: var(--secondary-bg);
    border-radius: 4px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-face {
    width: 80px;
    height: 80px;
    background: #fdbcb4;
    border-radius: 50%;
    position: relative;
    border: 2px solid var(--neon-green);
}

.avatar-hair {
    position: absolute;
    top: -5px;
    left: 10px;
    right: 10px;
    height: 25px;
    background: #8B4513;
    border-radius: 20px 20px 0 0;
    border: 1px solid var(--neon-green);
}

.avatar-eyes {
    position: absolute;
    top: 25px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
}

.eye {
    width: 8px;
    height: 8px;
    background: var(--neon-green);
    border-radius: 50%;
    box-shadow: 0 0 5px var(--neon-green);
    animation: avatar-blink 3s infinite;
}

.right-eye {
    animation-delay: 0.1s;
}

@keyframes avatar-blink {
    0%, 90%, 100% { opacity: 1; }
    95% { opacity: 0; }
}

.avatar-nose {
    position: absolute;
    top: 35px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 6px;
    background: #d4a574;
    border-radius: 2px;
}

.avatar-mouth {
    position: absolute;
    top: 45px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 6px;
    border: 2px solid #d4a574;
    border-top: none;
    border-radius: 0 0 12px 12px;
}

.character-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.7rem;
    color: var(--neon-green);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--neon-green);
    box-shadow: 0 0 8px var(--neon-green);
    animation: status-pulse 2s ease-in-out infinite;
}

@keyframes status-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.status-text {
    font-weight: bold;
    text-shadow: 0 0 5px var(--neon-green);
}

/* Character Info */
.character-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.character-stats {
    background: var(--primary-bg);
    border: 1px solid var(--neon-green);
    border-radius: 4px;
    padding: 0.8rem;
}

.stat-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.4rem;
    font-size: 0.8rem;
}

.stat-line:last-child {
    margin-bottom: 0;
}

.stat-label {
    color: var(--neon-green);
    font-weight: bold;
}

.stat-value {
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
}

.character-bio {
    background: var(--primary-bg);
    border: 1px solid var(--neon-green);
    border-radius: 4px;
    padding: 0.8rem;
}

.bio-header {
    color: var(--neon-green);
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.bio-content {
    font-size: 0.75rem;
    line-height: 1.4;
}

.bio-content .terminal-line {
    margin-bottom: 0.2rem;
    color: var(--text-secondary);
}

/* Skills Section Updates */
.skills-header {
    color: var(--neon-green);
    font-size: 0.8rem;
    margin-bottom: 0.8rem;
    font-weight: bold;
}

.terminal-line {
    margin-bottom: 0.3rem;
    font-size: 0.8rem;
}

.prompt {
    color: var(--neon-green);
    margin-right: 0.5rem;
}

/* About intro section */
.about-intro {
    flex-shrink: 0;
}

/* Skills Section */
.skills-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Skills Tabs */
.skills-tabs {
    position: relative;
    display: flex;
    margin-bottom: 0.8rem;
    background: var(--primary-bg);
    border-radius: 4px;
    padding: 0.15rem;
    flex-shrink: 0;
}

.skills-tab {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.4rem 0.6rem;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-size: 0.7rem;
    font-weight: bold;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
    border-radius: 3px;
}

.skills-tab.active {
    color: var(--neon-green);
    text-shadow: 0 0 8px var(--neon-green);
}

.skills-tab:hover:not(.active) {
    color: var(--text-primary);
    background: rgba(0, 255, 0, 0.1);
}

.skills-tab .tab-icon {
    margin-right: 0.3rem;
    transition: transform 0.3s ease;
}

.skills-tab.active .tab-icon {
    transform: rotate(90deg);
    color: var(--neon-green);
}

.skills-tab-indicator {
    position: absolute;
    top: 0.15rem;
    left: 0.15rem;
    width: calc(33.33% - 0.15rem);
    height: calc(100% - 0.3rem);
    background: linear-gradient(45deg, 
        rgba(0, 255, 0, 0.2), 
        rgba(0, 255, 0, 0.1)
    );
    border: 1px solid var(--neon-green);
    border-radius: 3px;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
    box-shadow: 0 0 8px rgba(0, 255, 0, 0.3);
}

.skills-tab-indicator.backend {
    transform: translateX(100%);
}

.skills-tab-indicator.tools {
    transform: translateX(200%);
}

.skills-container {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    flex: 1;
    opacity: 1;
    transform: translateX(0);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 300px;
    overflow-y: auto;
}

.skills-container:not(.active) {
    opacity: 0;
    transform: translateX(15px);
    pointer-events: none;
    display: none;
}

.skills-container.active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: all;
    display: flex;
}

/* Individual Skill Items */
.skill-item {
    background: var(--primary-bg);
    border: 1px solid var(--neon-green);
    border-radius: 4px;
    padding: 0.6rem 0.8rem;
    transition: all 0.3s ease;
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.skill-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 255, 0, 0.3);
}

.skill-name {
    font-size: 0.75rem;
    color: var(--neon-green);
    font-weight: bold;
}

.skill-level {
    font-size: 0.6rem;
    padding: 0.1rem 0.3rem;
    border-radius: 2px;
    font-weight: bold;
    border: 1px solid;
    flex-shrink: 0;
}

.skill-item .skill-level:contains("INTERMEDIATE") {
    background: var(--neon-yellow);
    color: var(--primary-bg);
    border-color: var(--neon-yellow);
}

.skill-item .skill-level:contains("EXPERT") {
    background: var(--neon-green);
    color: var(--primary-bg);
    border-color: var(--neon-green);
}

.skill-item .skill-level:contains("ADVANCED") {
    background: var(--neon-blue);
    color: var(--primary-bg);
    border-color: var(--neon-blue);
}
/* Projects Section */
.projects-section {
    border-color: var(--neon-yellow);
    contain: layout style;
    overflow: auto;;
}

/* Project Tabs */
.project-tabs {
    position: relative;
    display: flex;
    margin-bottom: 1rem;
    background: var(--primary-bg);
    border-radius: 6px;
    padding: 0.2rem;
    flex-shrink: 0;
}

.project-tab {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.6rem 1rem;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    font-weight: bold;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
    border-radius: 4px;
}

.project-tab.active {
    color: var(--neon-yellow);
    text-shadow: 0 0 10px var(--neon-yellow);
}

.project-tab:hover:not(.active) {
    color: var(--text-primary);
    background: rgba(255, 255, 0, 0.1);
}

.tab-icon {
    margin-right: 0.5rem;
    transition: transform 0.3s ease;
}

.project-tab.active .tab-icon {
    transform: rotate(90deg);
    color: var(--neon-yellow);
}

.tab-indicator {
    position: absolute;
    top: 0.2rem;
    left: 0.2rem;
    width: calc(50% - 0.2rem);
    height: calc(100% - 0.4rem);
    background: linear-gradient(45deg, 
        rgba(255, 255, 0, 0.2), 
        rgba(255, 255, 0, 0.1)
    );
    border: 1px solid var(--neon-yellow);
    border-radius: 4px;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
    box-shadow: 0 0 10px rgba(255, 255, 0, 0.3);
}

.tab-indicator.work {
    transform: translateX(100%);
}

.projects-container {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    flex: 1;
    opacity: 1;
    transform: translateX(0);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden; /* Add this line */
}

.projects-container:not(.active) {
    opacity: 0;
    transform: translateX(20px);
    pointer-events: none;
    display: none;
}

.projects-container.active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: all;
    position: relative;
}

.project-card {
    background: var(--primary-bg);
    border: 1px solid var(--neon-yellow);
    border-radius: 6px;
    padding: 0.8rem;
    transition: all 0.3s ease;
    flex-shrink: 0;
    margin: 0.3rem 0;
    will-change: transform;
}

.project-card:hover {
    transform: translateY(-2px) translateZ(0);
    box-shadow: 0 3px 10px rgba(255, 255, 0, 0.3);
    backface-visibility: hidden;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.project-title {
    font-size: 0.9rem;
    color: var(--neon-yellow);
    text-shadow: 0 0 5px var(--neon-yellow);
}

.project-status {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-weight: bold;
    border: 1px solid;
}

.project-status:contains("DONE") {
    background: var(--neon-green);
    color: var(--primary-bg);
    border-color: var(--neon-green);
}

/* Alternative approach for different statuses */
.project-card:has(.project-status:contains("ACTIVE")) .project-status,
.project-status {
    background: var(--neon-green);
    color: var(--primary-bg);
    border-color: var(--neon-green);
}

/* For ACTIVE status - different color */
.project-card .project-status:contains("ACTIVE") {
    background: var(--neon-blue);
    border-color: var(--neon-blue);
    animation: pulse-status 2s ease-in-out infinite;
}

@keyframes pulse-status {
    0%, 100% { 
        box-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
    }
    50% { 
        box-shadow: 0 0 15px rgba(0, 255, 255, 0.8);
    }
}

.project-description {
    margin-bottom: 0.5rem;
    line-height: 1.3;
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.tech-tag {
    background: var(--secondary-bg);
    color: var(--neon-blue);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-size: 0.7rem;
    border: 1px solid var(--neon-blue);
}

/* Contact Section */
.contact-section {
    border-color: var(--neon-pink);
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.contact-link {
    color: var(--neon-blue);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.8rem;
}

.contact-link:hover {
    color: var(--neon-pink);
    text-shadow: 0 0 10px var(--neon-pink);
}

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

::-webkit-scrollbar-track {
    background: var(--primary-bg);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--neon-green);
    border-radius: 4px;
    opacity: 0.7;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--neon-blue);
}

/* Firefox scrollbar styling */
.projects-container {
    scrollbar-width: thin;
    scrollbar-color: var(--neon-green) var(--primary-bg);
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 1rem;
    }
    
    .square-container {
        width: 100%;
        min-height: auto;
        border-radius: 8px;
        margin-bottom: 1rem;
    }
    
    .character-profile {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .pixel-avatar {
        width: 100px;
        height: 100px;
    }
    
    .avatar-face {
        width: 60px;
        height: 60px;
    }
    
    .header {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.8rem;
    }
    
    .nav {
        gap: 0.8rem;
    }
    
    .nav-link {
        font-size: 0.8rem;
        padding: 0.2rem 0.6rem;
    }
    
    .main-grid {
        gap: 0.8rem;
        padding: 0.8rem;
    }
    
    .section-title {
        font-size: 1rem;
        margin-bottom: 0.8rem;
    }
    
    .avatar-frame {
        padding: 0.8rem;
    }
    
    .avatar-pixel {
        width: 20px;
        height: 20px;
    }
    
    .terminal-content {
        padding: 0.8rem;
    }
    
    .terminal-line {
        font-size: 0.75rem;
    }
    
    .project-card {
        padding: 0.6rem;
    }
    
    .project-title {
        font-size: 0.8rem;
    }
    
    .project-description {
        font-size: 0.7rem;
    }
    
    .skills-container {
        max-height: 250px;
    }
    
    .projects-container {
        max-height: 300px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 0.5rem;
    }
    
    .square-container {
        border-radius: 6px;
    }
    
    .pixel-avatar {
        width: 80px;
        height: 80px;
    }
    
    .avatar-face {
        width: 50px;
        height: 50px;
    }
    
    .character-stats,
    .character-bio {
        padding: 0.6rem;
    }
    
    .stat-line {
        font-size: 0.7rem;
    }
    
    .logo {
        font-size: 1rem;
    }
    
    .nav-link {
        font-size: 0.75rem;
    }
    
    .main-grid {
        gap: 0.6rem;
        padding: 0.6rem;
    }
    
    .grid-section {
        padding: 0.8rem;
    }
    
    .section-title {
        font-size: 0.9rem;
    }
    
    .avatar-pixel {
        width: 15px;
        height: 15px;
    }
    
    .terminal-line,
    .contact-link {
        font-size: 0.7rem;
    }
    
    .skills-container {
        max-height: 200px;
    }
    
    .projects-container {
        max-height: 250px;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus states for keyboard navigation */
a:focus,
button:focus {
    outline: 2px solid var(--neon-blue);
    outline-offset: 2px;
}

/* Terminal-style work experience */
.terminal-style {
    background: var(--primary-bg);
    border: 1px solid var(--neon-green);
    border-radius: 6px;
    padding: 0.8rem;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    font-family: 'Fira Mono', 'Consolas', 'Courier New', monospace;
    color: var(--neon-green);
    font-size: 0.85rem;
    box-shadow: 0 0 12px rgba(0,255,0,0.15);
    overflow-x: auto;
}

.terminal-style pre {
    background: transparent;
    color: inherit;
    font-family: inherit;
    font-size: inherit;
    margin: 0;
    padding: 0;
    white-space: pre;
    line-height: 1.5;
}

.terminal-prompt {
    color: var(--neon-green);
    font-weight: bold;
}

.terminal-comment {
    color: var(--neon-yellow);
    font-style: italic;
    margin-left: 0.5em;
}

.terminal-date {
    color: var(--neon-blue);
    margin-left: 0.5em;
    font-size: 0.85em;
}