* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

:root {
    --primary-bg: #000000;
    --secondary-bg: #1a1a1a;
    --text-color: #ffffff;
    --accent1: #00c4b4;
    --accent2: #7b2cbf;
    --accent3: #ff6f61;
}

[data-theme="night"] {
    --primary-bg: #1e2a44;
    --secondary-bg: #2a2a2a;
    --text-color: #e0e0e0;
    --accent1: #4dd0e1;
    --accent2: #9575cd;
    --accent3: #ff8a80;
}

body {
    background: var(--primary-bg);
    color: var(--text-color);
    scroll-behavior: smooth;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(26, 26, 26, 0.7);
    backdrop-filter: blur(10px);
    padding: 15px 50px;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0, 196, 180, 0.3);
    transition: padding 0.3s ease;
}

.navbar.scrolled {
    padding: 10px 50px;
}

.logo {
    color: var(--accent1);
    font-size: 26px;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    text-shadow: 0 2px 4px rgba(0, 196, 180, 0.3);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 30px;
}

.nav-link {
    color: var(--text-color);
    text-decoration: none;
    font-size: 16px;
    position: relative;
    transition: color 0.3s ease;
}

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

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

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

.theme-toggle {
    cursor: pointer;
    font-size: 20px;
    color: var(--accent1);
    transition: transform 0.3s ease;
}

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

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--text-color);
    transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.scroll-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(to right, var(--accent1), var(--accent2));
    width: 0;
    transition: width 0.3s ease;
}

/* Hero Section */
.hero {
    height: 100vh;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--text-color);
    overflow: hidden;
}

#particles-js {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.hero-content {
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-img {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    border: 3px solid var(--accent1);
    margin-bottom: 20px;
    object-fit: cover;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.hero-img:hover {
    box-shadow: 0 0 20px rgba(0, 196, 180, 0.5);
    transform: scale(1.1);
}

.hero-content h1 {
    font-size: 25px;
    margin-bottom: 10px;
    font-family: 'Montserrat', sans-serif;
    text-shadow: 0 2px 4px rgba(0, 196, 180, 0.3);
}

.hero-content h3 {
    font-size: 20px;
    color: var(--accent1);
    margin-bottom: 15px;
}

.hero-content p {
    font-size: 18px;
    margin-bottom: 20px;
    max-width: 600px;
}

.typewriter::after {
    content: '|';
    animation: blink 0.7s infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    background: linear-gradient(to right, var(--accent1), var(--accent3));
    color: var(--text-color);
    text-decoration: none;
    border-radius: 5px;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(200px, 200px);
    transition: width 0.4s ease, height 0.4s ease;
}

.btn:hover::after {
    width: 200px;
    height: 200px;
}

.btn:hover {
    transform: scale(1.1);
}

/* Section */
.section {
    padding: 80px 50px;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    position: relative;
}

.section.visible {
    opacity: 1;
    transform: translateY(0);
}

.section h2 {
    font-size: 42px;
    margin-bottom: 40px;
    color: var(--accent1);
    font-family: 'Montserrat', sans-serif;
    position: relative;
}

.section h2::after {
    content: '';
    position: absolute;
    width: 50px;
    height: 3px;
    background: linear-gradient(to right, var(--accent1), var(--accent2));
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
}

/* About Section */
.about-content {
    display: flex;
    align-items: center;
    max-width: 1000px;
    margin: 0 auto;
    gap: 40px;
}

.about-img {
    width: 300px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease;
}

.about-img:hover {
    transform: scale(1.05);
}

.about-text p {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 20px;
}

/* Personal Info Section */
.personal-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    max-width: 1000px;
    margin: 0 auto;
}

.personal-card {
    background: var(--secondary-bg);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 10px rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease;
}

.personal-card:hover {
    transform: scale(1.05);
}

.personal-card h3 {
    font-size: 20px;
    color: var(--accent2);
    margin-bottom: 10px;
}

.personal-card p {
    font-size: 16px;
}

/* Projects Section */
.project-filter {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
}

.filter-btn {
    padding: 10px 20px;
    background: var(--secondary-bg);
    color: var(--text-color);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
}

.filter-btn.active,
.filter-btn:hover {
    background: linear-gradient(to right, var(--accent1), var(--accent3));
    transform: scale(1.05);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.project-card {
    background: var(--secondary-bg);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 20px rgba(255, 255, 255, 0.2);
}

.project-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.project-card:hover img {
    transform: scale(1.1);
}

.project-card h3 {
    font-size: 22px;
    margin: 20px;
    color: var(--text-color);
}

.project-card p {
    font-size: 16px;
    margin: 0 20px 20px;
}

/* Skills Section */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    max-width: 1000px;
    margin: 0 auto;
}

.skill-item {
    text-align: center;
    position: relative;
}

.skill-item i {
    font-size: 48px;
    color: var(--accent2);
    margin-bottom: 10px;
    transition: transform 0.3s ease;
}

