@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* MonoCV Theme Variables */
    --bg-body: #F5F5F7;
    /* Light Paper Grey */
    --bg-card: #FFFFFF;

    --text-primary: #000000;
    /* Deep Black */
    --text-secondary: #666666;
    /* Medium Grey */
    --text-tertiary: #999999;
    /* Light Grey */

    --accent-status: #22C55E;
    /* Green Dot */

    --border-light: #EBEBEB;

    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 40px;

    --sidebar-width: 280px;
    --container-max-width: 1100px;

    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;

    /* Transition for smooth theme switching */
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Dark Mode Variables */
body.dark-mode {
    --bg-body: #000000;
    --bg-card: #1A1A1A;
    --text-primary: #FFFFFF;
    --text-secondary: #D1D5DB;
    --text-tertiary: #9CA3AF;
    --border-light: #333333;
}

body.dark-mode .card-block,
body.dark-mode .profile-card,
body.dark-mode .lc-card {
    background: var(--bg-card);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.7);
}

body.dark-mode .project-card,
body.dark-mode .skill-tag {
    background: #1A1A1A;
    border-color: #333333;
}

body.dark-mode .status-badge {
    background: rgba(34, 197, 94, 0.15);
}

body.dark-mode .exp-logo,
body.dark-mode .project-icon,
body.dark-mode .opensource-icon {
    background-color: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
}

