/* ===== Reset & Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Improved color palette for better contrast and visibility */
    --primary-color: #6366f1;        /* Brighter indigo */
    --secondary-color: #8b5cf6;      /* Vibrant purple */
    --dark-color: #0a0e1a;           /* Deep navy background */
    --light-color: #0f1419;          /* Dark slate background */
    --text-color: #f1f5f9;           /* Bright slate for text */
    --gray-color: #cbd5e1;           /* Light slate for secondary text */
    --border-color: #1e293b;         /* Slate border */
    --success-color: #059669;        /* Green accent */
    --gradient: linear-gradient(135deg, #312e81 0%, #4c1d95 100%);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.7);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Fira Code', 'JetBrains Mono', 'Courier New', 'Consolas', 'Monaco', monospace;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-color);
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(67, 56, 202, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(109, 40, 217, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(67, 56, 202, 0.1) 0%, transparent 50%);
    animation: backgroundMove 20s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes backgroundMove {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.8;
    }
    33% {
        transform: translate(30px, -30px) scale(1.1);
        opacity: 1;
    }
    66% {
        transform: translate(-20px, 20px) scale(0.9);
        opacity: 0.9;
    }
}

/* Snow Effect */
.snowflake {
    position: fixed;
    top: -10px;
    z-index: 9999;
    user-select: none;
    cursor: default;
    animation: snowfall linear infinite;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1em;
    font-family: Arial, sans-serif;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
}

@keyframes snowfall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0.7;
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

section {
    padding: 100px 0;
}

/* ===== Navigation ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(10, 14, 26, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid rgba(99, 102, 241, 0.2);
    z-index: 10000;
    transition: all 0.3s ease;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
}

.nav-brand h2 {
    font-size: 28px;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 40px;
}

.nav-link {
    text-decoration: none;
    color: #f1f5f9;
    font-weight: 500;
    font-size: 16px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient);
    transition: width 0.3s ease;
}

.nav-link:hover {
    color: #a5b4fc;
}

.nav-link:hover::after {
    width: 100%;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.hamburger .bar {
    width: 25px;
    height: 3px;
    background-color: #f1f5f9;
    margin: 3px 0;
    transition: 0.3s;
}

/* ===== Hero Section ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 80px;
    background: linear-gradient(135deg, #0a0e1a 0%, #1e1b4b 100%);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
    animation: pulse 8s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.hero-content {
    flex: 1;
    padding: 50px;
    z-index: 1;
}

.hero-title {
    font-size: 56px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 20px;
    animation: fadeInUp 1s ease;
}

.highlight {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 32px;
    color: #a5b4fc;
    margin-bottom: 20px;
    min-height: 48px;
    animation: fadeInUp 1s ease 0.2s both;
}

.typing-text {
    border-right: 3px solid var(--primary-color);
    animation: blink 0.7s infinite;
}

@keyframes blink {
    0%, 50% { border-color: transparent; }
    51%, 100% { border-color: var(--primary-color); }
}

.hero-description {
    font-size: 18px;
    color: #cbd5e1;
    margin-bottom: 30px;
    max-width: 600px;
    animation: fadeInUp 1s ease 0.4s both;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
    animation: fadeInUp 1s ease 0.6s both;
}

.btn {
    padding: 14px 32px;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    display: inline-block;
    cursor: pointer;
    border: 2px solid transparent;
}

.btn-primary {
    background: var(--gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-3px);
}

.social-links {
    display: flex;
    gap: 15px;
    animation: fadeInUp 1s ease 0.8s both;
}

.social-icon {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: white;
    color: var(--primary-color);
    font-size: 20px;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.social-icon:hover {
    background: var(--gradient);
    color: white;
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.3);
}

.hero-image {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeInRight 1s ease;
}

.image-placeholder {
    width: 400px;
    height: 400px;
    background: var(--gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    animation: float 3s ease-in-out infinite;
}

.image-placeholder i {
    font-size: 150px;
    color: white;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===== Section Title ===== */
.section-title {
    font-size: 42px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 60px;
    color: #ffffff;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--gradient);
    border-radius: 2px;
}

/* ===== About Section ===== */
.about {
    background: #0f1419;
    position: relative;
    z-index: 1;
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 60px;
    align-items: center;
}

.about-image {
    display: flex;
    justify-content: center;
}

.image-frame {
    width: 300px;
    height: 300px;
    background: var(--gradient);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    transform: rotate(-5deg);
    transition: transform 0.3s ease;
    border: 2px solid rgba(67, 56, 202, 0.5);
}

.image-frame:hover {
    transform: rotate(0deg);
}

.image-frame i {
    font-size: 120px;
    color: white;
}

.about-text h3 {
    font-size: 28px;
    color: #ffffff;
    margin-bottom: 20px;
}

.about-text p {
    font-size: 16px;
    color: #cbd5e1;
    margin-bottom: 15px;
    line-height: 1.8;
}

.about-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 30px 0;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-color);
}