.skill-item:hover i {
    transform: scale(1.2);
}

.skill-item h4 {
    font-size: 18px;
    margin-bottom: 10px;
    color: var(--text-color);
}

.progress-bar {
    background: #333333;
    border-radius: 5px;
    height: 10px;
    overflow: hidden;
}

.progress {
    background: linear-gradient(to right, var(--accent1), var(--accent3));
    height: 100%;
    transition: width 1s ease-in-out;
}

.skill-item:hover .tooltip {
    opacity: 1;
    visibility: visible;
}

.tooltip {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent2);
    color: var(--text-color);
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 14px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

/* Resume Section */
.resume-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: left;
}

.resume-content p {
    font-size: 16px;
    margin-bottom: 20px;
}

.resume-overview {
    margin-top: 30px;
}

.resume-overview h3 {
    font-size: 24px;
    color: var(--accent2);
    margin-bottom: 15px;
}

.resume-overview ul {
    list-style: none;
}

.resume-overview li {
    font-size: 16px;
    margin-bottom: 10px;
}

.resume-overview li strong {
    color: var(--accent1);
}

/* Contact Section */
.contact-form {
    max-width: 600px;
    margin: 0 auto 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.contact-form input,
.contact-form textarea {
    padding: 15px;
    border: 1px solid #333333;
    border-radius: 5px;
    font-size: 16px;
    background: var(--secondary-bg);
    color: var(--text-color);
    transition: border-color 0.3s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
    border-color: var(--accent1);
    outline: none;
}

.contact-form input:valid,
.contact-form textarea:valid {
    border-color: var(--accent1);
}

.contact-form input:invalid:not(:placeholder-shown),
.contact-form textarea:invalid:not(:placeholder-shown) {
    border-color: var(--accent3);
}

.contact-form textarea {
    resize: vertical;
    min-height: 150px;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.social-links a {
    font-size: 28px;
    color: var(--text-color);
    transition: color 0.3s ease, transform 0.3s ease;
}

.social-links a:hover {
    color: var(--accent1);
    transform: scale(1.2) rotate(10deg);
}

/* Footer */
footer {
    background: var(--secondary-bg);
    color: var(--text-color);
    text-align: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.footer-social {
    margin-top: 10px;
    display: flex;
    justify-content: center;
    gap: 15px;
}

.footer-social a {
    color: var(--text-color);
    font-size: 24px;
    transition: color 0.3s ease, transform 0.3s ease;
}

.footer-social a:hover {
    color: var(--accent2);
    transform: scale(1.2) rotate(10deg);
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(to right, var(--accent1), var(--accent3));
    color: var(--text-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.back-to-top.visible {
    opacity: 1;
}

.back-to-top:hover {
    transform: scale(1.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .navbar {
        padding: 15px 20px;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        background: var(--secondary-bg);
        padding: 20px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .nav-links.active {
        display: flex;
        transform: translateX(0);
    }

    .hamburger {
        display: flex;
    }

    .about-content {
        flex-direction: column;
        text-align: center;
    }

    .about-img {
        width: 200px;
    }

    .hero-img {
        width: 120px;
        height: 120px;
    }

    .section {
        padding: 50px 20px;
    }

    .hero-content h1 {
        font-size: 36px;
    }

    .hero-content h3 {
        font-size: 20px;
    }

    .project-filter {
        flex-wrap: wrap;
    }
    /* Responsive Blog */
    .blog-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
}

/* Timeline Section */
.timeline-content {
    max-width: 1100px;
    margin: 0 auto;
    position: relative;
    padding: 40px 0;
    perspective: 1000px;
}

.timeline-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 6px;
    height: 100%;
    background: linear-gradient(180deg, var(--accent1) 0%, var(--accent2) 50%, var(--accent3) 100%);
    border-radius: 3px;
    transform: translateX(-50%);
    box-shadow: 0 0 15px rgba(0, 196, 180, 0.3);
    animation: glowPulse 3s infinite ease-in-out;
}

@keyframes glowPulse {
    0%, 100% { box-shadow: 0 0 15px rgba(0, 196, 180, 0.3); }
    50% { box-shadow: 0 0 25px rgba(0, 196, 180, 0.6); }
}

.timeline-item {
    position: relative;
    width: 48%;
    margin-bottom: 40px;
    transition: all 0.5s ease;
}

.timeline-item.left {
    left: 0;
    text-align: right;
    padding-right: 60px;
}

.timeline-item.right {
    left: 52%;
    text-align: left;
    padding-left: 60px;
}

/* Timeline Card */
.timeline-card {
    background: var(--secondary-bg);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Corrected Hover Selector */
.timeline-card:hover {
    transform: translateZ(20px);
    box-shadow: 0 12px 30px rgba(0, 196, 180, 0.4);
    background: linear-gradient(145deg, var(--secondary-bg), rgba(0, 196, 180, 0.1));
}

/* Institution Image */
.timeline-card .timeline-card-image {
    width: 100%;
    height: 200px;
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    position: relative;
    margin-bottom: 15px;
    transition: transform 0.5s ease, filter 0.3s ease;
    z-index: 1;
}

.timeline-item:nth-child(1) .timeline-card-image {
    background-image: url('/assets/images/primary-school.jpg');
}

.timeline-item:nth-child(2) .timeline-card-image {
    background-image: url('/assets/images/high-school.jpg');
}

.timeline-item:nth-child(3) .timeline-card-image {
    background-image: url('public/JAGADEESH.png');
}

/* Advanced Effects on Image Hover */
.timeline-card:hover .timeline-card-image {
    transform: scale(1.05) translateZ(10px);
    filter: brightness(1.1) saturate(1.2);
}

/* Glowing Gradient Border */
.timeline-card-image::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--accent1), var(--accent2), var(--accent3));
    border-radius: 10px;
    z-index: -1;
    opacity: 0.5;
    transition: opacity 0.3s ease;
    animation: rotateGradient 6s linear infinite;
}

.timeline-card:hover .timeline-card-image::before {
    opacity: 1;
}

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

/* Animated Scanline Effect */
.timeline-card-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: scanline 4s linear infinite;
    pointer-events: none;
}

@keyframes scanline {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100%); }
}

/* Year, Title, and Description */
.timeline-year {
    font-size: 18px;
    font-weight: 600;
    color: var(--accent1);
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.5);
    padding: 5px 10px;
    border-radius: 5px;
    z-index: 2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: background 0.3s ease;
}

