body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f8f9fc 0%, #e3eefe 100%);
    color: #222;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: #0078d7;
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: #005fa3;
}

h1,
h2,
h3 {
    margin-top: 0;
    color: #005fa3;
    font-weight: 700;
}

/* HEADER */
header {
    background: linear-gradient(90deg, #0078d7 60%, #005fa3 100%);
    color: #fff;
    padding: 12px 0 8px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.10);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 92%;
    max-width: 1200px;
    margin: auto;
}

header h1 {
    font-size: 2rem;
    letter-spacing: 1px;
    margin-bottom: 0;
    color: white
}

#userBox {
    font-size: 1rem;
    color: #fff;
    margin-left: 10px;
}

/* SEARCH BOX */
.search-box {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 32px;
    overflow: hidden;
    border: 1px solid #cce0f7;
    box-shadow: 0 1px 4px #e3eefe44;
}

.search-box select {
    background: #005fa3;
    color: #fff;
    border: none;
    padding: 8px 12px;
    font-size: 1rem;
    cursor: pointer;
    outline: none;
}

.search-box input {
    border: none;
    padding: 8px 14px;
    font-size: 1rem;
    outline: none;
    width: 210px;
    background: #f8f9fc;
}

.search-box button {
    background: #0078d7;
    border: none;
    color: #fff;
    padding: 8px 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background 0.2s;
}

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

.search-box button i {
    font-size: 1.1rem;
}

/* NAV */
nav {
    background: #005fa3;
    text-align: center;
    padding: 13px 0 10px 0;
    box-shadow: 0 1px 4px #e3eefe44;
}

nav a {
    color: #fff;
    font-weight: 600;
    margin: 0 2.5%;
    padding: 6px 12px;
    border-radius: 5px;
    transition: background 0.2s, color 0.2s;
}

nav a.active,
nav a:focus {
    background: #ffd700;
    color: #005fa3;
}

nav a:hover {
    background: #e3eefe;
    color: #005fa3;
}

/* CONTAINER */
.container {
    display: flex;
    justify-content: center;
    margin: 40px auto 0 auto;
    width: 92%;
    max-width: 1200px;
    flex-grow: 1;
    gap: 32px;
}

/* CONTENT */
.content {
    flex: 3;
    min-width: 0;
}

.content article {
    background: #fff;
    border-radius: 12px;
    padding: 22px 24px 18px 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px #e3eefe55;
    position: relative;
}

.content article:hover {
    box-shadow: 0 2px 8px #e3eefe55;
}

.content article h2 {
    margin-bottom: 10px;
    color: #005fa3;
    font-size: 1.3rem;
}

.content article p {
    line-height: 1.7;
    margin: 8px 0 0 0;
}

.content article a {
    color: #0078d7;
    font-weight: 600;
    font-size: 1rem;
}

.content article a:hover {
    color: #005fa3;
    text-decoration: underline;
}

/* SIDEBAR */
.sidebar {
    flex: 1;
    background: #fff;
    border-radius: 12px;
    padding: 22px 20px 18px 20px;
    box-shadow: 0 2px 8px #e3eefe55;
    height: fit-content;
    min-width: 220px;
}

