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

:root {
    --primary-color: #3b82f6;
    --secondary-color: #8b5cf6;
    --dark-bg: #0f172a;
    --light-bg: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --accent-glow: rgba(59, 130, 246, 0.3);
    --card-bg: rgba(30, 41, 59, 0.6);
    --border-color: rgba(148, 163, 184, 0.1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--dark-bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Background Gradient Animation */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 20%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
    z-index: -1;
    animation: bgShift 15s ease-in-out infinite;
}

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

/* 3D Animated Shapes Background */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    overflow: hidden;
    perspective: 1000px;
    transform-style: preserve-3d;
}

.shape-3d {
    position: absolute;
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
    transform-style: preserve-3d;
    animation: move3d 15s ease-in-out infinite;
}

.shape-3d::before,
.shape-3d::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: inherit;
    opacity: 0.5;
}

.shape-3d::before {
    transform: translateZ(-50px);
}

.shape-3d::after {
    transform: translateZ(50px);
}

/* Shape 1 - Purple Cube */
.shape-3d:nth-child(1) {
    width: 180px;
    height: 180px;
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    top: 15%;
    left: 10%;
    filter: blur(40px);
    opacity: 0.6;
    animation: move3d 20s ease-in-out infinite, rotate3d 10s linear infinite;
}

/* Shape 2 - Violet Sphere */
.shape-3d:nth-child(2) {
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, #a855f7, #8b5cf6);
    border-radius: 50%;
    top: 50%;
    right: 15%;
    filter: blur(50px);
    opacity: 0.5;
    animation: move3d 25s ease-in-out infinite reverse, rotate3d 15s linear infinite reverse;
    animation-delay: -5s;
}

