:root {
    --bg-color: #222831;
    --secondary-bg-color: #393E46;
    --accent-color: #00ADB5;
    --text-color: #EEEEEE;
    --font-family: 'Poppins', sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Navbar */
.navbar {
    background: rgba(34, 40, 49, 0.8);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: transform 0.3s ease-out, background 0.3s ease;
}

.navbar.navbar-hidden {
    transform: translateY(-100%);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent-color);
    text-decoration: none;
}

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

.nav-links li {
    margin-left: 2rem;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 600;
    position: relative;
    padding-bottom: 5px;
    transition: color 0.3s ease;
}

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

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--accent-color);
}

/* Hamburger Menu */
.hamburger {
    display: none;
    cursor: pointer;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    -webkit-transition: all 0.3s ease-in-out;
    transition: all 0.3s ease-in-out;
    background-color: var(--text-color);
    border-radius: 2px;
}


/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(rgba(34, 40, 49, 0.9), rgba(34, 40, 49, 0.9)), url('https://www.transparenttextures.com/patterns/cubes.png');
}

.hero-content {
    flex: 1;
    text-align: left;
}

.hero-title {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-color);
}

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

.hero-subtitle .cursor {
    display: inline-block;
    background-color: var(--accent-color);
    margin-left: 0.1rem;
    width: 3px;
    animation: blink 1s infinite;
    vertical-align: middle;
}

@keyframes blink {
    0% { background-color: var(--accent-color); }
    49% { background-color: var(--accent-color); }
    50% { background-color: transparent; }
    99% { background-color: transparent; }
    100% { background-color: var(--accent-color); }
}

.hero-description {
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.cta-button {
    display: inline-block;
    background: var(--accent-color);
    color: var(--bg-color);
    padding: 12px 30px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 173, 181, 0.4);
}

/* Hero Flex Layout for Photo + Content */
.hero-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4rem;
}

