/* Galaxy Theme CSS */
:root {
    --primary-color: #4a90e2;
    --secondary-color: #7b68ee;
    --accent-color: #ff6b6b;
    --background-color: #0a0a0a;
    --text-color: #ffffff;
    --text-muted: #b0b0b0;
    --card-bg: rgba(20, 20, 30, 0.8);
    --border-color: rgba(255, 255, 255, 0.1);
    --gradient-primary: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    --gradient-accent: linear-gradient(135deg, var(--accent-color), #ff8a80);
    --shadow-glow: 0 4px 20px rgba(74, 144, 226, 0.3);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.3);
    --font-primary: 'Orbitron', monospace;
    --font-secondary: 'Exo 2', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-secondary);
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Galaxy Background */
.galaxy-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(ellipse at center, #1a1a2e 0%, #0a0a0a 100%);
}

.stars {
    position: absolute;
    width: 100%;
    height: 100%;
    background: transparent;
}

.stars::before,
.stars::after {
    content: '';
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    animation: twinkle 3s infinite;
}

.stars::before {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.stars::after {
    top: 60%;
    left: 80%;
    animation-delay: 1.5s;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

.nebula {
    position: absolute;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at 20% 80%, rgba(123, 104, 238, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(74, 144, 226, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 40% 40%, rgba(255, 107, 107, 0.05) 0%, transparent 50%);
    animation: nebula-drift 20s ease-in-out infinite;
}

@keyframes nebula-drift {
    0%, 100% { transform: translateX(0) translateY(0); }
    33% { transform: translateX(-20px) translateY(10px); }
    66% { transform: translateX(20px) translateY(-10px); }
}

.floating-objects {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.floating-objects::before,
.floating-objects::after {
    content: '';
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: float 8s ease-in-out infinite;
}

.floating-objects::before {
    top: 30%;
    left: 20%;
    animation-delay: 0s;
}

.floating-objects::after {
    top: 70%;
    left: 70%;
    animation-delay: 4s;
}

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

/* Navigation */
.nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-logo a {
    font-family: var(--font-primary);
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--text-color);
    text-decoration: none;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background: var(--gradient-primary);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 2rem;
    position: relative;
}

.hero-content {
    max-width: 600px;
    text-align: center;
    z-index: 2;
}

.hero-title {
    font-family: var(--font-primary);
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 900;
    margin-bottom: 1rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.glitch-text {
    position: relative;
    animation: glitch 2s infinite;
}

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

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-weight: 300;
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 1rem;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(74, 144, 226, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--text-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.hero-visual {
    position: absolute;
    right: 10%;
    top: 50%;
    transform: translateY(-50%);
    width: 300px;
    height: 300px;
    z-index: 1;
}

.planet-system {
    position: relative;
    width: 100%;
    height: 100%;
    animation: rotate 20s linear infinite;
}

.planet {
    position: absolute;
    border-radius: 50%;
    background: var(--gradient-primary);
    box-shadow: 0 0 30px rgba(74, 144, 226, 0.5);
}

.planet-main {
    width: 100px;
    height: 100px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.planet-moon {
    width: 30px;
    height: 30px;
    top: 20%;
    left: 20%;
    background: var(--gradient-accent);
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.5);
    animation: moon-orbit 10s linear infinite;
}

.orbit {
    position: absolute;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.orbit-1 {
    width: 150px;
    height: 150px;
}

.orbit-2 {
    width: 200px;
    height: 200px;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes moon-orbit {
    from { transform: rotate(0deg) translateX(80px) rotate(0deg); }
    to { transform: rotate(360deg) translateX(80px) rotate(-360deg); }
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Sections */
section {
    padding: 100px 0;
}

.section-title {
    font-family: var(--font-primary);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    text-align: center;
    margin-bottom: 1rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 3rem;
}

/* Projects Oscillating Layout */
.projects-oscillating {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 4rem; /* Increased spacing between projects */
}

.project-left {
    align-self: flex-start;
    max-width: 70%;
    margin-left: 0;
    margin-right: auto;
}

.project-right {
    align-self: flex-end;
    max-width: 70%;
    margin-left: auto;
    margin-right: 0;
    text-align: right;
}

.project-right .project-tags {
    justify-content: flex-end;
}

.project-right .project-links {
    justify-content: flex-end;
}

/* Timeline (Legacy - kept for compatibility) */
.timeline {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--gradient-primary);
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    margin: 50px 0;
    width: 100%;
}

.timeline-item:nth-child(odd) .timeline-content {
    margin-left: 50%;
    padding-left: 40px;
}

.timeline-item:nth-child(even) .timeline-content {
    margin-right: 50%;
    padding-right: 40px;
    text-align: right;
}

.timeline-marker {
    position: absolute;
    left: 50%;
    top: 20px;
    width: 20px;
    height: 20px;
    background: var(--gradient-primary);
    border-radius: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 20px rgba(74, 144, 226, 0.6);
    z-index: 10;
}

.timeline-year {
    font-family: var(--font-primary);
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.project-card {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 2rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.project-card:hover::before {
    transform: translateX(0);
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-card);
    border-color: var(--primary-color);
}

.project-card.featured {
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 30px rgba(74, 144, 226, 0.2);
}

.project-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.project-card h4 {
    font-family: var(--font-primary);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.project-card p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tag {
    background: rgba(74, 144, 226, 0.2);
    color: var(--primary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid rgba(74, 144, 226, 0.3);
}

.project-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.project-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.project-link:hover {
    color: var(--secondary-color);
}

/* About Section */
.about {
    background: rgba(20, 20, 30, 0.3);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-text p {
    margin-bottom: 1.5rem;
    color: var(--text-muted);
    line-height: 1.8;
}

.about-visual {
    position: relative;
}

.code-snippet {
    background: rgba(10, 10, 10, 0.8);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
}

.code-header {
    background: rgba(30, 30, 30, 0.9);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
}

.code-lang {
    color: var(--primary-color);
    font-weight: 600;
    font-family: var(--font-primary);
}

.code-file {
    color: var(--text-muted);
    font-family: monospace;
}

.code-content {
    padding: 1.5rem;
}

.code-content pre {
    color: var(--text-color);
    font-family: 'Fira Code', monospace;
    line-height: 1.6;
    margin: 0;
}

.code-content code {
    color: var(--text-color);
}

/* Contact Section */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.contact-card {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    text-decoration: none;
    color: var(--text-color);
    position: relative;
    overflow: hidden;
}

.contact-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.contact-card:hover::before {
    transform: translateX(0);
}

.contact-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-card);
    border-color: var(--primary-color);
}

.contact-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.contact-card h3 {
    font-family: var(--font-primary);
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.contact-card p {
    color: var(--text-muted);
    margin: 0;
}

/* Footer */
.footer {
    background: rgba(10, 10, 10, 0.9);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    text-align: center;
}

.footer p {
    color: var(--text-muted);
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        padding: 0 1rem;
    }
    
    .nav-links {
        gap: 1rem;
    }
    
    .hero {
        padding: 0 1rem;
    }
    
    .hero-visual {
        display: none;
    }
    
    .hero-cta {
        flex-direction: column;
        align-items: center;
    }
    
    .timeline::before {
        left: 20px;
    }
    
    .timeline-item:nth-child(odd) .timeline-content,
    .timeline-item:nth-child(even) .timeline-content {
        margin-left: 40px;
        margin-right: 0;
        padding-left: 20px;
        padding-right: 0;
        text-align: left;
    }
    
    .timeline-marker {
        left: 20px;
    }
    
    /* Responsive oscillating layout */
    .projects-oscillating {
        gap: 3rem; /* Reduce spacing on mobile */
    }
    
    .project-left,
    .project-right {
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
        text-align: left;
    }
    
    .project-right .project-tags {
        justify-content: flex-start;
    }
    
    .project-right .project-links {
        justify-content: flex-start;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .contact-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    section {
        padding: 60px 0;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .timeline-year {
        font-size: 1.5rem;
    }
    
    .project-card {
        padding: 1.5rem;
    }
    
    .contact-card {
        padding: 1.5rem;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection styles */
::selection {
    background: var(--primary-color);
    color: white;
}

/* Scrollbar styles */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--background-color);
}

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

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}