/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
}

@font-face {
    font-family: 'Terminal';
    src: local('Courier New'), local('Consolas'), local('monospace');
}

body {
    font-family: 'Terminal', 'Courier New', monospace;
    background: #000;
    color: #0f0;
    overflow: hidden;
    height: 100vh;
    cursor: default;
}

/* Desktop Background */
#desktop {
    position: relative;
    width: 100%;
    height: calc(100vh - 40px);
    background: linear-gradient(135deg, #000 0%, #001a1a 50%, #002 100%);
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(0, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 0, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(0, 255, 0, 0.05) 0%, transparent 50%),
        linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.3) 100%);
    position: relative;
    overflow: hidden;
}

/* Matrix rain effect */
#matrix-rain {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.15;
}

/* Desktop Icons */
.desktop-icon {
    position: absolute;
    width: 120px;
    height: 140px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    padding: 15px;
}

.desktop-icon:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 0 10px rgba(0, 255, 255, 0.8));
}

.desktop-icon.selected {
    background: rgba(0, 255, 255, 0.2);
    border: 1px dashed #0ff;
}

.icon-image {
    width: 80px;
    height: 80px;
    margin: 0 auto 5px;
    background: rgba(0, 255, 255, 0.1);
    border: 3px solid #0ff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    transition: all 0.3s;
}

.desktop-icon:hover .icon-image {
    background: rgba(0, 255, 255, 0.3);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.6);
}

.desktop-icon:active .icon-image {
    transform: scale(0.95);
    background: rgba(0, 255, 255, 0.5);
}

.icon-label {
    color: #0ff;
    font-size: 12px;
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
    word-wrap: break-word;
}

/* Taskbar */
#taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: rgba(0, 0, 0, 0.9);
    border-top: 1px solid #0ff;
    display: flex;
    align-items: center;
    padding: 0 10px;
    z-index: 9999;
}

.start-button {
    background: linear-gradient(135deg, #0ff 0%, #00f 100%);
    color: #000;
    border: none;
    padding: 5px 15px;
    margin-right: 10px;
    cursor: pointer;
    font-weight: bold;
    font-family: inherit;
    transition: all 0.2s;
}

.start-button:hover {
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
    transform: scale(1.05);
}

.taskbar-items {
    flex: 1;
    display: flex;
    gap: 5px;
}

.taskbar-item {
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid #0ff;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.taskbar-item:hover {
    background: rgba(0, 255, 255, 0.3);
}

.taskbar-item.active {
    background: rgba(0, 255, 255, 0.4);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.6);
}

.system-tray {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: #0ff;
}

/* Start Menu */
#start-menu {
    position: absolute;
    bottom: 40px;
    left: 0;
    width: 300px;
    background: rgba(0, 0, 0, 0.95);
    border: 1px solid #0ff;
    display: none;
    flex-direction: column;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.4);
}

#start-menu.active {
    display: flex;
}

.start-menu-header {
    background: linear-gradient(90deg, #0ff 0%, #00f 100%);
    color: #000;
    padding: 20px;
    font-weight: bold;
}

.start-menu-items {
    padding: 15px;
}

.start-menu-item {
    padding: 15px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.start-menu-item:hover {
    background: rgba(0, 255, 255, 0.2);
    padding-left: 20px;
}

/* Project Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.project-card {
    background: rgba(0, 255, 255, 0.05);
    border: 1px solid #0ff;
    padding: 20px;
    transition: all 0.3s;
    cursor: pointer;
}

.project-card:hover {
    background: rgba(0, 255, 255, 0.1);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.4);
    transform: translateY(-5px);
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 10px;
}

.tech-tag {
    background: rgba(0, 255, 0, 0.2);
    border: 1px solid #0f0;
    padding: 2px 8px;
    font-size: 12px;
    color: #0f0;
}

/* Music Player */
.music-player {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #0ff;
    padding: 20px;
    margin-top: 20px;
    text-align: center;
}

.waveform {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    height: 60px;
    gap: 2px;
    margin: 20px 0;
}

.waveform-bar {
    width: 4px;
    background: linear-gradient(to top, #0ff, #00f);
}

/* Social Links */
.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.social-link {
    color: #0ff;
    text-decoration: none;
    padding: 15px;
    border: 1px solid #0ff;
    transition: all 0.3s;
    display: inline-block;
}

.social-link:hover {
    background: rgba(0, 255, 255, 0.2);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.6);
    transform: scale(1.1);
}

/* Loading Screen */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.5s;
}

#loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-text {
    font-size: 36px;
    margin-bottom: 20px;
    color: #0ff;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
}