.info-item i {
    color: var(--primary-color);
    font-size: 18px;
}

/* ===== Skills Section ===== */
.skills {
    background: linear-gradient(135deg, #0a0e1a 0%, #1e1b4b 100%);
    position: relative;
    z-index: 1;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.skill-card {
    background: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(67, 56, 202, 0.2);
    padding: 30px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: all 0.3s ease;
}

.skill-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.skill-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: var(--gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: white;
}

.skill-card h3 {
    font-size: 22px;
    color: #ffffff;
    margin-bottom: 15px;
}

.skill-bar {
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.skill-progress {
    height: 100%;
    background: var(--gradient);
    border-radius: 10px;
    transition: width 1s ease;
}

.skill-percent {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-color);
}

/* ===== Projects Section ===== */
.projects {
    background: #0f1419;
    position: relative;
    z-index: 1;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.project-card {
    background: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(67, 56, 202, 0.2);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.project-image {
    height: 200px;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.project-image i {
    font-size: 80px;
    color: white;
    transition: all 0.3s ease;
}

.project-card:hover .project-image i {
    transform: scale(1.2) rotate(5deg);
}

.project-content {
    padding: 25px;
}

.project-content h3 {
    font-size: 22px;
    color: #ffffff;
    margin-bottom: 10px;
}

.project-content p {
    color: #cbd5e1;
    margin-bottom: 15px;
    font-size: 15px;
}

.project-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.tag {
    padding: 5px 12px;
    background: #e0e7ff;
    color: var(--primary-color);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.project-links {
    display: flex;
    gap: 15px;
}

.project-link {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 600;
    transition: color 0.3s ease;
}

.project-link:hover {
    color: var(--secondary-color);
}

/* ===== Contact Section ===== */
.contact {
    background: linear-gradient(135deg, #0a0e1a 0%, #1e1b4b 100%);
    position: relative;
    z-index: 1;
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
}

.contact-info h3 {
    font-size: 32px;
    color: #ffffff;
    margin-bottom: 20px;
}

.contact-info p {
    color: #cbd5e1;
    margin-bottom: 30px;
    font-size: 16px;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contact-item {
    display: flex;
    gap: 15px;
    align-items: center;
}

.contact-item i {
    width: 50px;
    height: 50px;
    background: var(--gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 20px;
}

.contact-item h4 {
    font-size: 16px;
    color: #ffffff;
    margin-bottom: 5px;
}

.contact-item p {
    color: #cbd5e1;
    margin: 0;
}

.contact-form {
    background: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(67, 56, 202, 0.2);
    padding: 40px;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: 20px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.3s ease;
    background: rgba(10, 14, 26, 0.6);
    color: #ffffff;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.form-group textarea {
    resize: vertical;
}

/* ===== Footer ===== */
.footer {
    background: var(--dark-color);
    color: white;
    padding: 30px 0;
    text-align: center;
}

.footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer p {
    margin: 0;
}

.footer-social {
    display: flex;
    gap: 15px;
}

.footer .social-icon {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.footer .social-icon:hover {
    background: var(--gradient);
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: rgba(10, 14, 26, 0.98);
        backdrop-filter: blur(10px);
        border-top: 1px solid rgba(99, 102, 241, 0.2);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.5);
        padding: 20px 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .hero {
        flex-direction: column;
        text-align: center;
        padding-top: 100px;
    }

    .hero-content {
        padding: 20px;
    }

    .hero-title {
        font-size: 36px;
    }

    .hero-subtitle {
        font-size: 24px;
    }

    .hero-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }

    .social-links {
        justify-content: center;
    }

    .hero-image {
        margin-top: 40px;
    }

    .image-placeholder {
        width: 280px;
        height: 280px;
    }

    .image-placeholder i {
        font-size: 100px;
    }

    .about-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .about-info {
        grid-template-columns: 1fr;
    }

    .contact-content {
        grid-template-columns: 1fr;
    }

    .footer .container {
        flex-direction: column;
        gap: 20px;
    }

    section {
        padding: 60px 0;
    }

    .section-title {
        font-size: 32px;
    }
}

/* ===== Mobile Touch & Animations ===== */
@media (max-width: 768px) {
    /* Smooth scroll behavior */
    html {
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }

    /* Card tap animations */
    .skill-card,
    .project-card,
    .stat-box {
        transform-style: preserve-3d;
        transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    .skill-card:active,
    .project-card:active,
    .stat-box:active {
        transform: scale(0.95) translateY(5px);
        box-shadow: 0 5px 15px rgba(67, 56, 202, 0.4);
    }

    /* Button ripple effect */
    .btn {
        position: relative;
        overflow: hidden;
        transform: translateZ(0);
    }

    .btn::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 0;
        height: 0;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.3);
        transform: translate(-50%, -50%);
        transition: width 0.6s, height 0.6s;
    }

    .btn:active::before {
        width: 300px;
        height: 300px;
    }

    /* Floating animation for hero */
    .hero-content {
        animation: mobileFloat 3s ease-in-out infinite;
    }

    @keyframes mobileFloat {
        0%, 100% { transform: translateY(0); }
        50% { transform: translateY(-10px); }
    }

    /* Slide in from sides */
    .skill-card {
        animation: slideInMobile 0.6s ease-out backwards;
    }

    .skill-card:nth-child(odd) {
        animation-name: slideInLeft;
    }

    .skill-card:nth-child(even) {
        animation-name: slideInRight;
    }

    @keyframes slideInLeft {
        from {
            opacity: 0;
            transform: translateX(-50px);
        }
        to {
            opacity: 1;
            transform: translateX(0);
        }
    }

    @keyframes slideInRight {
        from {
            opacity: 0;
            transform: translateX(50px);
        }
        to {
            opacity: 1;
            transform: translateX(0);
        }
    }

    /* Project card flip effect */
    .project-card {
        perspective: 1000px;
    }

    .project-card:active .project-content {
        transform: rotateX(5deg);
    }

    /* Pulsating social icons */
    .social-icon {
        animation: socialPulse 2s ease-in-out infinite;
    }

    .social-icon:nth-child(1) { animation-delay: 0s; }
    .social-icon:nth-child(2) { animation-delay: 0.2s; }
    .social-icon:nth-child(3) { animation-delay: 0.4s; }
    .social-icon:nth-child(4) { animation-delay: 0.6s; }

    @keyframes socialPulse {
        0%, 100% { transform: scale(1); }
        50% { transform: scale(1.1); }
    }

    /* Section title entrance */
    .section-title {
        animation: titleBounce 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    }

    @keyframes titleBounce {
        0% {
            opacity: 0;
            transform: scale(0.3) rotate(-10deg);
        }
        50% {
            transform: scale(1.05) rotate(2deg);
        }
        100% {
            opacity: 1;
            transform: scale(1) rotate(0);
        }
    }

    /* Image placeholder rotation */
    .image-placeholder {
        animation: spinGlow 4s linear infinite;
    }

    @keyframes spinGlow {
        0% {
            transform: rotate(0deg);
            box-shadow: 0 0 20px rgba(67, 56, 202, 0.5);
        }
        50% {
            box-shadow: 0 0 40px rgba(109, 40, 217, 0.8);
        }
        100% {
            transform: rotate(360deg);
            box-shadow: 0 0 20px rgba(67, 56, 202, 0.5);
        }
    }

    /* Input focus animation */
    .form-group input:focus,
    .form-group textarea:focus {
        transform: scale(1.02);
        box-shadow: 0 0 20px rgba(67, 56, 202, 0.5);
    }

    /* Navbar slide in */
    .navbar {
        animation: navSlideDown 0.5s ease-out;
    }

    @keyframes navSlideDown {
        from {
            transform: translateY(-100%);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }

    /* Tag bounce animation */
    .tag {
        animation: tagBounce 0.5s ease-out backwards;
    }

    .tag:nth-child(1) { animation-delay: 0.1s; }
    .tag:nth-child(2) { animation-delay: 0.2s; }
    .tag:nth-child(3) { animation-delay: 0.3s; }

    @keyframes tagBounce {
        0% {
            opacity: 0;
            transform: translateY(20px) scale(0.8);
        }
        60% {
            transform: translateY(-5px) scale(1.05);
        }
        100% {
            opacity: 1;
            transform: translateY(0) scale(1);
        }
    }

    /* Contact item slide in */
    .contact-item {
        animation: slideInBottom 0.6s ease-out backwards;
    }

    .contact-item:nth-child(1) { animation-delay: 0.1s; }
    .contact-item:nth-child(2) { animation-delay: 0.2s; }
    .contact-item:nth-child(3) { animation-delay: 0.3s; }

    @keyframes slideInBottom {
        from {
            opacity: 0;
            transform: translateY(30px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    /* Progress bar animation */
    .skill-progress {
        animation: progressGlow 2s ease-in-out infinite;
    }

    @keyframes progressGlow {
        0%, 100% {
            box-shadow: 0 0 5px rgba(67, 56, 202, 0.5);
        }
        50% {
            box-shadow: 0 0 15px rgba(109, 40, 217, 0.8);
        }
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 28px;
        animation: titleWave 2s ease-in-out infinite;
    }

    @keyframes titleWave {
        0%, 100% { transform: translateX(0); }
        25% { transform: translateX(-5px); }
        75% { transform: translateX(5px); }
    }

    .hero-subtitle {
        font-size: 20px;
    }

    .btn {
        padding: 12px 24px;
        font-size: 14px;
    }

    .image-frame {
        width: 250px;
        height: 250px;
    }

    .image-frame i {
        font-size: 90px;
    }

    /* Mobile snow effect - less intensive */
    .snowflake {
        font-size: 0.8em;
    }
}
