:root {
    --bg-color: #f9f9f9;
    --text-color: #333;
    --accent: #4361ee;
    --card-bg: rgba(255, 255, 255, 0.8);
    --cursor-color: #4361ee;
    --gradient: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
    --glass-bg: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-shadow: rgba(0, 0, 0, 0.1);
}

body.dark {
    --bg-color: #121212;
    --text-color: #f5f5f5;
    --accent: #4cc9f0;
    --card-bg: rgba(30, 30, 30, 0.8);
    --cursor-color: #4cc9f0;
    --gradient: linear-gradient(135deg, #4cc9f0 0%, #4361ee 100%);
    --glass-bg: rgba(0, 0, 0, 0.15);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: rgba(0, 0, 0, 0.2);
}

/* Fluid background animation */
.fluid-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    opacity: 0.5;
}

body.dark .fluid-background {
    opacity: 0.4;
}

.color-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.7;
    animation: moveBlob 20s infinite alternate ease-in-out;
}

.color-blob:nth-child(1) {
    background: rgba(100, 181, 246, 0.6); /* Light blue */
    width: 500px;
    height: 500px;
    top: -100px;
    left: -100px;
    animation-duration: 25s;
    animation-delay: 0s;
}

.color-blob:nth-child(2) {
    background: rgba(236, 64, 122, 0.5); /* Pink */
    width: 600px;
    height: 600px;
    bottom: -150px;
    right: -100px;
    animation-duration: 30s;
    animation-delay: 5s;
}

.color-blob:nth-child(3) {
    background: rgba(129, 199, 132, 0.5); /* Green */
    width: 400px;
    height: 400px;
    top: 40%;
    left: 60%;
    animation-duration: 20s;
    animation-delay: 10s;
}

.color-blob:nth-child(4) {
    background: rgba(255, 183, 77, 0.5); /* Orange */
    width: 450px;
    height: 450px;
    bottom: 30%;
    right: 60%;
    animation-duration: 35s;
    animation-delay: 15s;
}

@keyframes moveBlob {
    0% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(50px, -80px) scale(1.1);
    }
    50% {
        transform: translate(100px, 50px) scale(0.9);
    }
    75% {
        transform: translate(-80px, 100px) scale(1.05);
    }
    100% {
        transform: translate(-100px, -50px) scale(0.95);
    }
}

/* Subtle particle effect */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: float 15s infinite linear;
}

body.dark .particle {
    background: rgba(255, 255, 255, 0.1);
}

.particle:nth-child(1) {
    width: 10px;
    height: 10px;
    top: 10%;
    left: 20%;
    animation-duration: 20s;
    animation-delay: 0s;
}

.particle:nth-child(2) {
    width: 8px;
    height: 8px;
    top: 20%;
    left: 80%;
    animation-duration: 25s;
    animation-delay: 5s;
}

.particle:nth-child(3) {
    width: 12px;
    height: 12px;
    top: 60%;
    left: 10%;
    animation-duration: 15s;
    animation-delay: 10s;
}

.particle:nth-child(4) {
    width: 6px;
    height: 6px;
    top: 80%;
    left: 70%;
    animation-duration: 30s;
    animation-delay: 15s;
}

.particle:nth-child(5) {
    width: 9px;
    height: 9px;
    top: 30%;
    left: 40%;
    animation-duration: 18s;
    animation-delay: 7s;
}

@keyframes float {
    0% {
        transform: translateY(0) translateX(0) rotate(0deg);
        opacity: 0.7;
    }
    25% {
        transform: translateY(-50px) translateX(30px) rotate(90deg);
        opacity: 0.5;
    }
    50% {
        transform: translateY(-100px) translateX(-40px) rotate(180deg);
        opacity: 0.8;
    }
    75% {
        transform: translateY(-70px) translateX(60px) rotate(270deg);
        opacity: 0.6;
    }
    100% {
        transform: translateY(0) translateX(0) rotate(360deg);
        opacity: 0.7;
    }
}

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

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
    transition: background 0.3s, color 0.3s;
    line-height: 1.6;
    backdrop-filter: blur(10px);
}

