/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Press Start 2P', monospace;
    font-size: 12px;
    line-height: 1.6;
    overflow: hidden;
    background: #000;
}

/* Desktop Background */
.desktop {
    width: 100vw;
    height: 100vh;
    position: relative;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow: hidden;
}

.background-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 25% 25%, rgba(255,255,255,0.1) 2px, transparent 2px),
        radial-gradient(circle at 75% 75%, rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 50px 50px, 30px 30px;
    animation: float 20s ease-in-out infinite;
}

.background-pattern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 10% 20%, rgba(255, 107, 107, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(78, 205, 196, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(102, 126, 234, 0.1) 0%, transparent 50%);
    animation: particles 25s linear infinite;
}

@keyframes particles {
    0%, 100% {
        transform: translateY(0px) translateX(0px) rotate(0deg);
    }
    33% {
        transform: translateY(-10px) translateX(5px) rotate(120deg);
    }
    66% {
        transform: translateY(5px) translateX(-5px) rotate(240deg);
    }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* Sidebar Navigation */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 80px;
    height: calc(100vh - 40px);
    background: rgba(0,0,0,0.8);
    border-right: 2px solid #555;
    display: flex;
    flex-direction: column;
    padding: 10px 5px;
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    margin: 5px 0;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 4px;
    transition: all 0.3s ease;
    text-align: center;
}

.nav-item:hover {
    background: rgba(255,255,255,0.1);
    border-color: #fff;
    transform: scale(1.05);
}

