/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Body */
body {
    font-family: 'Poppins', Arial, sans-serif;
    background: linear-gradient(135deg, #f0f4f8, #d9e4f5);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header (Sidebar trên đầu) */
header {
    background: linear-gradient(90deg, #1e3c72, #2a5298);
    color: #fff;
    padding: 20px;
    text-align: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    z-index: 1000;
}

header h1 {
    margin-bottom: 10px;
    font-size: 24px;
    letter-spacing: 1px;
}

header nav a {
    margin: 0 15px;
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    position: relative;
    transition: color 0.3s ease;
}

header nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -3px;
    width: 0%;
    height: 2px;
    background: #ffd700;
    transition: width 0.3s ease;
}

header nav a:hover {
    color: #ffd700;
}

header nav a:hover::after {
    width: 100%;
}

/* Nội dung chính */
main {
    flex: 1;
    display: flex;
    justify-content: center;
    margin-top: 100px;
    padding: 30px;
}

/* Container */
.container {
    background: #fff;
    width: 85%;
    max-width: 1200px;
    min-height: 600px;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    animation: fadeIn 0.8s ease-in-out;
}

/* Section */
.section {
    margin-bottom: 25px;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 10px;
    background: #fafafa;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.section:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.1);
}

.section h2 {
    margin-bottom: 12px;
    color: #2a5298;
    font-size: 20px;
}

/* Buttons */
button {
    background: linear-gradient(90deg, #ff7e5f, #feb47b);
    color: #fff;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transition: transform 0.2s ease, box-shadow 0.3s ease;
}

button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.3);
}

/* Input */
input[type="text"], input[type="email"], input[type="password"] {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    width: 60%;
    margin-right: 10px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input:focus {
    border-color: #2a5298;
    box-shadow: 0 0 6px rgba(42,82,152,0.5);
    outline: none;
}

/* Footer */
footer {
    background: #1e3c72;
    color: #fff;
    text-align: center;
    padding: 20px;
    margin-top: auto;
}

/* Hiệu ứng fadeIn */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.home {
    margin-top: 20px;
}

.banner {
    background: green;
    color: white;
    padding: 10px;
    text-align: center;
    font-weight: bold;
}

.announcement {
    border: 2px solid green;
    padding: 10px;
    margin: 15px 0;
}

.posts h2 {
    margin-bottom: 10px;
}

.post-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.post {
    border: 1px solid #ccc;
    padding: 10px;
}

.post-title {
    background: pink;
    padding: 5px;
    font-weight: bold;
}

.post-content {
    margin-top: 5px;
}

.next-page {
    margin-top: 20px;
}

.next-page button {
    background: pink;
    border: none;
    padding: 8px 15px;
    cursor: pointer;
    font-weight: bold;
}
/* Ô wrapper căn giữa */
.home-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

/* Nội dung chính trong ô */
.home {
    width: 900px;
    background: #fff;
    padding: 20px;
    box-shadow: 0 0 15px rgba(0,0,0,0.15);
    border-radius: 12px; /* bo tròn toàn khung */
}

/* Banner */
.banner {
    background: green;
    color: white;
    padding: 10px;
    text-align: center;
    font-weight: bold;
    border-radius: 12px;
}

/* Thông báo */
.announcement {
    border: 2px solid green;
    padding: 10px;
    margin: 15px 0;
    border-radius: 12px;
}

/* Bài đăng */
.posts h2 {
    margin-bottom: 10px;
}

.post-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.post {
    border: 1px solid #ccc;
    padding: 10px;
    border-radius: 12px;
    background: #fafafa;
    transition: transform 0.2s ease;
}

.post:hover {
    transform: translateY(-3px);
}

.post-title {
    background: pink;
    padding: 5px;
    font-weight: bold;
    border-radius: 8px;
}

.post-content {
    margin-top: 5px;
}

.post-image {
    margin-top: 10px;
    text-align: center;
}

.post-image img {
    max-width: 100%;
    border: 1px solid #ddd;
    border-radius: 12px;
}

/* Nút trang tiếp */
.next-page {
    margin-top: 20px;
    text-align: left;
}

.next-page button {
    background: pink;
    border: none;
    padding: 8px 15px;
    cursor: pointer;
    font-weight: bold;
    border-radius: 12px;
    transition: background 0.2s ease;
}

.next-page button:hover {
    background: #ffb6c1;
}

.category-grid {
    display: flex;              /* dùng flexbox để xếp ngang */
    flex-wrap: wrap;            /* cho phép xuống dòng nếu quá dài */
    gap: 20px;                  /* khoảng cách giữa các item */
    justify-content: flex-start;/* hoặc center nếu muốn căn giữa */
}

.category-item {
    flex: 0 0 auto;             /* giữ kích thước tự nhiên */
    text-align: center;
}
.category-item img {
    display: block;
    margin: 0 auto 8px;
}

