:root {
    --primary-color: #64ffda;
    --bg-color: #0a192f;
    --text-color: #8892b0;
    --heading-color: #ccd6f6;
    --nav-bg: rgba(10, 25, 47, 0.85);
    --card-bg: #112240;

    --font-main: 'Inter', sans-serif;

    --transition: all 0.25s cubic-bezier(0.645, 0.045, 0.355, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    background-image: radial-gradient(circle at 50% 50%, #112240 0%, #0a192f 100%);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.about-content,
.section-title,
.experience-item,
.project-card,
.problem-item,
.course-card {
    animation: fadeIn 0.8s ease-out forwards;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

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

/* Header & Nav */
header {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: var(--nav-bg);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 1rem 0;
    box-shadow: 0 10px 30px -10px rgba(2, 12, 27, 0.7);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--heading-color);
    font-size: 0.9rem;
    font-weight: 500;
}

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

.hamburger {
    display: none;
    cursor: pointer;
    z-index: 1001;
}

.hamburger div {
    width: 25px;
    height: 3px;
    background-color: var(--primary-color);
    margin: 5px;
    transition: all 0.3s ease;
}

/* Sections */
section {
    padding: 100px 0;
}

.section-title {
    font-size: 2rem;
    color: var(--heading-color);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
}

.section-title::after {
    content: "";
    display: block;
    width: 300px;
    height: 1px;
    background-color: #233554;
    margin-left: 20px;
}

.section-desc {
    margin-bottom: 2rem;
    max-width: 600px;
}

/* Hero Section */
#about {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 0;
}

.about-content h1 {
    font-size: 4rem;
    color: var(--heading-color);
    line-height: 1.1;
    margin-bottom: 1rem;
}

.about-content .highlight {
    color: var(--primary-color);
}

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

.bio {
    max-width: 500px;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.social-links {
    display: flex;
    gap: 1.5rem;
}

.social-links a {
    font-size: 1.5rem;
    color: var(--heading-color);
}

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

/* Experience Section */
.experience-item {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.experience-item:hover {
    transform: translateY(-5px);
}

.experience-item h3 {
    color: var(--heading-color);
    margin-bottom: 0.5rem;
}

.experience-item .company {
    color: var(--primary-color);
    font-family: monospace;
    margin-right: 1rem;
}

.experience-item .date {
    font-family: monospace;
    font-size: 0.9rem;
}

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

.project-card {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 4px;
    transition: var(--transition);
}

.project-card:hover {
    transform: translateY(-7px);
}

.project-card h3 {
    color: var(--heading-color);
    margin-bottom: 1rem;
}

.project-card p {
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-family: monospace;
    font-size: 0.8rem;
    margin-bottom: 1.5rem;
}

.project-links a {
    margin-right: 1rem;
    font-size: 1.2rem;
}

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

/* Problems Section */
.problems-list {
    background-color: var(--card-bg);
    border-radius: 4px;
    padding: 1rem;
}

.problem-item {
    display: flex;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid #233554;
    transition: var(--transition);
}

.problem-item:last-child {
    border-bottom: none;
}

.problem-item:hover {
    background-color: rgba(100, 255, 218, 0.05);
}

.problem-title {
    color: var(--heading-color);
    font-weight: 500;
}

.problem-difficulty {
    font-family: monospace;
    font-size: 0.85rem;
}

/* Codeforces Rating Colors */
.rating-gray {
    color: #808080 !important;
    font-weight: bold;
}

.rating-green {
    color: #008000 !important;
    font-weight: bold;
}

.rating-cyan {
    color: #03a89e !important;
    font-weight: bold;
}

.rating-blue {
    color: #0000ff !important;
    font-weight: bold;
}

.rating-violet {
    color: #aa00aa !important;
    font-weight: bold;
}

.rating-orange {
    color: #ff8c00 !important;
    font-weight: bold;
}

.rating-red {
    color: #ff0000 !important;
    font-weight: bold;
}

.rating-black {
    color: #ff0000 !important;
    font-weight: bold;
}

.problem-source {
    font-size: 0.8rem;
    color: var(--text-color);
    margin-left: 0.5rem;
    font-style: italic;
}

.detail-source {
    color: var(--text-color);
    border-left: 1px solid var(--text-color);
    padding-left: 1rem;
}

/* Courses Grid */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 1.5rem;
    /* Add padding here instead of JS */
    width: 100%;
}

.course-card {
    background-color: var(--card-bg);
    padding: 1.5rem;
    border-radius: 4px;
    border: 1px solid #233554;
    transition: var(--transition);
}

.course-card:hover {
    border-color: var(--primary-color);
}

.course-card h3 {
    color: var(--heading-color);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.course-provider {
    color: var(--primary-color);
    font-family: monospace;
    font-size: 0.85rem;
    display: block;
    margin-bottom: 1rem;
}

.course-link {
    font-size: 0.9rem;
    text-decoration: underline;
}

/* Footer */
footer {
    padding: 2rem 0;
    text-align: center;
    font-family: monospace;
    font-size: 0.8rem;
}

/* Mobile Menu & Responsive */
@media (max-width: 768px) {
    .nav-links {
        position: absolute;
        right: 0px;
        height: 92vh;
        top: 8vh;
        background-color: var(--nav-bg);
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 50%;
        transform: translateX(100%);
        transition: transform 0.5s ease-in;
        padding-top: 2rem;
        backdrop-filter: blur(10px);
    }

    .nav-links li {
        opacity: 0;
    }

    .hamburger {
        display: block;
    }

    .about-content h1 {
        font-size: 3rem;
    }

    .section-title::after {
        width: 100px;
    }
}

.nav-active {
    transform: translateX(0%) !important;
}

@keyframes navLinkFade {
    from {
        opacity: 0;
        transform: translateX(50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Hamburger Animation */
.toggle .line1 {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.toggle .line2 {
    opacity: 0;
}

.toggle .line3 {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* Detail Page Styles */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    color: var(--primary-color);
    font-size: 0.9rem;
}

.back-link:hover {
    text-decoration: underline;
}

.detail-title {
    font-size: 2.5rem;
    color: var(--heading-color);
    margin-bottom: 1rem;
}

.detail-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    font-family: monospace;
    font-size: 0.9rem;
}

.detail-link {
    color: var(--text-color);
    transition: var(--transition);
}

.detail-link:hover {
    color: var(--primary-color);
}

.detail-description {
    font-size: 1.1rem;
    max-width: 800px;
    color: var(--heading-color);
}

.detail-description p,
.detail-description li,
.detail-description span {
    color: var(--heading-color);
    margin-bottom: 1.5rem;
}

.detail-description code {
    background-color: #112240;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: monospace;
    color: var(--primary-color);
}

.page-section {
    min-height: 80vh;
}

/* Image Support */
.detail-description img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 1rem 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.problem-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.gallery-item {
    cursor: pointer;
    overflow: hidden;
    border-radius: 4px;
    border: 1px solid #233554;
    transition: var(--transition);
}

.gallery-item:hover {
    transform: scale(1.02);
    border-color: var(--primary-color);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Category Accordion */
.category-section {
    margin-bottom: 2rem;
    border-radius: 4px;
    background-color: var(--card-bg);
    border: 1px solid #233554;
}

.category-header {
    padding: 1.5rem;
    background-color: var(--card-bg);
    /* Match card bg as requested */
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
    border-bottom: 1px solid #233554;
}

.category-header:hover {
    background-color: rgba(17, 34, 64, 0.8);
}

.category-header h2 {
    font-size: 1.5rem;
    color: var(--heading-color);
    margin: 0;
}

.category-header i {
    color: var(--primary-color);
    transition: transform 0.3s ease;
}

.category-header.active i {
    transform: rotate(180deg);
}

.category-content {
    display: none;
    /* Reliable hiding */
    padding: 0;
}

.category-content.active {
    display: block;
    /* Reliable showing */
    animation: fadeIn 0.5s ease;
}

/* Override existing problems-list since it's now inside accordion */
.problems-list {
    background-color: transparent;
    padding: 0;
    border-radius: 0;
}