/* Work Page Layout */
.work-container {
    display: grid;
    grid-template-columns: 250px 1fr;
    max-width: 1400px;
    margin: 0 auto;
    margin-top: 70px;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    position: sticky;
    top: 70px;
    height: 100%;
    min-height: calc(100vh - 70px);
    padding: 2rem;
    border-right: 1px solid var(--border);
    background-color: var(--bg-secondary);
    overflow-y: auto;
    align-self: stretch;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background-color: var(--border);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-tertiary);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    transition: var(--transition);
    display: block;
}

.sidebar-link:hover {
    color: var(--text-primary);
    background-color: var(--bg-tertiary);
}

.sidebar-link.active {
    color: var(--accent);
    background-color: var(--accent-light);
}

/* Main Content */
.work-content {
    padding: 2rem 4rem 3rem 4rem;
    max-width: 900px;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
    animation: fadeIn 0.4s ease-out;
}

@media (max-width: 768px) {
    .content-section.active {
        margin-top: 0;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-title {
    font-size: 2.5rem;
    color: var(--text-primary);
    font-weight: 700;
    margin-bottom: 3rem;
    letter-spacing: -0.02em;
}


/* Experience Section */
.exp-list {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.exp-card {
    padding: 2rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: var(--transition);
}

.exp-card:hover {
    border-color: var(--accent);
}

.exp-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.exp-card-title {
    font-size: 1.3rem;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.exp-card-company {
    font-size: 1rem;
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.exp-card-location {
    font-size: 0.9rem;
    color: var(--text-tertiary);
}

.exp-card-date {
    font-size: 0.9rem;
    color: var(--text-tertiary);
    white-space: nowrap;
}

.exp-card-description {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.exp-project {
    margin-bottom: 2rem;
}

.exp-project:last-child {
    margin-bottom: 0;
}

.exp-project-title {
    font-size: 1.05rem;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.exp-card-highlights {
    list-style: none;
    padding-left: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.exp-card-highlights li {
    font-size: 0.95rem;
    color: var(--text-secondary);
    padding-left: 1.5rem;
    position: relative;
    line-height: 1.6;
}

.exp-card-highlights li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent);
}

/* Publications Section */
.pub-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
    padding: 2rem;
    background-color: var(--bg-secondary);
    border-radius: 12px;
}

.pub-overview-stat {
    text-align: center;
}

.pub-overview-num {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 0.25rem;
}

.pub-overview-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.pub-category {
    margin-bottom: 3rem;
}

.pub-category:last-child {
    margin-bottom: 0;
}

.pub-category-title {
    font-size: 1.5rem;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 2rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border);
}

.pub-full-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.pub-full-item {
    display: grid;
    grid-template-columns: 60px 1fr;
    gap: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

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

.pub-full-year {
    font-size: 0.9rem;
    color: var(--text-tertiary);
    font-weight: 600;
    text-align: right;
    padding-top: 0.2rem;
}

.pub-full-title {
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.pub-full-authors {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    line-height: 1.5;
}

.pub-full-authors strong {
    color: var(--text-primary);
}

.pub-full-venue {
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 500;
}

/* Volunteer Section */
.volunteer-grid {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.volunteer-category {
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.volunteer-category:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.volunteer-category-title {
    font-size: 1.3rem;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.volunteer-list {
    list-style: none;
    padding-left: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.volunteer-list li {
    font-size: 0.95rem;
    color: var(--text-secondary);
    padding-left: 1.5rem;
    position: relative;
    line-height: 1.6;
}

.volunteer-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent);
}

/* Skills Section */
.skills-detailed {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.skill-group {
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.skill-group:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.skill-group-title {
    font-size: 1.2rem;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 1.25rem;
}

.skill-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.skill-item {
    font-size: 0.9rem;
    color: var(--text-secondary);
    background-color: var(--bg-secondary);
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: var(--transition);
}

.skill-item:hover {
    color: var(--accent);
    border-color: var(--accent);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .work-container {
        grid-template-columns: 200px 1fr;
        min-height: 100vh;
    }

    .sidebar {
        padding: 2rem 1.5rem;
        height: 100%;
        min-height: calc(100vh - 70px);
    }

    .work-content {
        padding: 2rem 3rem;
    }

    .page-title {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .work-container {
        grid-template-columns: 1fr;
        gap: 0;
        margin-top: 70px;
        display: block;
        min-height: auto;
    }

    .sidebar {
        position: sticky;
        top: 70px;
        z-index: 100;
        background-color: var(--bg-primary);
        height: auto;
        min-height: auto;
        max-height: none;
        padding: 1rem;
        padding-bottom: 0.75rem;
        border-right: none;
        border-bottom: 1px solid var(--border);
        margin-top: 0;
        margin-bottom: 0;
    }

    .sidebar-nav {
        flex-direction: row;
        overflow-x: auto;
        gap: 0.5rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        margin: 0;
        padding: 0;
    }
    
    .sidebar-nav::-webkit-scrollbar {
        height: 4px;
    }
    
    .sidebar-nav::-webkit-scrollbar-track {
        background: var(--bg-secondary);
    }
    
    .sidebar-nav::-webkit-scrollbar-thumb {
        background: var(--border);
        border-radius: 2px;
    }

    .sidebar-link {
        white-space: nowrap;
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }

    .work-content {
        padding: 2rem 1.5rem;
        margin-top: 0;
    }

    .page-title {
        font-size: 1.75rem;
        margin-bottom: 2rem;
    }

    .exp-card-header {
        flex-direction: column;
        gap: 0.5rem;
    }

    .exp-card-date {
        white-space: normal;
    }

    .pub-full-item {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .pub-full-year {
        text-align: left;
    }

    .pub-overview {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .sidebar {
        padding: 0.75rem 1rem;
        padding-bottom: 0.5rem;
        height: auto;
        min-height: auto;
        max-height: none;
    }

    .work-content {
        padding: 1.5rem 1rem;
        margin-top: 0;
    }

    .page-title {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .exp-card {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .exp-card-title {
        font-size: 1.1rem;
    }
    
    .exp-card-company {
        font-size: 0.9rem;
    }
    
    .exp-card-highlights {
        font-size: 0.9rem;
        padding-left: 1.25rem;
    }

    .pub-overview {
        grid-template-columns: 1fr;
        padding: 1.5rem;
        gap: 1rem;
    }
    
    .pub-overview-num {
        font-size: 2rem;
    }
    
    .pub-full-title {
        font-size: 0.95rem;
    }
    
    .pub-full-authors,
    .pub-full-venue {
        font-size: 0.85rem;
    }
    
    .sidebar {
        padding: 0.75rem;
    }
    
    .sidebar-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
    
    .skill-item {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
}

/* Touch-friendly improvements for mobile devices */
@media (hover: none) and (pointer: coarse) {
    .sidebar-link,
    .pub-link {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    .exp-card,
    .pub-full-item {
        padding: 1.5rem;
    }
    
    /* Increase spacing for better touch targets */
    .sidebar-link {
        padding: 0.75rem 1rem;
    }
}

/* Extra small devices */
@media (max-width: 375px) {
    .page-title {
        font-size: 1.35rem;
    }
    
    .exp-card {
        padding: 1.25rem;
    }
    
    .exp-card-title {
        font-size: 1rem;
    }
    
    .exp-card-company,
    .exp-card-location {
        font-size: 0.85rem;
    }
    
    .exp-card-highlights {
        font-size: 0.85rem;
    }
    
    .pub-full-title {
        font-size: 0.9rem;
    }
    
    .pub-overview {
        padding: 1rem;
    }
    
    .pub-overview-num {
        font-size: 1.75rem;
    }
    
    .pub-overview-label {
        font-size: 0.75rem;
    }
    
    .volunteer-item,
    .skill-category {
        padding: 1.25rem;
    }
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background-color: var(--accent);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    z-index: 1000;
}

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

.back-to-top:hover {
    background-color: var(--accent);
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.back-to-top:active {
    transform: translateY(-2px);
}

.back-to-top svg {
    width: 24px;
    height: 24px;
}

@media (max-width: 768px) {
    .back-to-top {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 45px;
        height: 45px;
    }
    
    .back-to-top svg {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 40px;
        height: 40px;
    }
}
