body {
    margin: 0;
    font-family: "Roboto Slab", "Times New Roman", Times, serif;
    background: url("/assets/img/bg.jpg") center center/cover no-repeat fixed;
    position: relative;
    color: #222;
}

button {
    font-family: "Roboto Slab", "Times New Roman", Times, serif;
}
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.85); /* 0.5 = 50% mờ */
    z-index: -1;
    pointer-events: none;
}
.header {
    padding: 24px 16px 16px 16px;
}
.logo {
    width: 150px;
    height: 150px;
    object-fit: contain;
    margin-bottom: 8px;
}
.logo.small {
    width: 48px;
    height: 48px;
    margin-bottom: 0;
}
.school-name {
    font-size: 2.2rem;
    font-weight: bold;
    letter-spacing: 2px;
}
.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 32px 0 0 0;
}
.hero-img {
    width: 90vw;
    max-width: 600px;
    border-radius: 18px;
    box-shadow: 0 4px 24px rgba(59, 89, 152, 0.12);
    margin-bottom: 32px;
    transition: transform 0.5s cubic-bezier(0.4, 2, 0.6, 1);
}
.hero-img:hover {
    transform: scale(1.03) rotate(-1deg);
}
.start-btn {
    background: #3b5998;
    color: #fff;
    font-size: 1.5rem;
    padding: 16px 48px;
    border: none;
    border-radius: 32px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(59, 89, 152, 0.12);
    transition: background 0.3s, transform 0.2s;
}
.start-btn:hover {
    background: #2d4373;
    transform: scale(1.05);
}
.topics-grid {
    display: grid;
    grid-template-columns: repeat(
        4,
        minmax(0, 1fr)
    ); /* Luôn 4 cột, không co giãn quá mức */
    gap: 40px;
    padding: 56px 5vw 0 5vw;
    align-items: stretch;
    position: relative;
    justify-items: center; /* căn giữa các item nếu thiếu */
}
.topic-card {
    border-radius: 18px;
    padding: 0;
    text-align: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.topic-card-wrapper:hover {
    box-shadow: 0 12px 36px rgba(59, 89, 152, 0.25);
    border-color: #c9a063;
    transform: scale(1.04) rotate(-1deg); /* bỏ translateY */
    transition: transform 0.3s ease, box-shadow 0.3s ease,
        border-color 0.3s ease;
}

.topic-card::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, #c9a063 0%, #3b5998 100%);
    opacity: 0.7;
}
.topic-icon {
    width: 100%;
    height: 200px;
    display: block;
    padding: 0;
    margin: 0;
    border-radius: 0;
    max-height: none;
    object-fit: cover;
}
.topic-card h2 {
    font-size: 1.5rem;
    color: #3b5998;
    margin: 0;
    font-weight: bold;
    padding: 20px 10px;
}
.topic-detail main {
    max-width: 800px;
    margin: 0 auto;
    padding: 32px 16px;
}
#topic-title {
    color: #3b5998;
    font-size: 2rem;
    margin-top: 12px;
}
.topic-content {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(59, 89, 152, 0.08);
    padding: 32px 24px;
    font-size: 1.2rem;
    color: #222;
    margin-bottom: 32px;
    line-height: 1.7;
}
.back-btn {
    color: #fff;
    font-size: 1.1rem;
    padding: 12px 32px;
    border: none;
    border-radius: 24px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(59, 89, 152, 0.1);
    transition: background 0.3s, transform 0.2s;
}
.back-btn:hover {
    background: #2d4373;
    transform: scale(1.04);
}
.start-btn,
.back-btn {
    background: linear-gradient(90deg, #3b5998 60%, #c9a063 100%);
    color: #fff;
    font-size: 1.5rem;
    padding: 16px 48px;
    border: none;
    border-radius: 32px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(59, 89, 152, 0.12);
    transition: background 0.3s, transform 0.2s, box-shadow 0.3s;
    position: relative;
    overflow: hidden;
}
.start-btn:hover,
.back-btn:hover {
    background: linear-gradient(90deg, #c9a063 0%, #3b5998 100%);
    color: #fff;
    box-shadow: 0 4px 24px #c9a06355;
    transform: scale(1.07);
}
.decor-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 8px;
    opacity: 0.7;
    display: block;
    margin-left: auto;
    margin-right: auto;
}
.topics-grid {
    gap: 40px;
    padding: 56px 5vw 0 5vw;
}
.decorative-corner {
    position: fixed;
    right: 2vw;
    bottom: 2vw;
    width: 96px;
    height: 96px;
    opacity: 0.18;
    z-index: 1;
    pointer-events: none;
}
.header,
.main,
.topics-grid,
.topic-content {
    position: relative;
    z-index: 2;
}
.topic-card-wrapper {
    width: 100%;
    position: relative;
    transition: box-shadow 0.3s, transform 0.3s, border-color 0.3s,
        background 0.3s;
    border-radius: 18px;
    border: 2px solid #3b5998;
    box-shadow: 0 4px 24px rgba(59, 89, 152, 0.1);
    margin-bottom: 16px;
    height: 100%;
    display: flex;
    flex-direction: column;
    background-color: white;
}
.topic-card-wrapper:hover {
    box-shadow: 0 12px 36px rgba(59, 89, 152, 0.25);
    transform: translateY(-10px) scale(1.04) rotate(-1deg);
    border-color: #c9a063;
    background: #f9f6f2;
}
.topic-card-wrapper:hover .card-lotus {
    filter: brightness(1.1) drop-shadow(0 2px 8px #c9a06388);
}
.card-lotus {
    position: absolute;
    width: 35px;
    height: 35px;
    transform: rotate(45deg);
    pointer-events: none;
    z-index: 3;
    top: -15px;
    right: -15px;
}
/* Đặt vị trí cho từng hoa sen tương ứng với từng card */
.topics-grid > .card-lotus:nth-of-type(2) {
    grid-row: 1;
    grid-column: 1;
    top: 8px;
    right: 8px;
}
.topics-grid > .card-lotus:nth-of-type(4) {
    grid-row: 1;
    grid-column: 2;
    top: 8px;
    right: 8px;
}
.topics-grid > .card-lotus:nth-of-type(6) {
    grid-row: 1;
    grid-column: 3;
    top: 8px;
    right: 8px;
}
.topics-grid > .card-lotus:nth-of-type(8) {
    grid-row: 1;
    grid-column: 4;
    top: 8px;
    right: 8px;
}
.topics-grid > .card-lotus:nth-of-type(10) {
    grid-row: 2;
    grid-column: 1;
    top: 8px;
    right: 8px;
}
.topics-grid > .card-lotus:nth-of-type(12) {
    grid-row: 2;
    grid-column: 2;
    top: 8px;
    right: 8px;
}
.topics-grid > .card-lotus:nth-of-type(14) {
    grid-row: 2;
    grid-column: 3;
    top: 8px;
    right: 8px;
}
.topics-grid > .card-lotus:nth-of-type(16) {
    grid-row: 2;
    grid-column: 4;
    top: 8px;
    right: 8px;
}

/* === HERO SECTION LAYOUT === */
.hero-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    min-height: 100vh;
    padding: 30px 100px;
    box-sizing: border-box;
}
.hero-left {
    flex: 0 0 340px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-left: 5vw;
}
.school-img {
    object-fit: cover;
    width: 100%;
    border-radius: 24px;
    box-shadow: 0 4px 32px rgba(59, 89, 152, 0.13);
}
.hero-right {
    display: flex;
    flex-direction: column;
    margin-top: 50px;
}
.school-name {
    font-size: 3.5em;
    font-weight: bold;
    color: #222;
    letter-spacing: 1px;
    white-space: nowrap;
    margin-left: 50px;
    text-align: center;
}
.school-desc {
    font-size: 1.3rem;
    color: #444;
    margin-bottom: 32px;
    line-height: 1.7;
}
.hero-buttons {
    display: flex;
    gap: 18px;
}
.hero-btn {
    background: linear-gradient(90deg, #3b5998 60%, #c9a063 100%);
    color: white;
    font-size: 1.1rem;
    padding: 14px 32px;
    border: none;
    border-radius: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(59, 89, 152, 0.1);
    transition: background 0.2s, color 0.2s, transform 0.2s;
}
.hero-btn:hover {
    background: linear-gradient(90deg, #c9a063 60%, #3b5998 100%);
    transform: translateY(-2px) scale(1.04);
}

/* === DECORATIVE SQUARES === */
.decor-squares {
    position: absolute;
    right: 3vw;
    top: 40px;
    display: grid;
    grid-template-columns: repeat(3, 64px);
    grid-template-rows: repeat(3, 64px);
    gap: 12px;
    z-index: 2;
}
.square {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    box-shadow: 0 2px 8px rgba(59, 89, 152, 0.1);
}
.square.pattern {
    background: repeating-linear-gradient(
        135deg,
        #1a237e 0 8px,
        #ffb300 8px 16px,
        #1a237e 16px 24px,
        #fff 24px 32px
    );
    background-size: 32px 32px;
    border: 2px solid #3b5998;
}
.square.yellow {
    background: #ffb300;
    border: 2px solid #ffb300;
}

/* === FOOTER YEAR === */
.footer {
    position: fixed;
    left: 32px;
    bottom: 24px;
    z-index: 10;
}
.year {
    font-size: 1.1rem;
    color: #222;
    opacity: 0.7;
    font-weight: 500;
}

/* === BACKGROUND PATTERN === */
.background-pattern {
    display: none;
}

.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
}
.hero-top {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
}
.hero-middle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
}

/* Xóa decor-squares và square */
.decor-squares,
.square,
.square.pattern,
.square.yellow {
    display: none !important;
}

.header h1 {
    text-align: center;
    color: #3b5998;
}

.heading-decor {
    width: 120px;
    height: auto;
    display: inline-block;
    vertical-align: middle;
    margin: 0 12px;
}
@media (max-width: 700px) {
    .heading-decor {
        display: none;
    }
}
.header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-bottom: 30px;
}
.heading-decor-ptt {
    width: 200px;
    height: auto;
    display: inline-block;
    vertical-align: middle;
    margin: 0 12px;
}
.ptt-title {
    color: #3b5998;
    font-size: 2.7em;
    margin: 0 8px;
    text-align: center;
    font-family: "Libre Bodoni", serif;
}