.loading-bar {
    width: 300px;
    height: 20px;
    border: 1px solid #0ff;
    background: rgba(0, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.loading-progress {
    height: 100%;
    background: linear-gradient(90deg, #0ff 0%, #00f 100%);
    width: 0%;
    transition: width 0.3s;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
}

/* Track Links */
.track-link {
    display: block;
    color: inherit;
    text-decoration: none;
    transition: all 0.3s ease;
}

.track-link:hover {
    background: rgba(0, 255, 255, 0.1);
    padding-left: 20px;
}

.track-link:hover .play-icon {
    transform: translateX(5px);
}

.play-icon {
    color: #0ff;
    float: right;
    transition: transform 0.3s ease;
}

/* Links */
a {
    color: #0ff;
    text-decoration: none;
    transition: all 0.3s;
}

a:hover {
    color: #fff;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
}

/* External Link Icons */
a[href^="http"]:not([href*="twahirwa.com"])::after,
a[href^="https"]:not([href*="twahirwa.com"])::after {
    content: " 🔗";
    font-size: 0.8em;
    opacity: 0.7;
    margin-left: 3px;
}

/* Platform-specific external link icons */
a[href*="github.com"]::after {
    content: " 🐙";
}

a[href*="linkedin.com"]::after {
    content: " 💼";
}

a[href*="instagram.com"]::after {
    content: " 📸";
}

a[href*="youtube.com"]::after,
a[href*="youtu.be"]::after {
    content: " 📺";
}

a[href*="tiktok.com"]::after {
    content: " 🎬";
}

a[href*="spotify.com"]::after {
    content: " 🎵";
}

a[href*="twitter.com"]::after,
a[href*="x.com"]::after {
    content: " 🐦";
}

a[href*="scholar.google"]::after {
    content: " 🎓";
}

a[href^="mailto:"]::after {
    content: " 📧";
}

a[href^="tel:"]::after {
    content: " 📞";
}

/* Hover effects for external links */
a[href^="http"]:hover::after,
a[href^="https"]:hover::after,
a[href^="mailto:"]::after {
    opacity: 1;
    transform: scale(1.1);
    transition: all 0.2s ease;
}

/* Social link button enhancements */
.social-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.social-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 255, 255, 0.3);
}

/* Technology badge icons */
.tech-tag {
    position: relative;
}

.tech-tag:before {
    margin-right: 4px;
}

/* Technology-specific icons */
.tech-tag:contains("Python"):before { content: "🐍"; }
.tech-tag:contains("JavaScript"):before { content: "⚡"; }
.tech-tag:contains("React"):before { content: "⚛️"; }
.tech-tag:contains("TensorFlow"):before { content: "🧠"; }
.tech-tag:contains("PyTorch"):before { content: "🔥"; }
.tech-tag:contains("Qiskit"):before { content: "⚛️"; }
.tech-tag:contains("D3"):before { content: "📊"; }
.tech-tag:contains("SQL"):before { content: "🗄️"; }
.tech-tag:contains("Cloud"):before { content: "☁️"; }
.tech-tag:contains("Docker"):before { content: "🐳"; }
.tech-tag:contains("Git"):before { content: "🌲"; }

/* Favicon loading indicator */
.favicon-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    background: linear-gradient(45deg, #00ffff, transparent, #00ffff);
    border-radius: 50%;
    animation: favicon-pulse 2s infinite;
}

@keyframes favicon-pulse {
    0%, 100% { opacity: 0.5; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1); }
}

/* PWA install prompt styling */
.pwa-install-prompt {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 255, 255, 0.9);
    color: #000;
    padding: 12px 20px;
    border-radius: 8px;
    border: 2px solid #00ffff;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    z-index: 10000;
    cursor: pointer;
    transform: translateY(100px);
    transition: transform 0.3s ease;
}

.pwa-install-prompt.show {
    transform: translateY(0);
}

.pwa-install-prompt:hover {
    background: #00ffff;
    transform: translateY(-2px);
}

/* Icon enhancement for better visibility */
.window-header span:before {
    margin-right: 8px;
    font-size: 1.1em;
}

/* Responsive icon adjustments */
@media (max-width: 768px) {
    a[href^="http"]::after,
    a[href^="https"]::after {
        font-size: 0.7em;
    }
    
    .tech-tag:before {
        margin-right: 2px;
        font-size: 0.9em;
    }
}