.timeline-card:hover .timeline-year {
    background: rgba(0, 196, 180, 0.5);
}

.timeline-card h3 {
    font-size: 24px;
    color: var(--accent2);
    margin-bottom: 10px;
    font-family: 'Montserrat', sans-serif;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

/* CSS Graduation Cap Icon with Hover Animation */
.timeline-card h3::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%237b2cbf"><path d="M2 9.5L12 4l10 5.5v6.5c0 2.76-2.24 5-5 5h-1v-2h1c1.66 0 3-1.34 3-3v-5.5l-8-4.4-8 4.4v5.5c0 1.66 1.34 3 3 3h1v2h-1c-2.76 0-5-2.24-5-5V9.5z"/><path d="M12 7l-8 4.4v2.6l8-4.4 8 4.4v-2.6L12 7z"/></svg>') no-repeat center;
    background-size: contain;
    transition: transform 0.3s ease;
}

.timeline-card:hover h3::after {
    transform: rotate(15deg) scale(1.2);
}

.timeline-card p {
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-color);
    position: relative;
    z-index: 1;
}

/* Highlighted Text with Gradient */
.timeline-card p span {
    background: linear-gradient(90deg, var(--accent1), var(--accent2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 600;
    position: relative;
    display: inline-block;
}

.timeline-card p span::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--accent1), var(--accent2));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.timeline-card:hover p span::after {
    transform: scaleX(1);
}

/* Timeline Connectors */
.timeline-item.left .timeline-year::after,
.timeline-item.right .timeline-year::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background: var(--accent2);
    border: 3px solid var(--primary-bg);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    box-shadow: 0 0 10px rgba(123, 44, 191, 0.5);
    transition: background 0.3s ease;
}

.timeline-item.left .timeline-year::after {
    right: -71px;
}

.timeline-item.right .timeline-year::after {
    left: -71px;
}

.timeline-item:hover .timeline-year::after {
    background: var(--accent3);
}

.timeline-item.left::after,
.timeline-item.right::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40px;
    height: 2px;
    background: var(--accent1);
    z-index: 0;
    transition: background 0.3s ease;
}

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

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

.timeline-item:hover::after {
    background: var(--accent2);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .timeline-content::before {
        left: 30px;
    }

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

    .timeline-item.left,
    .timeline-item.right {
        left: 0;
    }

    .timeline-item.left .timeline-year::after,
    .timeline-item.right .timeline-year::after {
        left: -36px;
    }

    .timeline-item.left::after,
    .timeline-item.right::after {
        left: 20px;
        width: 30px;
    }

    .timeline-card-image {
        height: 150px;
    }

    .timeline-card {
        padding: 15px;
    }

    .timeline-card h3 {
        font-size: 20px;
    }

    .timeline-card p {
        font-size: 14px;
    }

    .timeline-year {
        font-size: 16px;
        padding: 4px 8px;
    }
}

/* Blog Section */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.blog-card {
    background: #1a1a1a;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(255, 255, 255, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.blog-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 20px rgba(255, 255, 255, 0.2);
}

.blog-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.blog-card h3 {
    font-size: 22px;
    margin: 20px;
    color: #ffffff;
}

.blog-card p {
    font-size: 16px;
    margin: 0 20px 20px;
}

.blog-buttons {
    display: flex;
    justify-content: space-between;
    margin: 0 20px 20px;
}
