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

body {
    font-family: "Quicksand", sans-serif;
    background: #f9fbff;
    color: #333;
}

header {
    background: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid #eee;
}

.logo {
    font-family: "Baloo 2", cursive;
    font-size: 26px;
    color: #ff7043;
    cursor: pointer;
}

nav {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 30px;
}

nav a {
    text-decoration: none;
    color: #333;
    font-weight: 600;
}

.menu-toggle {
    display: none;
    font-size: 24px;
    cursor: pointer;
}

.mobile-menu {
    display: none;
    flex-direction: column;
    background: white;
    position: fixed;
    top: 90px;
    left: 0;
    width: 100%;
    z-index: 9999;

}

.mobile-menu a {
    padding: 15px;
    border-bottom: 1px solid #eee;
    text-decoration: none;
    color: #333;
}

.main {
    max-width: 1100px;
    margin: 40px auto;
    padding: 0 15px;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, 250px);
    gap: 20px;
}

.header {
    display: flex;
    justify-content: space-between;
    /* đẩy 2 bên */
    align-items: center;
    padding-bottom: 9px;
}

.title {
    font-family: "Baloo 2", cursive;
    font-size: 28px;
    margin-bottom: 20px;
    color: #1c4481;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 15px;
}

.search-box input {
    padding: 9px 12px;
    border: 1px solid #aaa8a8;
    border-radius: 6px;
    outline: none;
    width: 300px;
    font-size: 16px;

}

.search-box button {
    padding: 9px 12px;
    border: none;
    background: #ff7043;
    color: white;
    border-radius: 6px;
    cursor: pointer;
}

.search-box button:hover {
    background: #663303;
}

/* Mobile */
@media (max-width: 600px) {
    .header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .search-box {
        width: 100%;
    }

    .search-box input {
        flex: 1;
    }
    .video-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}


.post {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.06);
    transition: 0.3s;
    cursor: pointer;
    text-decoration: none;
}

.post:hover {
    transform: translateY(-6px);
    background-color: #d2eaff;
}

.post img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    display: block;
}

.post-content {
    padding: 12px;
}

.post-content {
    padding: 12px;
}

.meta {
    font-size: 12px;
    color: #888;
    margin-top: 5px;
}

.post h3 {
    font-size: 16px;
    margin-bottom: 6px;
    color: #000000;
}
.post h2 {
    font-size: 23px;
    margin-bottom: 6px;
    margin-top: 10px;
    color: #000000;
}

.post p {
    font-size: 14px;
    color: #666;
}

.post button {
    margin-top: 10px;
    padding: 8px 16px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(45deg, #42a5f5, #66bb6a);
    color: white;
    cursor: pointer;
    font-size: 14px;
}

footer {
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    color: #777;
}

@media (max-width: 768px) {
    nav {
        display: none;
    }

    .menu-toggle {
        display: block;
    }
}

nav a {
    position: relative;
    text-decoration: none;
    color: #333;
    font-weight: 600;
    padding: 5px 8px;
    transition: 0.3s;
}

/* Hiệu ứng đổi màu + scale nhẹ */
nav a:hover {
    color: #ff7043;
    transform: scale(1.1);
}

/* Gạch chân chạy từ giữa ra */
nav a::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -4px;
    width: 0;
    height: 3px;
    background: #ff7043;
    transition: 0.3s;
    transform: translateX(-50%);
}

nav a:hover::after {
    width: 100%;
}

/* Mobile menu hover */
.mobile-menu a {
    transition: 0.3s;
}

.mobile-menu a:hover {
    background: #f5f5f5;
    padding-left: 20px;
    color: #ff7043;
}

.footer {
    background: linear-gradient(135deg, #0d5189, #277d2b);
    color: white;
    margin-top: 60px;
    padding-top: 40px;
}

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

.footer-col h4 {
    margin-bottom: 10px;
    font-size: 18px;
}

.footer-col p {
    font-size: 14px;
    opacity: 0.9;
}

.footer-col a {
    display: block;
    text-decoration: none;
    color: white;
    margin: 6px 0;
    font-size: 14px;
    transition: 0.3s;
}

.footer-col a:hover {
    transform: translateX(5px);
    opacity: 0.8;
}

.footer-bottom {
    text-align: center;
    margin-top: 30px;
    padding: 15px;
    font-size: 13px;
    background: rgba(0, 0, 0, 0.1);
}

#loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff7e6;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    font-family: "Comic Sans MS", cursive;
}

.dots-loader {
    text-align: center;
}

.dots-loader span {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin: 5px;
    background: #ff9f43;
    border-radius: 50%;
    animation: bounce 0.6s infinite alternate;
}

.dots-loader span:nth-child(2) {
    animation-delay: 0.2s;
}

.dots-loader span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes bounce {
    to {
        transform: translateY(-10px);
    }
}

.dots-loader p {
    margin-top: 10px;
    font-size: 16px;
}