/* Publications Section - Matching Projects/Achievements Style */
#publications {
    position: relative;
    padding: 3rem 2rem;
    height: 80vh;
    display: flex;
    flex-direction: column;
}

.publications-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.publications-scroll-container {
    overflow-x: auto;
    overflow-y: hidden;
    padding: 1rem 0 2rem 0;
    margin: 1rem 0;
    position: relative;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    flex: 1;
    display: flex;
    align-items: center;
    -webkit-mask: linear-gradient(90deg,#0000,#000 3% 97%,#0000);
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.publications-scroll-container::-webkit-scrollbar {
    display: none;
}

.publications-container {
    display: flex;
    gap: 2rem;
    padding: 0 1rem;
    min-width: min-content;
}

.publication-card {
    min-width: 550px;
    max-width: 550px;
    height: 100%;
    background: white;
    border-radius: 2rem;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: none;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    border: none;
    display: flex;
    flex-direction: column;
}

.publication-card:hover {
    transform: none;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

.publication-main {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex: 1;
}

.paper-preview {
    width: 140px;
    flex-shrink: 0;
    position: relative;
    cursor: pointer;
}

.paper-preview img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 0.5rem;
    border: none;
    background: #f5f5f5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Paper hover effect - enlarge with shadow */
.paper-preview:hover img {
    transform: scale(1.15) translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

/* Paper fold effect on hover */
.paper-preview::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 15px 15px 0;
    border-color: transparent #ffffff transparent transparent;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 11;
}

.paper-preview:hover::after {
    opacity: 0.8;
}

.publication-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.publication-header {
    margin-bottom: 0.5rem;
}

.publication-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #000000;
    margin-bottom: 0.4rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.publication-venue {
    font-size: 0.75rem;
    color: #555555;
    font-style: italic;
    margin-bottom: 0.2rem;
}

.publication-date {
    font-size: 0.7rem;
    color: #777777;
}

.publication-abstract {
    flex: 1;
}

.publication-abstract h4 {
    font-size: 0.75rem;
    font-weight: 600;
    color: #000000;
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.abstract-text {
    font-size: 0.75rem;
    color: #333333;
    line-height: 1.5;
    text-align: justify;
    max-height: 90px;
    overflow-y: auto;
    padding-right: 0.3rem;
}

.abstract-text::-webkit-scrollbar {
    width: 4px;
}

.abstract-text::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.abstract-text::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.abstract-text::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

.coauthors-section {
    margin-bottom: 0.8rem;
    padding-top: 0.8rem;
    border-top: 1px solid #eee;
}

.coauthors-section h4 {
    font-size: 0.7rem;
    font-weight: 600;
    color: #000000;
    margin-bottom: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.coauthors-grid {
    display: flex;
    gap: 0.6rem;
    flex-wrap: nowrap;
    overflow-x: auto;
}

.coauthors-grid::-webkit-scrollbar {
    height: 3px;
}

.coauthors-grid::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.coauthor-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0.4rem;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 0.8rem;
    transition: all 0.3s ease;
    min-width: 85px;
    flex-shrink: 0;
}

.coauthor-item:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.coauthor-photo-wrapper {
    position: relative;
    margin-bottom: 0.4rem;
}

.coauthor-photo {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #000000;
    transition: all 0.3s ease;
}

.coauthor-item:hover .coauthor-photo {
    border-color: #555555;
    transform: scale(1.05);
}

.affiliation-logo {
    position: absolute;
    bottom: -3px;
    right: -3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    border: 1.5px solid #000000;
    object-fit: contain;
    padding: 2px;
}

.coauthor-name {
    font-size: 0.65rem;
    font-weight: 500;
    color: #000000;
    margin-bottom: 0.2rem;
    line-height: 1.2;
}

.coauthor-affiliation {
    font-size: 0.55rem;
    color: #666666;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.publication-actions {
    display: flex;
    justify-content: center;
    margin-top: auto;
    padding-top: 0.5rem;
    gap: 1rem;
}

.paper-link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    position: relative;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15),
                inset 0 1px 0 rgba(255, 255, 255, 0.25);
    font-size: 0.95rem;
    font-weight: 500;
    color: #000;
    text-decoration: none !important;
}

.paper-link-btn:hover,
.paper-link-btn:focus,
.paper-link-btn:active,
.paper-link-btn:visited {
    text-decoration: none !important;
}

.paper-link-btn svg {
    width: 18px;
    height: 18px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    flex-shrink: 0;
}

.paper-link-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
    border-radius: 12px;
    z-index: 0;
}

.paper-link-btn span {
    position: relative;
    z-index: 1;
}

.paper-link-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.45);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.paper-link-btn:hover::before {
    opacity: 1;
}

.paper-link-btn:hover svg {
    transform: scale(1.1) translateX(2px);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.paper-link-btn:active {
    transform: translateY(-1px) scale(1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15),
                inset 0 2px 4px rgba(255, 255, 255, 0.2);
}

.paper-link-btn svg path {
    fill: #000;
}

/* Scroll Navigation Buttons - Match existing style */
.publications-nav-btn {
    font-weight: 600;
    transition: all 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
    padding: 0.75rem;
    width: 60px;
    height: 60px;
    border-radius: 16px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid rgba(0, 0, 0, 0.15);
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.15),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
    z-index: 10;
}

.publications-nav-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 14px;
    padding: 2px;
    background: linear-gradient(135deg, rgba(255,255,255,0.4), rgba(255,255,255,0.1));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.publications-nav-btn:hover::before {
    opacity: 1;
}