.hero-photo-section {
    flex: 0 0 320px; /* Fixed width for the photo container */
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-photo {
    width: 320px;
    height: 320px;
    object-fit: cover;
    border-radius: 50%;
    border: 6px solid var(--accent-color);
    box-shadow: 0 10px 40px rgba(0, 173, 181, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hero-photo:hover {
    transform: scale(1.03);
    box-shadow: 0 15px 50px rgba(0, 173, 181, 0.3);
}

@media (max-width: 992px) {
    .hero-photo-section {
        flex: 0 0 250px;
    }
    .hero-photo {
        width: 250px;
        height: 250px;
    }
}

@media (max-width: 768px) {
    .hero-flex {
        flex-direction: column-reverse; /* Stack photo on top of text */
        gap: 2rem;
    }
    .hero-content { text-align: center; }
}

/* Academics Section */
.academics-section {
    padding: 6rem 0;
    /* background-color: var(--secondary-bg-color); */ /* Swapped with education section */
}

/* Education Section */
.education-section {
    padding: 6rem 0;
    background-color: var(--secondary-bg-color);
}

.education-card {
    max-width: 800px;
    margin: 0 auto;
    background: var(--bg-color);
    padding: 2.5rem;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    border-left: 5px solid var(--accent-color);
}

.skills-section {
    padding: 6rem 0;
    /* Uses the default --bg-color for alternating section effect */
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--accent-color);
}

.education-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.education-header h3 {
    font-size: 1.5rem;
    color: var(--text-color);
    margin: 0;
}

.education-duration {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-color);
}

.college-name {
    font-size: 1.1rem;
    color: #ccc;
}

.chart-container {
    max-width: 800px;
    margin: 0 auto;
    background: var(--bg-color);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    height: 450px;
    position: relative;
}

.cgpa-summary {
    text-align: center;
    margin-top: 2rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.cgpa-summary span {
    color: var(--accent-color);
    font-size: 1.4rem;
}

/* Placeholder Pages */
.placeholder-page {
    padding-top: 120px;
    min-height: calc(100vh - 80px); /* Full height minus footer */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.placeholder-text {
    font-size: 1.2rem;
    color: #aaa;
}

/* Content Pages (About, Contact) */
.content-page {
    padding: 120px 0 60px 0;
    min-height: calc(100vh - 80px);
}

.subsection-title {
    text-align: center;
    font-size: 2rem;
    margin-top: 4rem;
    margin-bottom: 2rem;
    color: var(--text-color);
}

.about-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    max-width: 950px;
    margin: 0 auto 3rem auto;
}

.about-text {
    flex: 2;
    font-size: 1.1rem;
}

.about-text p {
    margin-bottom: 1rem;
}

.about-photo {
    flex: 0 0 280px; /* Don't grow or shrink, fixed size */
    width: 280px;
    height: 280px;
    border-radius: 50%;
    padding: 4px; /* Creates the border thickness */
    background: linear-gradient(45deg, var(--accent-color), #00c6d1); /* Gradient border */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.about-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensures the image covers the circle without stretching */
    border-radius: 50%; /* Makes the image itself circular inside the frame */
}

.about-photo:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(0, 173, 181, 0.3);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.skill-card {
    background: var(--secondary-bg-color);
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid var(--accent-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.skill-card i {
    font-size: 3rem;
    color: var(--accent-color);
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

.skill-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.skill-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}
.skill-card:hover i {
    transform: scale(1.1);
}

/* Detailed Skill Cards on About Page */
.skill-category-card {
    background: var(--secondary-bg-color);
    padding: 2rem;
    border-radius: 10px;
    border-left: 4px solid var(--accent-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    text-align: left;
}

.skill-category-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.3);
}

.skill-category-card .skill-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.skill-category-card .skill-header i {
    font-size: 2rem;
    color: var(--accent-color);
}

.skill-category-card .skill-header h4 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-color);
}

.skill-category-card p {
    font-size: 0.95rem;
    color: #ccc;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.sub-skills-list {
    list-style: none;
}

.sub-skills-list li {
    margin-bottom: 0.6rem;
    color: #bbb;
}

/* Contact Form */
.contact-intro {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 3rem auto;
    font-size: 1.1rem;
}

.contact-form {
    max-width: 700px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 1rem;
    background: var(--secondary-bg-color);
    border: 1px solid #555;
    border-radius: 5px;
    color: var(--text-color);
    font-family: var(--font-family);
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

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

/* Footer */
.footer {
    background-color: var(--secondary-bg-color);
    text-align: center;
    padding: 2rem 0;
    border-top: 1px solid #444;
}

.social-links {
    margin-bottom: 1rem;
}

.social-links a {
    color: var(--text-color);
    font-size: 1.5rem;
    margin: 0 0.75rem;
    transition: color 0.3s ease, transform 0.3s ease;
    display: inline-block;
}

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

/* Animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Back to Top Button */
.back-to-top-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: var(--accent-color);
    color: var(--bg-color);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    text-decoration: none;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(100px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.back-to-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

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

.project-card {
    background-color: var(--secondary-bg-color);
    border-radius: 10px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.3);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.project-icon {
    font-size: 2.5rem;
    color: var(--accent-color);
}

.project-links a {
    color: var(--text-color);
    font-size: 1.5rem;
    margin-left: 1rem;
    transition: color 0.3s ease;
}

.project-links a:hover {
    color: var(--accent-color);
}

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

.project-description {
    font-size: 1rem;
    color: #ccc;
    flex-grow: 1;
    margin-bottom: 1.5rem;
}

.project-tech-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: #aaa;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 3rem;
    }

    .hero-photo {
        width: 200px;
        height: 200px;
    }
    .hero-photo-section {
        flex-basis: auto;
    }

    .hamburger {
        display: block;
    }

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

    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .nav-links {
        position: fixed;
        left: -100%;
        top: 70px; /* Adjust based on navbar height */
        flex-direction: column;
        background-color: var(--secondary-bg-color);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    }

    .nav-links li {
        margin: 1.5rem 0;
    }

    .nav-links.active {
        left: 0;
    }

    .education-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .education-card {
        padding: 2rem;
    }
    .education-header h3 {
        font-size: 1.3rem;
    }

    .about-container {
        flex-direction: column;
        text-align: center;
    }
    .about-photo {
        margin-bottom: 2rem;
        order: -1; /* Move photo above text on mobile */
        width: 220px; /* Smaller circle for mobile */
        height: 220px;
    }

    .chart-container {
        height: 350px;
    }
}