/* Import the Press Start 2P font for that authentic retro feel */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

/* Global Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Press Start 2P', cursive;
    background: linear-gradient(45deg, #0f0f23, #1a1a2e, #16213e);
    background-size: 400% 400%;
    animation: gradientShift 12s ease infinite;
    margin: 0;
    padding: 20px;
    min-height: 100vh;
    overflow-x: auto;
    position: relative;
}

/* Animated Background Icons */
.animated-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.bounce-icon {
    position: absolute;
    opacity: 0.4;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
    animation: float 4s ease-in-out infinite;
    transition: opacity 0.3s ease;
}

.bounce-icon:hover {
    opacity: 0.7;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    25% { transform: translateY(-15px) rotate(2deg); }
    50% { transform: translateY(-10px) rotate(-1deg); }
    75% { transform: translateY(-20px) rotate(1deg); }
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Ensure main content appears above animated background */
.container {
    position: relative;
    z-index: 10;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Section */
.header-section {
    text-align: center;
    margin-bottom: 50px;
    animation: titlePulse 3s ease-in-out infinite alternate;
}

@keyframes titlePulse {
    from { transform: scale(1); }
    to { transform: scale(1.02); }
}

.main-title {
    font-size: 3rem;
    margin-bottom: 15px;
    text-shadow: 4px 4px 0px #000;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 8s ease infinite;
}

.subtitle {
    font-size: 1rem;
    color: #ffd700;
    text-shadow: 2px 2px 0px #000;
}

/* About Section */
.about-section {
    margin-bottom: 60px;
    animation: slideInUp 0.8s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.about-content {
    padding: 20px;
}

.about-text {
    font-size: 0.8rem;
    line-height: 1.8;
    color: #f5f5f5;
    text-align: center;
}

/* Projects Section */
.projects-section {
    margin-bottom: 60px;
}

.section-title {
    text-align: center;
    font-size: 1.3rem;
    margin-bottom: 40px;
    text-shadow: 2px 2px 0px #000;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    padding: 20px 0;
}

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

.project-card:not(.coming-soon):hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0, 255, 255, 0.3);
}

.project-card.coming-soon {
    opacity: 0.7;
    cursor: default;
}

.project-container {
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    border: 4px solid #212529;
    display: flex;
    flex-direction: column;
}

.project-container .title {
    font-size: 1rem;
    margin-bottom: 20px;
    color: #212529;
}

/* Project Preview */
.project-preview {
    flex: 1;
    margin-bottom: 20px;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-image {
    width: 100%;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed #ccc;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.05);
}

/* Mini Characters for NES Project Preview */
.mini-characters {
    display: flex;
    align-items: center;
    gap: 15px;
    animation: miniCharacterBounce 2s ease-in-out infinite;
}

@keyframes miniCharacterBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.mini-badr, .mini-jalil {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    image-rendering: pixelated;
}

.mini-badr {
    background-image: url('projects/jalil-lab-nes-css/assets/badr-8-bit-removebg-preview_r1_c2.png');
    animation: miniWalk 1s infinite;
}

.mini-jalil {
    background-image: url('projects/jalil-lab-nes-css/assets/jalil-8_r1_c1.png');
    animation: miniWalk 1s infinite reverse;
}

@keyframes miniWalk {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.mini-vs {
    font-size: 0.8rem;
    color: #ff4757;
    font-weight: bold;
    animation: vsGlow 2s ease-in-out infinite alternate;
}

@keyframes vsGlow {
    from { text-shadow: 0 0 5px #ff4757; }
    to { text-shadow: 0 0 15px #ff4757, 0 0 25px #ff4757; }
}

/* Coming Soon Preview */
.coming-soon-preview {
    flex-direction: column;
    gap: 10px;
}

.coming-soon-preview .nes-icon {
    font-size: 2rem;
    animation: pulse 2s ease-in-out infinite;
}

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

/* Project Info */
.project-info {
    margin-bottom: 20px;
}

.project-description {
    font-size: 0.6rem;
    line-height: 1.5;
    color: #555;
    margin-bottom: 15px;
    text-align: left;
}

.project-tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.project-btn {
    width: 100%;
    font-size: 0.8rem;
    padding: 10px;
    margin-top: auto;
    transition: all 0.3s ease;
}

.project-btn:not(.nes-btn.is-disabled):hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 60px;
}

.footer-note {
    font-size: 0.5rem;
    margin-top: 10px;
}



/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .main-title {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 0.8rem;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .about-text {
        font-size: 0.7rem;
    }
    
    .project-description {
        font-size: 0.55rem;
    }
}

@media (max-width: 480px) {
    .main-title {
        font-size: 1.5rem;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .mini-characters {
        gap: 10px;
    }
    
    .mini-badr, .mini-jalil {
        width: 25px;
        height: 25px;
    }
}

/* Fun hover effects */
.nes-container:hover {
    animation: containerShake 0.5s ease-in-out;
}

@keyframes containerShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-1px); }
    75% { transform: translateX(1px); }
}

/* Glitch effect for main title */
.main-title:hover {
    animation: glitch 0.5s ease-in-out;
}

@keyframes glitch {
    0% { transform: translateX(0); }
    20% { transform: translateX(-2px); }
    40% { transform: translateX(2px); }
    60% { transform: translateX(-1px); }
    80% { transform: translateX(1px); }
    100% { transform: translateX(0); }
}