.sidebar h3 {
    color: #005fa3;
    font-size: 1.1rem;
    margin-bottom: 12px;
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar li {
    margin-bottom: 12px;
    font-size: 1rem;
}

.sidebar li a {
    color: #0078d7;
    font-weight: 500;
}

.sidebar li a:hover {
    color: #005fa3;
    text-decoration: underline;
}

/* PAGINATION */
.pagination {
    text-align: center;
    margin: 24px auto 40px auto;
}

.pagination button {
    background: #0078d7;
    color: #fff;
    border: none;
    border-radius: 7px;
    padding: 10px 22px;
    margin: 0 7px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s;
}

.pagination button:hover:not(:disabled) {
    background: #005fa3;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* FORMS */
form {
    background: #fff;
    border-radius: 12px;
    padding: 28px 24px 18px 24px;
    box-shadow: 0 2px 8px #e3eefe55;
}

form label {
    display: block;
    margin-top: 18px;
    font-weight: 600;
    color: #005fa3;
}

form input[type="text"],
form input[type="email"],
form input[type="password"],
form textarea,
form select {
    width: 100%;
    padding: 11px;
    border: 1px solid #cce0f7;
    border-radius: 7px;
    margin-top: 7px;
    font-size: 1rem;
    outline: none;
    background: #f8f9fc;
    transition: border 0.18s, box-shadow 0.18s;
}

form input[type="text"],
form textarea {
    width: 98%;
}

form input:focus,
form textarea:focus {
    border-color: #0078d7;
    box-shadow: 0 0 0 2px #0078d733;
}

form button {
    background: #0078d7;
    color: #fff;
    border: none;
    border-radius: 7px;
    padding: 11px 20px;
    margin-top: 22px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s;
}

form button:hover {
    background: #005fa3;
}

/* COMMENT SECTION */
.comment-section,
#comments {
    background: #fff;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 2px 8px #e3eefe55;
}

.comment {
    border-bottom: 1px solid #e3eefe;
    padding: 10px 0 8px 0;
}

.comment:last-child {
    border-bottom: none;
}

.comment strong {
    color: #005fa3;
    font-weight: 600;
}

.comment small {
    color: #666;
    font-size: 0.85rem;
}

.comment-form {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.comment-form textarea {
    resize: vertical;
    min-height: 60px;
    font-size: 1rem;
}

.comment-form button {
    align-self: flex-end;
    padding: 8px 18px;
    font-size: 1rem;
}

/* AUTH */
.auth .content {
    background: #fff;
    border-radius: 12px;
    padding: 32px 24px 18px 24px;
    box-shadow: 0 2px 8px #e3eefe55;
}

.auth form {
    margin-bottom: 28px;
}

.auth input {
    margin-bottom: 12px;
}

.auth hr {
    border: none;
    border-top: 1px solid #e3eefe;
    margin: 32px 0;
}

/* FOOTER */
footer {
    background: #005fa3;
    color: #fff;
    text-align: center;
    padding: 16px 0 12px 0;
    margin-top: auto;
    font-size: 1rem;
    letter-spacing: 0.5px;
}

/* RESPONSIVE */
@media (max-width: 900px) {
    .container {
        flex-direction: column;
        width: 98%;
        gap: 18px;
    }

    .sidebar {
        margin-top: 18px;
        min-width: 0;
    }
}

@media (max-width: 600px) {
    .header-container {
        flex-direction: column;
        gap: 10px;
        width: 98%;
    }

    .search-box input {
        width: 120px;
        font-size: 0.95rem;
    }

    .container {
        width: 99%;
        padding: 0 2px;
    }

    .content article,
    .sidebar,
    form,
    .auth .content {
        padding: 12px 7px 10px 7px;
    }

    nav a {
        margin: 0 1.5%;
        font-size: 0.98rem;
        padding: 5px 7px;
    }

    .pagination button {
        padding: 7px 10px;
        font-size: 0.95rem;
    }
}

.auth-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-buttons a,
.auth-buttons button {
    background-color: #0078d7;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.auth-buttons a:hover,
.auth-buttons button:hover {
    background-color: #005fa3;
}

/* ===== COMMENT SECTION IMPROVED ===== */
.comment {
    background: #fff;
    border: 1px solid #d0e2ff;
    border-radius: 12px;
    padding: 14px 16px 12px 16px;
    margin-bottom: 14px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
    position: relative;
    transition: all 0.2s ease;
}

.comment:hover {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.comment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.comment strong {
    color: #005fa3;
    font-weight: 600;
    font-size: 1rem;
    word-break: break-all;
    overflow-wrap: anywhere;
    display: inline-block;
    max-width: 100%;
    white-space: normal;
}


.comment small {
    color: #777;
    font-size: 0.85rem;
}

.comment p {
    margin: 6px 0 4px 0;
    color: #222;
    line-height: 1.5;
    white-space: pre-line;
}

/* Hành động (nút sửa / xóa) */
.comment-actions {
    display: flex;
    gap: 8px;
}

.comment-actions button {
    background: #f3f7ff;
    border: 1px solid #c7d7f9;
    border-radius: 6px;
    cursor: pointer;
    color: #005fa3;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 4px 8px;
    transition: all 0.2s ease;
}

.comment-actions button:hover {
    background: #0078d7;
    color: #fff;
    border-color: #0078d7;
}

/* Form bình luận */
.comment-form {
    background: #f8fbff;
    padding: 18px;
    border: 1px solid #d0e2ff;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    margin-top: 20px;
}

.comment-form textarea {
    width: 90%;
    min-height: 120px;
    resize: vertical;
    border: 1px solid #cfd8dc;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 1rem;
    background: #fff;
    color: #111;
    line-height: 1.5;
    margin-bottom: 10px;
    transition: border 0.2s ease;
}

.comment-form textarea:focus {
    border-color: #0078d7;
    outline: none;
}

.comment-form button {
    float: right;
    background: #0078d7;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.25s ease;
}

.comment-form button:hover {
    background: #005fa3;
}

.comment-form::after {
    content: "";
    display: block;
    clear: both;
}

/* Responsive */
@media (max-width: 768px) {
    .comment {
        padding: 12px;
    }

    .comment-form textarea {
        min-height: 90px;
    }
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 0.95rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
    text-align: center;
}

table th,
table td {
    padding: 12px 15px;
    /* Màu viền đã chỉnh: xanh nhạt, đồng bộ với giao diện */
    border: 1px solid #cce0f7;
    text-align: center;
}

table th {
    background-color: #e3eefe;
    color: #005fa3;
    text-align: left;
    font-weight: 700;
    text-align: center;
}

/* Tạo hiệu ứng hàng xen kẽ */
table tr:nth-child(even) td {
    background-color: #f8f9fc;
    text-align: center;
}

/* Hiệu ứng di chuột */
table tr:hover td {
    background-color: #eef2ff;
    text-align: center;
}

pre {
    background-color: #282c34;
    color: white;
    padding: 1em;
    border-radius: 8px;
}

:not(pre)>code {
    background-color: #e0e0e0;
    padding: 0.2em 0.4em;
    border-radius: 4px;
    font-size: 90%;
    color: #333;
}

@font-face {
    font-family: 'CASIO-CY-Display-Font';
    src: url('../fonts/CASIO-CY-Display-Font.ttf') format('truetype');
}

@font-face {
    font-family: 'CASIO-EY-Display-Font';
    src: url('../fonts/CASIO-EY-Display-Font.ttf') format('truetype');
}

@font-face {
    font-family: 'CASIOClassWiz';
    src: url('../fonts/CASIOClassWiz.woff2') format('truetype');
}

.key-fx580vnx {
    font-family: 'CASIOClassWiz';
    display: inline-block;
    font-size: 17px;
    line-height: 1.5;
    background: #f4f7fb;
    color: #111;
    border: 1px solid #ccd6dd;
    border-radius: 6px;
    padding: 4px 10px;
    margin: 4px 3px;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    max-width: 100%;
    box-sizing: border-box;
}


.key-fx580vnx::before {
    opacity: 0.6;
    font-size: 0.9em;
}

.font-fx580vnx {
    font-family: 'CASIO-CY-Display-Font';
    display: inline-block;
    font-size: 14px;
    line-height: 1.5;
    background: #f4f7fb;
    color: #111;
    border: 1px solid #ccd6dd;
    border-radius: 6px;
    padding: 4px 10px;
    margin: 4px 3px;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    width: 100%;
    box-sizing: border-box;
}


.key-fx580vnx::before {
    opacity: 0.6;
    font-size: 0.9em;
}