body.dark-mode .lc-pie-container {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

/* Dark mode button fixes */
body.dark-mode .btn-primary {
    background-color: #FFFFFF;
    color: #000000;
}

body.dark-mode .btn-primary:hover {
    background-color: #E5E5E5;
}

body.dark-mode .btn-secondary {
    background-color: #2A2A2A;
    color: #FFFFFF;
    border-color: #444444;
}

body.dark-mode .btn-secondary:hover {
    background-color: #333333;
}

body.dark-mode .social-link {
    background-color: #2A2A2A;
    color: #FFFFFF;
    border-color: #444444;
}

body.dark-mode .social-link:hover {
    background-color: #6366F1;
    color: #FFFFFF;
}

body.dark-mode .exp-date {
    background: #2A2A2A;
    color: var(--text-tertiary);
    border: 1px solid #444444;
}

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

html {
    scroll-behavior: smooth;
    font-size: 15px;
    overflow-x: hidden;
    /* Prevent horizontal scroll */
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    padding: 40px 20px;
    position: relative;
}

/* Particle Canvas Background */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.main-wrapper {
    position: relative;
    z-index: 1;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 0px;
    /* Hide scrollbar for cleaner look */
    background: transparent;
}

/* Main Layout: Split Screen */
.main-wrapper {
    width: 95%;
    max-width: var(--container-max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    gap: 40px;
    align-items: start;
}

/* Sidebar (Sticky) */
.sidebar {
    position: sticky;
    top: 40px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.profile-card {
    background: var(--bg-card);
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    /* Circle */
    object-fit: cover;
    margin-bottom: 16px;
    background-color: #eee;
}

.profile-name {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}

.profile-role {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: #F0FDF4;
    /* Very light green bg */
    padding: 6px 12px;
    border-radius: 100px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
    border: 1px solid #DCFCE7;
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent-status);
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

.sidebar-contact {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    margin-top: 10px;
}

.btn-contact {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background-color: var(--text-primary);
    color: white;
}

.btn-primary:hover {
    background-color: #333;
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: #F8F8F8;
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

.btn-secondary:hover {
    background-color: #F0F0F0;
}

.sidebar-socials {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 4px;
}

.social-link {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: #F8F8F8;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s;
}

.social-link:hover {
    background-color: #E8E8E8;
    color: var(--text-primary);
}

/* Main Content Area */
.content-area {
    display: flex;
    flex-direction: column;
    gap: 40px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    min-width: 0;
}

.section-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 16px;
    display: inline-block;
}

.card-block {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 32px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Hero Text in Main */
.hero-text {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.03em;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.hero-bio {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 600px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Experience Accordion */
.exp-item {
    border-bottom: 1px solid var(--border-light);
    padding: 24px 0;
}

.exp-item:first-child {
    padding-top: 0;
}

.exp-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.exp-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    list-style: none;
    /* Hide default triangle */
}

.exp-summary::-webkit-details-marker {
    display: none;
}

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

.exp-logo {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    /* Slightly rounded squares */
    object-fit: contain;
    background-color: white;
    border: 1px solid var(--border-light);
    padding: 2px;
}

.exp-title-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.exp-role {
    font-size: 1.05rem;
    font-weight: 700;
}

.exp-company {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.exp-date {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    font-weight: 500;
    background: #F8F8F8;
    padding: 4px 10px;
    border-radius: 100px;
}

.exp-details {
    margin-top: 16px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    padding-left: 10px;
    border-left: 2px solid #F0F0F0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.exp-details ul {
    padding-left: 20px;
}

.exp-details li {
    margin-bottom: 8px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Indigo Theme */
.indigo-name {
    color: #6366F1 !important;
}

/* Theme Toggle Button */
.theme-toggle {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--border-light);
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    z-index: 10;
}

.theme-toggle:hover {
    background: #6366F1;
    color: white;
    border-color: #6366F1;
    transform: rotate(20deg);
}

.theme-toggle:active {
    transform: scale(0.95);
}

/* Experience Hover Effect */
.exp-item {
    transition: background-color 0.3s ease;
}

.exp-item:hover {
    background-color: rgba(99, 102, 241, 0.05);
}

/* Projects Accordion */
.projects-accordion {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.project-item {
    border-bottom: 1px solid var(--border-light);
    padding: 20px 0;
    transition: background-color 0.3s ease;
}

.project-item:hover {
    background-color: rgba(99, 102, 241, 0.05);
}

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

.project-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    list-style: none;
}

.project-summary::-webkit-details-marker {
    display: none;
}

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

.project-icon {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    background-color: #F5F5FF;
    border: 1px solid #E0E0FF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #6366F1;
}

.project-title-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.project-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

.project-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.project-chevron {
    font-size: 0.9rem;
    color: var(--text-tertiary);
    transition: transform 0.3s ease;
}

.project-item[open] .project-chevron {
    transform: rotate(180deg);
}

.project-details {
    margin-top: 16px;
    padding-left: 52px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

.project-desc {
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #6366F1;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.project-link:hover {
    color: #4F46E5;
    gap: 8px;
}

/* Open Source Contributions Accordion */
.opensource-accordion {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.opensource-item {
    border-bottom: 1px solid var(--border-light);
    padding: 20px 0;
    transition: background-color 0.3s ease;
}

.opensource-item:hover {
    background-color: rgba(99, 102, 241, 0.05);
}

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

.opensource-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    list-style: none;
}

.opensource-summary::-webkit-details-marker {
    display: none;
}

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

.opensource-icon {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    background-color: #F5F5FF;
    border: 1px solid #E0E0FF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #6366F1;
}

.opensource-title-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.opensource-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

.opensource-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.opensource-chevron {
    font-size: 0.9rem;
    color: var(--text-tertiary);
    transition: transform 0.3s ease;
}

.opensource-item[open] .opensource-chevron {
    transform: rotate(180deg);
}

.opensource-details {
    margin-top: 16px;
    padding-left: 52px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

.opensource-desc {
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.package-list {
    list-style: none;
    padding-left: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.package-list li {
    padding: 8px 0;
}

.package-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6366F1;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.package-link:hover {
    color: #4F46E5;
    gap: 10px;
}

.package-link strong {
    color: var(--text-primary);
}

.package-link i {
    font-size: 0.75rem;
    margin-left: auto;
}

/* Old Project Carousel Styles (keeping for backwards compatibility) */
.projects-scroller {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 16px;
    scroll-snap-type: x mandatory;
    margin: 0 -32px;
    padding: 0 32px 16px 32px;
}

.project-card {
    min-width: 280px;
    width: 280px;
    background: #FAFAFA;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 20px;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 200px;
    transition: transform 0.2s, border-color 0.2s;
    text-decoration: none;
    color: inherit;
}

.project-card:hover {
    transform: translateY(-4px);
    border-color: #6366F1;
}

/* Skills */
.skills-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.skill-tag {
    background: #F8F8F8;
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.skill-tag:hover {
    background: white;
    border-color: #ddd;
    color: var(--text-primary);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

/* Responsive */
.main-wrapper {
    margin: 0 auto;
    /* Centering the main wrapper */
}

@media (max-width: 900px) {
    .main-wrapper {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .sidebar {
        position: relative;
        top: 0;
        margin-bottom: 40px;
        width: 100%;
    }

    body {
        padding: 20px 16px;
        /* Reduce padding on mobile */
    }

    .hero-text {
        font-size: 2rem;
    }

    /* Fix scroller on mobile */
    .projects-scroller {
        margin: 0;
        /* Remove negative margins */
        padding: 0 0 16px 0;
        /* Remove side padding compensation */
    }

    .project-card {
        min-width: 260px;
        /* Slightly smaller min-width */
        width: 80vw;
        /* Responsive width */
    }
}

/* LeetCode Stats Widget */
.leetcode-card {
    background: var(--bg-card);
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.lc-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1rem;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 12px;
}

.lc-icon {
    width: 24px;
    height: 24px;
    color: #FFA116;
}

.lc-total {
    font-size: 2rem;
    font-weight: 800;
    text-align: center;
    line-height: 1;
    margin: 6px 0 2px 0;
}

.lc-total-label {
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 16px;
}

/* Pie Chart */
.lc-pie-container {
    width: 100%;
    max-width: 120px;
    margin: 0 auto 16px auto;
}

.lc-pie-chart {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.06));
}

.lc-pie-slice {
    transition: opacity 0.3s ease;
    cursor: pointer;
}

.lc-pie-slice:hover {
    opacity: 0.85;
}

/* Legend */
.lc-legend {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}

.lc-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
}

.lc-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.lc-legend-label {
    color: var(--text-secondary);
    flex: 1;
}

.lc-legend-value {
    font-weight: 600;
    color: var(--text-primary);
}

.lc-link {
    text-align: center;
    font-size: 0.85rem;
    margin-top: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    display: block;
}

.lc-link:hover {
    color: var(--text-primary);
    text-decoration: underline;
}