/* Ensure content stays above the background */
header, section, footer {
    position: relative;
    z-index: 2;
}

/* ===== Glass Morphism Effect ===== */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px 0 var(--glass-shadow);
    border-radius: 10px;
}

/* ===== Loader ===== */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    transition: opacity 0.5s, visibility 0.5s;
}

.loader-circle {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(67, 97, 238, 0.2);
    border-top: 5px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

/* ===== Header ===== */
header {
    background: var(--card-bg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5%;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--text-color);
    letter-spacing: -0.5px;
}

.logo img {
    height: 35px;
    transition: transform 0.3s;
}

.logo:hover img {
    transform: rotate(15deg);
}

nav ul {
    list-style: none;
    display: flex;
    gap: 25px;
}

nav a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    padding: 5px 0;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s ease;
}

nav a:hover::after {
    width: 100%;
}

nav a:hover {
    color: var(--accent);
}

.header-buttons {
    display: flex;
    gap: 12px;
    align-items: center;
}

.theme-toggle,
.resume-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    background: var(--accent);
    color: white;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(67, 97, 238, 0.3);
}

.theme-toggle {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.resume-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(67, 97, 238, 0.4);
}

.theme-toggle:hover {
    transform: rotate(30deg);
}

/* ===== Sections ===== */
section {
    padding: 80px 5%;
    max-width: 1200px;
    margin: auto;
}

h2 {
    text-align: center;
    margin-bottom: 40px;
    color: var(--accent);
    font-size: 2.2rem;
    font-weight: 700;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--gradient);
    border-radius: 3px;
}

/* ===== Modern Intro ===== */
.intro {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 50px;
    text-align: left;
    position: relative;
    padding-top: 60px;
}

.intro-content {
    flex: 1;
    max-width: 600px;
}

.intro-image {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.intro img.profile {
    width: 100%;
    max-width: 350px;
    position: relative;
    z-index: 2;
    transition: transform 0.5s;
    backdrop-filter: blur(10px);
}

.intro img.profile:hover {
    transform: scale(1.03);
}

.intro-image::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 20px;
    top: 15px;
    left: 15px;
    z-index: 1;
    opacity: 0.7;
}

.intro h2 {
    font-size: 3rem;
    margin-bottom: 15px;
    line-height: 1.2;
    text-align: left;
    left: 0;
    transform: none;
}

.intro h2 span {
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.intro p {
    font-size: 1.1rem;
    margin-bottom: 25px;
    opacity: 0.9;
}

.intro-buttons {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.btn {
    padding: 12px 28px;
    border-radius: 30px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
}

.btn-primary {
    background: var(--gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(67, 97, 238, 0.4);
    border: none;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(67, 97, 238, 0.5);
}

.btn-secondary {
    background: var(--glass-bg);
    color: var(--accent);
    border: 1px solid var(--accent);
}

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

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.social-links a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass-bg);
    color: var(--accent);
    font-size: 1.1rem;
    transition: all 0.3s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
}

.social-links a:hover {
    background: var(--accent);
    color: white;
    transform: translateY(-3px);
}

/* ===== Alternating Timeline ===== */
.timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px 0;
}

.timeline::before {
    content: '';
    position: absolute;
    width: 4px;
    background: var(--gradient);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -2px;
    border-radius: 10px;
}

.timeline-item {
    padding: 20px 40px;
    position: relative;
    width: 50%;
    box-sizing: border-box;
}

.timeline-item:nth-child(odd) {
    left: 0;
}

.timeline-item:nth-child(even) {
    left: 50%;
}

.timeline-content {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
    position: relative;
    transition: all 0.4s;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
}

.timeline-content:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.timeline-item::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    background: var(--gradient);
    border: 4px solid var(--card-bg);
    border-radius: 50%;
    top: 30px;
    z-index: 1;
}

.timeline-item:nth-child(odd)::after {
    right: -12px;
}

.timeline-item:nth-child(even)::after {
    left: -12px;
}