.nav-item.active {
    background: rgba(102, 126, 234, 0.3);
    border-color: #667eea;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

.nav-icon {
    font-size: 20px;
    margin-bottom: 4px;
}

.nav-item span {
    font-size: 8px;
    color: #fff;
    text-transform: uppercase;
}

/* Main Content Area */
.main-content {
    margin-left: 80px;
    margin-bottom: 40px;
    height: calc(100vh - 40px);
    position: relative;
    overflow: hidden;
}

/* Window Styles */
.window {
    position: absolute;
    min-width: 400px;
    min-height: 300px;
    background: #c0c0c0;
    border: 2px outset #c0c0c0;
    border-radius: 0;
    box-shadow: 4px 4px 8px rgba(0,0,0,0.3);
    display: none;
    z-index: 10;
}

.window.active {
    display: block;
    top: 50px;
    left: 100px;
}

.window-header {
    background: linear-gradient(90deg, #0f4c81 0%, #2980b9 100%);
    color: white;
    padding: 4px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
    border-bottom: 1px solid #000;
}

.window-title {
    display: flex;
    align-items: center;
    font-size: 11px;
    font-weight: normal;
}

.window-icon {
    margin-right: 6px;
    font-size: 14px;
}

.window-controls {
    display: flex;
    gap: 2px;
}

.window-btn {
    width: 20px;
    height: 18px;
    background: #c0c0c0;
    border: 1px outset #c0c0c0;
    cursor: pointer;
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.1s;
}

.window-btn:hover {
    background: #e0e0e0;
}

.window-btn:active {
    border: 1px inset #c0c0c0;
}

.window-content {
    padding: 20px;
    height: calc(100% - 30px);
    overflow-y: auto;
    background: #c0c0c0;
}

/* Intro Section */
.intro-section {
    display: flex;
    gap: 30px;
    align-items: center;
}

.avatar-container {
    flex-shrink: 0;
}

.pixel-avatar {
    width: 120px;
    height: 120px;
    background: linear-gradient(45deg, #8B4513, #D2691E);
    border: 4px solid #000;
    display: flex;
    align-items: center;
    justify-content: center;
    image-rendering: pixelated;
    animation: pulse 2s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

.avatar-inner {
    width: 80px;
    height: 80px;
    background: #D2B48C;
    border: 2px solid #000;
    position: relative;
    border-radius: 8px;
}

.pixel-face {
    width: 100%;
    height: 100%;
    position: relative;
}

.pixel-eyes {
    position: absolute;
    top: 20px;
    width: 100%;
    display: flex;
    justify-content: space-around;
}

.pixel-eye {
    width: 8px;
    height: 8px;
    background: #000;
    border-radius: 1px;
    animation: blink 3s ease-in-out infinite;
}

.pixel-mouth {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 10px;
    border: 2px solid #000;
    border-top: none;
    border-radius: 0 0 10px 10px;
}

.pixel-spliff {
    position: absolute;
    bottom: 15px;
    right: 10px;
    width: 25px;
    height: 3px;
    background: #8B4513;
    border: 1px solid #000;
    border-radius: 2px;
    transform: rotate(-10deg);
}

.pixel-spliff::after {
    content: '';
    position: absolute;
    right: -8px;
    top: -1px;
    width: 8px;
    height: 5px;
    background: #228B22;
    border: 1px solid #000;
    border-radius: 2px;
}

@keyframes blink {
    0%, 90%, 100% { transform: scaleY(1); }
    95% { transform: scaleY(0.1); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.intro-text h1 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #000;
}

.glitch {
    position: relative;
    animation: glitch 3s ease-in-out infinite;
}

@keyframes glitch {
    0%, 90%, 100% { transform: translate(0); }
    91% { transform: translate(-2px, -1px); }
    92% { transform: translate(2px, 1px); }
    93% { transform: translate(-1px, 2px); }
    94% { transform: translate(1px, -1px); }
}

.typewriter {
    margin-bottom: 20px;
    border-right: 2px solid #000;
    animation: typing 3s steps(60, end), blink-caret 0.75s step-end infinite;
    white-space: nowrap;
    overflow: hidden;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: #000; }
}

.stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat {
    display: flex;
    gap: 10px;
    font-size: 10px;
}

.stat-label {
    font-weight: bold;
    color: #333;
}

.stat-value {
    color: #0066cc;
}

/* Work Experience */
.work-experience {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.job {
    border: 2px inset #c0c0c0;
    padding: 15px;
    background: #f0f0f0;
}

.job h3 {
    font-size: 14px;
    margin-bottom: 8px;
    color: #000;
}

.company {
    font-size: 10px;
    color: #666;
    margin-bottom: 12px;
}

.achievements {
    list-style: none;
    padding-left: 0;
}

.achievements li {
    font-size: 10px;
    margin-bottom: 6px;
    color: #333;
}

/* Skills Section */
.skills-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
}

.skill-category h3 {
    font-size: 14px;
    margin-bottom: 15px;
    color: #000;
    border-bottom: 2px solid #667eea;
    padding-bottom: 5px;
}

.skill-bars {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.skill {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.skill span {
    font-size: 10px;
    color: #333;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #808080;
    border: 2px inset #c0c0c0;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, #4ecdc4, #44a08d);
    transition: width 1s ease-in-out;
    position: relative;
}

.progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 5px,
        rgba(255,255,255,0.2) 5px,
        rgba(255,255,255,0.2) 10px
    );
    animation: progress-animate 2s linear infinite;
}

@keyframes progress-animate {
    0% { transform: translateX(-20px); }
    100% { transform: translateX(20px); }
}

/* Work Layout */
.work-layout {
    position: static !important;
    width: 100% !important;
    height: calc(100vh - 40px) !important;
    max-width: none !important;
    min-width: none !important;
    min-height: none !important;
    left: 80px !important;
    top: 0 !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

.work-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 20px;
    height: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.work-section {
    height: fit-content;
}

.sub-window {
    background: #c0c0c0;
    border: 2px outset #c0c0c0;
    border-radius: 0;
    box-shadow: 4px 4px 8px rgba(0,0,0,0.3);
    min-height: 400px;
}

.sub-window .window-header {
    background: linear-gradient(90deg, #0f4c81 0%, #2980b9 100%);
    color: white;
    padding: 4px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #000;
}

.sub-window .window-content {
    padding: 20px;
    height: calc(100% - 30px);
    overflow-y: auto;
    background: #c0c0c0;
}

/* Project List */
.project-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 15px;
}

.project-item {
    border: 2px inset #c0c0c0;
    padding: 12px;
    background: #f0f0f0;
    display: flex;
    gap: 15px;
    align-items: flex-start;
    transition: all 0.3s ease;
}

.project-item:hover {
    background: #e8e8e8;
    transform: translateX(3px);
}

.project-preview {
    flex-shrink: 0;
    width: 80px;
    height: 60px;
    border: 2px inset #c0c0c0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(45deg, #189fe7, #32676c);
}

.project-image-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    image-rendering: pixelated;
}

.project-details {
    flex: 1;
}

.project-title {
    font-size: 12px;
    color: #000;
    margin-bottom: 6px;
    text-decoration: underline;
    cursor: pointer;
    transition: color 0.3s ease;
}

.project-title:hover {
    color: #0066cc;
}

.project-description {
    font-size: 10px;
    color: #333;
    line-height: 1.4;
    margin: 0;
}

/* Open Source Section */
.opensource-section {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #888;
}

.opensource-section h3 {
    font-size: 12px;
    color: #000;
    margin-bottom: 8px;
    text-decoration: underline;
}

.opensource-section p {
    font-size: 10px;
    color: #333;
    line-height: 1.5;
    margin: 0;
}

/* Contact Section */
.contact-info h2 {
    font-size: 16px;
    margin-bottom: 20px;
    color: #000;
    text-align: center;
}

.contact-methods {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 300px;
    margin: 0 auto;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    background: #f0f0f0;
    border: 2px outset #c0c0c0;
    text-decoration: none;
    color: #333;
    font-size: 10px;
    transition: all 0.3s ease;
}

.contact-link:hover {
    background: #e0e0e0;
    border: 2px inset #c0c0c0;
    transform: translateX(5px);
}

.contact-icon {
    font-size: 16px;
}

/* About Section */
.about-content h2 {
    font-size: 16px;
    margin-bottom: 15px;
    color: #000;
}

.about-content h3 {
    font-size: 12px;
    margin: 20px 0 10px 0;
    color: #333;
}

.about-content p {
    font-size: 10px;
    color: #333;
    line-height: 1.6;
    margin-bottom: 15px;
}

.hobbies {
    list-style: none;
    padding: 0;
}

.hobbies li {
    font-size: 10px;
    color: #333;
    margin-bottom: 8px;
    padding-left: 15px;
}

.fun-facts {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fact {
    background: #f0f0f0;
    padding: 8px 12px;
    border: 2px inset #c0c0c0;
    font-size: 9px;
    color: #333;
}

/* Taskbar */
.taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
    background: #c0c0c0;
    border-top: 2px outset #c0c0c0;
    display: flex;
    align-items: center;
    padding: 0 10px;
    z-index: 200;
}

.start-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #c0c0c0;
    border: 2px outset #c0c0c0;
    cursor: pointer;
    font-size: 11px;
    font-weight: bold;
    transition: all 0.1s;
}

.start-button:hover {
    background: #e0e0e0;
}

.start-button:active {
    border: 2px inset #c0c0c0;
}

.start-icon {
    font-size: 14px;
}

.taskbar-items {
    flex: 1;
    display: flex;
    gap: 5px;
    margin-left: 10px;
}

.taskbar-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: #c0c0c0;
    border: 2px outset #c0c0c0;
    cursor: pointer;
    font-size: 9px;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: all 0.1s;
}

.taskbar-item:hover {
    background: #e0e0e0;
}

.taskbar-item.active {
    border: 2px inset #c0c0c0;
    background: #a0a0a0;
}

.taskbar-icon {
    font-size: 12px;
}

.system-tray {
    display: flex;
    align-items: center;
    gap: 10px;
}

.time {
    font-size: 10px;
    color: #000;
    padding: 4px 8px;
    background: #f0f0f0;
    border: 1px inset #c0c0c0;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .skills-grid {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }

    .work-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Gamification UI adjustments for tablet */
    #level-display {
        min-width: 180px !important;
        font-size: 9px !important;
    }

    #achievements-panel {
        max-width: 180px !important;
        font-size: 7px !important;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 60px;
        padding: 5px 2px;
    }

    .nav-item {
        padding: 8px 4px;
        margin: 3px 0;
    }

    .nav-icon {
        font-size: 16px;
    }

    .nav-item span {
        font-size: 6px;
    }

    .main-content {
        margin-left: 60px;
    }

    .window {
        min-width: 300px;
        left: 20px;
        right: 20px;
        width: auto;
    }

    .intro-section {
        flex-direction: column;
        text-align: center;
    }

    .skills-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .work-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .project-item {
        flex-direction: column;
        text-align: center;
    }

    .project-preview {
        width: 100%;
        height: 80px;
        margin-bottom: 10px;
    }

    .pixel-avatar {
        width: 80px;
        height: 80px;
        font-size: 32px;
    }

    .intro-text h1 {
        font-size: 14px;
    }

    .typewriter {
        white-space: normal;
        border-right: none;
        animation: none;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 10px;
    }

    .window {
        min-width: 250px;
        left: 10px;
        right: 10px;
    }

    .work-layout {
        left: 60px !important;
        padding: 0 10px;
    }

    .work-grid {
        padding: 10px;
    }

    .sub-window {
        min-height: 300px;
    }

    .window-content {
        padding: 15px;
    }

    .taskbar-item {
        font-size: 8px;
        padding: 3px 6px;
    }

    /* Gamification UI adjustments for mobile */
    #level-display {
        top: 5px !important;
        right: 5px !important;
        min-width: 150px !important;
        font-size: 8px !important;
        padding: 5px !important;
    }

    #achievements-panel {
        top: 5px !important;
        right: 160px !important;
        max-width: 150px !important;
        font-size: 6px !important;
        padding: 5px !important;
    }

    button[style*="right: 190px"] {
        right: 130px !important;
        padding: 3px 6px !important;
        font-size: 10px !important;
    }
}
