* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Inter", sans-serif;
    color: #333;
}

body {
    opacity: 0; 
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s;
    position: relative;
}

body.loaded {
    opacity: 1;
    visibility: visible;
}

section {
    padding: 20px 30px;
}

.bolded {
    font-weight: 700;
}

h1 { font-size: 28px; font-weight: 700; }
h2 { font-size: 24px; font-weight: 700; }
h3 { font-size: 20px; font-weight: 600; }
h4 { font-size: 18px; font-weight: 600; }
h5 { font-size: 16px; font-weight: 500; }
h6 { font-size: 14px; font-weight: 500; }

h1,h2,h3,h4,h5,h6 {
    display: block;
    width: 100%;
    text-align: center;
}

p, span, a {
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
}

@media (min-width: 768px) and (max-width: 1366px) {
    h1 { font-size: 36px; }
    h2 { font-size: 30px; }
    h3 { font-size: 24px; }
    h4 { font-size: 20px; }
    h5 { font-size: 18px; }
    h6 { font-size: 16px; }

    p, span, a {
        font-size: 16px; 
    }
}

@media (min-width: 1367px) {
    h1 { font-size: 48px; }
    h2 { font-size: 36px; }
    h3 { font-size: 28px; }
    h4 { font-size: 24px; }
    h5 { font-size: 20px; }
    h6 { font-size: 18px; }

    p, span, a {
        font-size: 18px;
    }
}

/* Header */

.header {
    position: sticky;
    top: 0;
    left: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    border-bottom: 1px solid #ddd;
    background-color: #fff;
    z-index: 999999;
}

#app-logo {
    height: 60px;
    border-radius: 50%;
}

select#lang-switch {
    padding: 8px 12px;
    border-radius: 5px;
    border: 1px solid #ccc;
    cursor: pointer;
    margin-left: auto;
    background-color: #fff;
    outline: none;
}

/* Header */

/* Hero section */

.hero-section {
    background: url(/assets/images/hanoiline.jpg) no-repeat center;
    background-size: contain;
    min-height: calc(100vh - 91px);
    align-content: center;
}

.hero-content {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background-color: rgba(255,255,255,0.88);
    padding: 15px;
    border-radius: 8px;
    box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
}

.hero-content h1 {
    width: 100%;
    text-align: center;
}

.hero-content p {
    color: #333;
}

.hero-content img {
    width: 100%;
    height: auto;
    user-select: none;
    pointer-events: none;
}

/* Hero section */

/* Project outcomes section */

.publications-container {
    display: flex;
    gap: 20px;
    margin: 0 auto;
    margin-top: 50px;
}

.publications-container img {
    width: calc(33% - 10px);
    aspect-ratio: 1/1;
    border-radius: 12px;
    box-shadow: rgba(0, 0, 0, 0.1) 0px 4px 12px;
    transition: .3s ease-in-out;
    object-fit: cover;
}

.publications-container img:hover {
    transform: scale(1.01);
}

@media (max-width: 1000px) {
    .publications-container {
        flex-direction: column;
    }

    .publications-container img {
        width: 100%;
    }

    .publications-container img:hover {
        transform: unset;
    }
}

.research-paper {
    margin-top: 50px;
}