.publications-nav-btn::after {
    content: '';
    position: absolute;
    inset: -15px;
    background: radial-gradient(circle, rgba(0,0,0,0.08) 0%, transparent 70%);
    border-radius: 50%;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: -1;
}

.publications-nav-btn:hover::after {
    opacity: 1;
    inset: -20px;
}

.publications-nav-btn:hover {
    transform: translateY(-50%) scale(1.12);
    background: rgba(255, 255, 255, 0.35);
    border: 2px solid rgba(0, 0, 0, 0.25);
    box-shadow: 0 12px 40px rgba(31, 38, 135, 0.25),
                inset 0 1px 0 rgba(255, 255, 255, 0.5),
                0 0 0 4px rgba(255, 255, 255, 0.1);
}

.publications-nav-btn:active {
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 4px 16px rgba(31, 38, 135, 0.2),
                inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.publications-nav-btn .icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
    filter: brightness(0) saturate(100%) invert(0%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(20%) contrast(100%);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.publications-nav-btn:hover .icon {
    filter: brightness(0) saturate(100%) invert(0%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(10%) contrast(100%);
    transform: scale(1.15);
}

.publications-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(0, 0, 0, 0.08);
}

.publications-nav-btn:disabled:hover {
    transform: translateY(-50%);
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
}

.publications-nav-btn.left {
    left: -30px;
}

.publications-nav-btn.right {
    right: -30px;
}

/* Swipe Hint - hidden on desktop, visible on mobile */
.publications-swipe-hint {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 100px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #000000;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-align: center;
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: swipeHintPulse 2.5s ease-in-out infinite;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.publications-swipe-hint span {
    display: inline-block;
    line-height: 1;
    margin: 0;
    padding: 0;
    text-transform: uppercase;
    font-size: 0.7rem;
}

.publications-swipe-hint svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 1;
    color: #000000;
    animation: swipeArrowMove 1.8s ease-in-out infinite;
}

.publications-swipe-hint svg:first-child {
    transform: scaleX(-1);
    animation-delay: 0.9s;
}

.publications-swipe-hint.hide {
    opacity: 0;
    transform: translateX(-50%) translateY(15px) scale(0.9);
    pointer-events: none;
}

@keyframes swipeHintPulse {
    0%, 100% {
        opacity: 0.7;
        transform: translateX(-50%) scale(1);
    }
    50% {
        opacity: 1;
        transform: translateX(-50%) scale(1.02);
    }
}

@keyframes swipeArrowMove {
    0%, 100% {
        transform: translateX(0);
        opacity: 0.8;
    }
    50% {
        transform: translateX(4px);
        opacity: 1;
    }
}

/* Responsive Design */
@media screen and (max-width: 1200px) {
    .publication-card {
        min-width: 500px;
        max-width: 500px;
    }
}

@media screen and (max-width: 768px) {
    #publications {
        padding: 2rem 1rem;
        height: auto;
        min-height: 80vh;
    }
    
    .publication-card {
        min-width: 70vw;
        max-width: 70vw;
        padding: 1rem;
        box-sizing: border-box;
        margin: 0 auto;
    }

    .publication-main {
        flex-direction: column;
        gap: 1rem;
    }

    .paper-preview {
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .paper-preview img {
        width: 140px;
        height: 180px;
    }
    
    .publication-info {
        width: 100%;
    }

    .publication-title {
        font-size: 0.95rem;
    }

    .publication-venue {
        font-size: 0.75rem;
    }

    .publication-date {
        font-size: 0.7rem;
    }

    .publication-abstract h4 {
        font-size: 0.75rem;
    }

    .abstract-text {
        font-size: 0.75rem;
        max-height: 80px;
    }

    .coauthors-section h4 {
        font-size: 0.7rem;
        margin-bottom: 0.5rem;
    }
    
    .coauthors-grid {
        justify-content: flex-start;
        gap: 0.6rem;
        padding: 0 0.5rem;
        scroll-padding-left: 0.5rem;
    }

    .coauthor-item {
        min-width: 75px;
        padding: 0.4rem;
    }

    .coauthor-photo {
        width: 45px;
        height: 45px;
    }

    .affiliation-logo {
        width: 18px;
        height: 18px;
    }

    .coauthor-name {
        font-size: 0.65rem;
    }

    .coauthor-affiliation {
        font-size: 0.55rem;
    }

    .paper-link-btn {
        font-size: 0.85rem;
        padding: 8px 16px;
    }

    .paper-link-btn svg {
        width: 16px;
        height: 16px;
    }
    
    .publications-nav-btn {
        display: none;
    }

    .publications-swipe-hint {
        display: flex;
    }

    #publications {
        position: relative;
    }
}

@media screen and (max-width: 480px) {
    .publication-card {
        min-width: 75vw;
        max-width: 75vw;
        padding: 0.9rem;
        box-sizing: border-box;
        margin: 0 auto;
    }

    .publication-main {
        flex-direction: column;
        gap: 0.8rem;
    }

    .paper-preview img {
        width: 160px;
        height: 100%;
    }

    .publication-title {
        font-size: 0.9rem;
    }

    .publication-venue {
        font-size: 0.7rem;
    }

    .publication-date {
        font-size: 0.65rem;
    }

    .abstract-text {
        font-size: 0.7rem;
        max-height: 70px;
    }
    
    .coauthor-item {
        min-width: 70px;
        padding: 0.35rem;
    }

    .coauthor-photo {
        width: 42px;
        height: 42px;
    }

    .coauthor-name {
        font-size: 0.6rem;
    }

    .coauthor-affiliation {
        font-size: 0.52rem;
    }

    .paper-link-btn {
        font-size: 0.8rem;
        padding: 7px 14px;
    }
}