/* Shape 3 - Blue-Purple Box */
.shape-3d:nth-child(3) {
    width: 160px;
    height: 160px;
    background: linear-gradient(225deg, #6366f1, #8b5cf6);
    bottom: 20%;
    left: 25%;
    filter: blur(45px);
    opacity: 0.6;
    animation: move3d 18s ease-in-out infinite, rotate3d 12s linear infinite;
    animation-delay: -8s;
}

/* Shape 4 - Large Purple Orb */
.shape-3d:nth-child(4) {
    width: 280px;
    height: 280px;
    background: radial-gradient(circle at 30% 30%, #a855f7, #7c3aed);
    border-radius: 50%;
    top: 35%;
    right: 35%;
    filter: blur(60px);
    opacity: 0.4;
    animation: move3d 30s ease-in-out infinite reverse, rotate3d 20s linear infinite;
    animation-delay: -12s;
}

/* Shape 5 - Small Accent */
.shape-3d:nth-child(5) {
    width: 140px;
    height: 140px;
    background: linear-gradient(45deg, #c084fc, #a855f7);
    border-radius: 30%;
    bottom: 30%;
    right: 20%;
    filter: blur(35px);
    opacity: 0.7;
    animation: move3d 22s ease-in-out infinite, rotate3d 8s linear infinite reverse;
    animation-delay: -3s;
}

/* Shape 6 - Floating Cube */
.shape-3d:nth-child(6) {
    width: 190px;
    height: 190px;
    background: linear-gradient(180deg, #7c3aed, #6366f1);
    top: 70%;
    left: 15%;
    filter: blur(42px);
    opacity: 0.55;
    animation: move3d 24s ease-in-out infinite reverse, rotate3d 14s linear infinite;
    animation-delay: -10s;
}

/* 3D Movement Animation */
@keyframes move3d {
    0%, 100% {
        transform: translate3d(0, 0, 0) scale(1);
    }
    16% {
        transform: translate3d(100px, -50px, 150px) scale(1.1);
    }
    33% {
        transform: translate3d(50px, -120px, 80px) scale(0.9);
    }
    50% {
        transform: translate3d(-80px, -80px, 200px) scale(1.15);
    }
    66% {
        transform: translate3d(-120px, -40px, 50px) scale(0.95);
    }
    83% {
        transform: translate3d(-50px, 60px, 120px) scale(1.05);
    }
}

/* 3D Rotation Animation */
@keyframes rotate3d {
    0% {
        transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
    }
    33% {
        transform: rotateX(120deg) rotateY(180deg) rotateZ(90deg);
    }
    66% {
        transform: rotateX(240deg) rotateY(360deg) rotateZ(180deg);
    }
    100% {
        transform: rotateX(360deg) rotateY(540deg) rotateZ(270deg);
    }
}

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

/* Header & Navigation */
header {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: logoGlow 3s ease-in-out infinite;
}

@keyframes logoGlow {
    0%, 100% { filter: drop-shadow(0 0 10px rgba(59, 130, 246, 0.5)); }
    50% { filter: drop-shadow(0 0 20px rgba(139, 92, 246, 0.8)); }
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    position: relative;
}

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

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

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

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 2px;
    background: var(--primary-color);
    transition: all 0.3s;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 8rem 2rem 4rem;
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-text h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    margin-bottom: 0.5rem;
    line-height: 1.1;
}

.subtitle {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.8;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    border: 2px solid transparent;
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 10px 30px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(59, 130, 246, 0.5);
}

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

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

.btn-large {
    padding: 1.125rem 2.5rem;
    font-size: 1.1rem;
}

/* Code Window */
.hero-code {
    perspective: 1000px;
}

.code-window {
    background: linear-gradient(135deg, rgba(30, 27, 75, 0.95), rgba(15, 23, 42, 0.95));
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 
        0 20px 60px rgba(139, 92, 246, 0.4),
        0 0 0 1px rgba(139, 92, 246, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.4);
    transform-style: preserve-3d;
    transition: transform 0.3s;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotateX(0); }
    50% { transform: translateY(-10px) rotateX(2deg); }
}

.code-window:hover {
    transform: translateY(-5px) rotateX(5deg);
    box-shadow: 
        0 25px 70px rgba(139, 92, 246, 0.6),
        0 0 0 1px rgba(139, 92, 246, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.code-header {
    background: linear-gradient(180deg, rgba(30, 27, 75, 0.9), rgba(20, 18, 50, 0.9));
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    border-bottom: 1px solid rgba(139, 92, 246, 0.3);
    backdrop-filter: blur(10px);
}

.dot {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
    box-shadow: 0 0 10px currentColor;
}

.dot-red {
    background: #ff6b6b;
    animation-delay: 0s;
}

.dot-yellow {
    background: #ffd93d;
    animation-delay: 0.2s;
}

.dot-green {
    background: #6bcf7f;
    animation-delay: 0.4s;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(0.9); }
}

.code-title {
    margin-left: auto;
    color: #a78bfa;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
}

.code-content {
    padding: 1.25rem 1.5rem;
    position: relative;
    max-height: 380px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(15, 10, 40, 0.6), rgba(20, 15, 50, 0.6));
}

.code-content pre {
    margin: 0;
    font-family: 'Fira Code', 'SF Mono', 'Monaco', 'Inconsolata', 'Consolas', monospace;
    font-size: 0.875rem;
    line-height: 1.7;
    letter-spacing: 0.3px;
}

.code-content code {
    display: block;
}

/* Code Syntax Highlighting - Enhanced Colors */
.code-keyword {
    color: #ff79c6;
    font-weight: 600;
}

.code-type {
    color: #8be9fd;
    font-weight: 500;
}

.code-string {
    color: #f1fa8c;
}

.code-function {
    color: #50fa7b;
    font-weight: 500;
}

.code-number {
    color: #bd93f9;
}

.code-comment {
    color: #6272a4;
    font-style: italic;
}

.cursor-blink {
    display: inline-block;
    width: 10px;
    height: 18px;
    background: #a78bfa;
    margin-left: 2px;
    animation: blink 0.8s step-end infinite;
    box-shadow: 0 0 8px #a78bfa;
}

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

/* Animations */
.animate-slide-up {
    animation: slideUp 0.8s ease-out both;
}

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

/* Sections */
section {
    padding: 6rem 2rem;
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    text-align: center;
    margin-bottom: 1rem;
}

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

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

.about-content {
    max-width: 800px;
    margin: 0 auto;
}

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

.about-text .btn {
    margin-top: 1rem;
}

/* Projects Section */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.project-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
    transition: left 0.6s;
}

.project-card:hover::before {
    left: 100%;
}

.project-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary-color);
    box-shadow: 0 20px 60px var(--accent-glow);
}

.project-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: inline-block;
    animation: iconFloat 3s ease-in-out infinite;
}

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

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

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

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

.tag {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.8rem;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

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

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

.link:hover {
    color: var(--secondary-color);
    transform: translateX(5px);
    display: inline-block;
}

/* Contact Section */
.contact {
    background: rgba(30, 41, 59, 0.3);
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.contact-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s;
    display: block;
}

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

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

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

.contact-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.contact .btn-large {
    display: block;
    margin: 2rem auto 0;
    text-align: center;
    max-width: 300px;
}

/* Footer */
footer {
    background: rgba(15, 23, 42, 0.8);
    padding: 2rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

footer p {
    color: var(--text-secondary);
}

/* Responsive Design */
@media (max-width: 968px) {
    .hero-content {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .hero-code {
        order: -1;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 70%;
        max-width: 300px;
        background: var(--light-bg);
        flex-direction: column;
        padding: 6rem 2rem;
        transition: right 0.3s;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    }

    .nav-menu.active {
        right: 0;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }

    .cta-buttons {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 6rem 1rem 3rem;
    }

    .hero-text h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1.2rem;
    }

    section {
        padding: 4rem 1rem;
    }

    .project-card,
    .contact-card {
        padding: 1.5rem;
    }
}

/* Scroll Animation Observer */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s, transform 0.6s;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}