.bookshelf {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.book-item {
    background-color: #fff;
    width: 100%;
    aspect-ratio: 2/3;
    border-radius: 4px 12px 12px 4px;
    box-shadow: 5px 5px 15px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 10px;
    padding-left: 20px;
    border-left: 8px solid #2c3e50;
}

.book-item::before {
    content: '';
    position: absolute;
    top: 0; bottom: 0; left: 0; width: 15px;
    background: linear-gradient(to right, rgba(255,255,255,0.2), rgba(0,0,0,0.1));
}

.book-item:hover {
    transform: translateY(-5px);
    box-shadow: 8px 12px 20px rgba(0,0,0,0.3);
}

.book-title {
    font-size: 16px;
    font-weight: bold;
    color: #444;
    pointer-events: none;
}
.book-author {
    font-size: 14px;
    color: #666;
    margin-top: 5px;
    font-style: italic;
}

.cover-1 { background-color: #e0f7fa; border-left-color: #006064; }
.cover-2 { background-color: #f3e5f5; border-left-color: #4a148c; }
.cover-3 { background-color: #fff3e0; border-left-color: #e65100; }
.cover-4 { background-color: #e8f5e9; border-left-color: #1b5e20; }
.cover-5 { background-color: #ffebee; border-left-color: #b71c1c; }

.modal {
    display: none; 
    position: fixed; 
    z-index: 10000000; 
    left: 0; top: 0; width: 100%; height: 100%; 
    background-color: rgba(0,0,0,0.6); 
    align-items: center; justify-content: center;
}

.modal-content {
    background-color: #fff;
    padding: 20px;
    border-radius: 10px;
    width: 90%;
    height: 90%;
    position: relative;
    animation: fadeIn 0.3s;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    position: relative;
}

.close-btn {
    position: absolute;
    top: 10px; right: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
}
.close-btn:hover { color: #000; }

.modal-body {
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
}

.lang-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.btn-lang {
    padding: 12px 24px;
    font-size: 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: 0.2s;
    color: white;
}

.btn-lang.vn { background-color: #da251c; }
.btn-lang.fr { background-color: #002395; }
.btn-lang:hover { opacity: 0.9; transform: scale(1.05); }

.back-btn {
    align-self: flex-start;
    margin-bottom: 10px;
    background: none; border: 1px solid #ccc;
    padding: 5px 10px; cursor: pointer;
}

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

.action-btn {
    padding: 8px 15px;
    border: 1px solid #007bff;
    background-color: #fff;
    color: #007bff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 5px;
}

.action-btn:hover {
    background-color: #007bff;
    color: white;
}

.action-btn.download {
    border-color: #28a745;
    color: #28a745;
}

.action-btn.download:hover {
    background-color: #28a745;
    color: white;
}

/* Ẩn chữ trên mobile nếu màn hình quá nhỏ */
@media (max-width: 480px) {
    .btn-text { display: none; }
    .action-btn { padding: 8px 12px; }
}

.maps-container {
    width: 100%;
    max-width: 1000px;
    margin: 50px auto 0 auto;
    display: flex;
    flex-direction: column;
    gap: 30px;
    justify-content: center;
    align-items: center;
}

.maps-container .hanoi-map {
    width: 100%;
    border-radius: 12px;
    box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;
    transition: .3s ease-in-out;
}

.maps-container .hanoi-map:hover {
    transform: scale(1.02);
}

.research-journey-container {
    margin-top: 50px;
}

.journey-list {
    max-width: 1000px;
    margin: 30px auto 0 auto;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.journey-row {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.journey-img-wrapper {
    width: 100%;
    height: fit-content;
    overflow: hidden;
}

.journey-img-wrapper img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.journey-papers {
    padding: 20px;
    background-color: #fafafa;
    border-top: 1px solid #eee;
}

.journey-label {
    font-size: 16px;
    margin-bottom: 10px;
    font-weight: bold;
    letter-spacing: 1px;
}

.paper-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 15px;
    margin-bottom: 10px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.paper-btn span {
    font-size: 18px;
    font-weight: 700;
}

.paper-btn:last-child { margin-bottom: 0; }

.paper-btn:hover {
    background-color: #e3f2fd;
    border-color: #2196F3;
    color: #0d47a1;
    padding-left: 20px;
}

.paper-btn i { color: #2196F3; }

.fieldwork-container {
    width: 100%;
    max-width: 1000px;
    display: flex;
    gap: 30px;
    margin: 50px auto 0 auto;
    flex-direction: column;
}

.fieldwork-img {
    width: 100%;
    border-radius: 12px;
    box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;
}

.reportage-container {
    margin: 50px auto 0 auto;
    width: 100%;
    max-width: 1000px;
}

/* Project outcomes section */

/* Members section */

.members-content {
    display: flex;
    margin: 50px auto 0 auto;
    flex-direction: column;
    max-width: 1000px;
}

.members-section .bolded {
    margin-top: 12px;
}

.members-section ul {
    list-style: none;
    margin-top: 5px;
}

/* Members section */

/* Footer */

footer {
    width: 100%;
    padding: 15px 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: #333;
    color: #fff;
    margin-top: 30px;
}

footer a, footer span {
    color: #fff;
}

footer #copyright {
    color: #fff;
    display: inline-block;
    margin-top: 10px;
    text-align: center;
}

/* Footer */

@media (max-width: 768px) {
    section {
        padding: 15px 10px;
    }

    .journey-papers, .paper-btn {
        padding: 10px;
    }

    .modal-content {
        width: 100%;
        height: 100%;
        border-radius: 0;
        padding: 5px;
    }

    .header {
        padding: 15px 10px;
    }

    .hero-section {
        background-size: cover;
        min-height: calc(100vh - 71px);
    }

    #app-logo {
        height: 40px;
        border-radius: 50%;
    }
}