.side-buttons {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border-radius: 20px 0 0 20px;
    overflow: hidden;
}
.side-btn {
    background: linear-gradient(90deg, #c9a063 0%, #3b5998 100%);
    border: none;
    border-radius: 0;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.7rem;
    color: #fff;
    cursor: pointer;
    transition: filter 0.2s;
    box-shadow: none;
}
.side-btn:first-child {
    border-radius: 20px 0 0 0;
}
.side-btn:last-child {
    border-radius: 0 0 0 20px;
}
.side-btn:hover {
    filter: brightness(1.15) contrast(1.1);
    background: linear-gradient(90deg, #3b5998 0%, #c9a063 100%);
}

.hero-bottom {
    width: 100%;
    text-align: right;
    font-size: 0.9rem;
    margin-top: 80px;
}

@media (max-width: 1100px) {
    .topics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 700px) {
    .topics-grid {
        grid-template-columns: 1fr;
    }
}

/* Responsive cho màn hình <= 880px */
@media (max-width: 880px) {
    .hero-section {
        padding: 24px 10vw;
        min-height: unset;
    }
    .hero-middle {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    .school-img {
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
        display: block;
    }
    .hero-right {
        margin-top: 0;
        align-items: center;
        text-align: center;
    }
    .school-name {
        font-size: 2em;
        margin-left: 0;
        white-space: normal;
    }
    .hero-top {
        flex-direction: column;
        gap: 10px;
    }
    .hero-bottom {
        text-align: center;
        margin-top: 40px;
        font-size: 0.95rem;
    }
    .background-pattern {
        display: none;
    }
    .logo-container {
        justify-content: center;
    }
    .school-desc {
        font-size: 1.1rem;
        margin-bottom: 24px;
    }
    .hero-buttons {
        flex-direction: column;
        gap: 12px;
        align-items: center;
    }
    .header {
        flex-direction: column;
        margin-bottom: 0;
    }
    .topics-grid {
        padding-top: 30px
    }
    .heading-decor-ptt:first-child {
        display: none;
    }
}

.topic-content img {
    width: 100%;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(59, 89, 152, 0.08);
}