.timeline-date {
    display: block;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.timeline-title {
    font-size: 1.3rem;
    margin-bottom: 12px;
    color: var(--text-color);
}

.timeline-desc {
    line-height: 1.6;
    opacity: 0.9;
}

@media (max-width: 768px) {
    .timeline::before {
        left: 30px;
    }

    .timeline-item {
        width: 100%;
        padding-left: 80px;
        padding-right: 20px;
    }

    .timeline-item:nth-child(even) {
        left: 0;
    }

    .timeline-item::after {
        left: 20px;
    }

    .timeline-item:nth-child(odd)::after,
    .timeline-item:nth-child(even)::after {
        left: 20px;
    }
}

/* ===== Modern Contact Form ===== */
.contact-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    align-items: center;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--glass-bg);
    padding: 20px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
}

.contact-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

form {
    display: grid;
    gap: 15px;
    background: var(--card-bg);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

input,
textarea {
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    background: var(--glass-bg);
    color: var(--text-color);
    transition: all 0.3s;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid var(--glass-border);
}

input:focus,
textarea:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
}

button[type="submit"] {
    padding: 14px;
    background: var(--gradient);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
}

button[type="submit"]:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(67, 97, 238, 0.4);
}

/* ===== Footer ===== */
footer {
    background: var(--card-bg);
    color: var(--text-color);
    text-align: center;
    padding: 40px 20px;
    margin-top: 50px;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--glass-border);
}

.footer-content {
    max-width: 600px;
    margin: 0 auto;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
}

.social-icons a {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient);
    color: white;
    font-size: 1.2rem;
    transition: all 0.3s;
}

.social-icons a:hover {
    transform: translateY(-5px) scale(1.1);
}

.copyright {
    opacity: 0.8;
    font-size: 0.9rem;
}

/* ===== Glowing Cursor Particles ===== */
.cursor-particle {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    background: var(--cursor-color);
    box-shadow: 0 0 10px var(--cursor-color), 0 0 20px var(--cursor-color);
    opacity: 0.8;
    animation: fadeOut 0.8s linear forwards;
    z-index: 100;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0);
    }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }

    nav ul {
        gap: 15px;
    }

    .intro {
        flex-direction: column;
        text-align: center;
        padding-top: 30px;
    }

    .intro-content {
        order: 2;
    }

    .intro-image {
        order: 1;
    }

    .intro h2 {
        text-align: center;
        left: 50%;
        transform: translateX(-50%);
    }

    .intro-buttons {
        justify-content: center;
    }

    .social-links {
        justify-content: center;
    }

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

/* ===== Technologies Section ===== */
.skills-section {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 50px;
    margin: 50px auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
}

.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 25px;
    margin-top: 40px;
}

.skill-card {
    background: var(--glass-bg);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
}

.skill-card::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

.skill-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.skill-card:hover::before {
    transform: scaleX(1);
    transform-origin: left;
}

.skill-icon {
    width: 50px;
    height: 50px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--accent);
}

.skill-name {
    font-weight: 600;
    text-align: center;
    margin-bottom: 5px;
}

.skill-level {
    width: 100%;
    height: 6px;
    background: rgba(67, 97, 238, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 10px;
}

.skill-progress {
    height: 100%;
    background: var(--gradient);
    border-radius: 3px;
    transition: width 1s ease;
}

.categories {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.category-btn {
    padding: 8px 20px;
    border-radius: 30px;
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.category-btn.active,
.category-btn:hover {
    background: var(--gradient);
    color: white;
    border-color: transparent;
}

@media (max-width: 768px) {
    .skills-container {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 15px;
    }

    .skills-section {
        padding: 30px;
    }

    .skill-icon {
        width: 40px;
    }
}

/* ===== Scroll Reveal Animations ===== */
.scroll-reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.scroll-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Extra effects */
.fade-left {
    transform: translateX(-40px);
}
.fade-right {
    transform: translateX(40px);
}
.fade-up {
    transform: translateY(40px);
}
.fade-down {
    transform: translateY(-40px);
}
