:root {
    /* Điều chỉnh bảng màu để hiện đại và 'tươi' hơn, lấy cảm hứng từ màu sắc iOS/macOS */
    --pastel-pink: #FF69B4; /* Deep Pink - Tươi hơn */
    --pastel-mint: #00C897; /* Mint - Rõ ràng hơn */
    --pastel-beige: #f0f2f5; /* Light Grey/Off-White - Nền nhẹ nhàng hơn */
    --pastel-lavender: #800080; /* Brighter Lavender */
    --text-dark: #1C1C1E; /* Gần với màu chữ hệ thống của iOS/macOS (Dark Mode) */
    --text-light: #fefefe;
    --card-background: rgba(255, 255, 255, 0.85); /* Hiệu ứng mờ (Glassmorphism Lite) */
    --shadow-light: 0 4px 12px rgba(0, 0, 0, 0.08); /* Shadow nhẹ, nhiều lớp */
    --shadow-hover: 0 8px 20px rgba(0, 0, 0, 0.12);
    --border-radius-large: 18px; /* Bo góc lớn hơn, mềm mại hơn */
    --border-radius-medium: 12px;
}

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

body {
    /* Sử dụng font hệ thống để có cảm giác iOS/macOS nhất */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    background-color: var(--pastel-beige);
    color: var(--text-dark);
    line-height: 1.6;
    /* Thêm hiệu ứng chống răng cưa cho text rõ ràng hơn */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header - Sử dụng hiệu ứng mờ (Frosted Glass/Acrylic) */
header {
    background: rgba(255, 255, 255, 0.7); /* Nền trắng trong suốt */
    backdrop-filter: blur(10px); /* Hiệu ứng mờ */
    -webkit-backdrop-filter: blur(10px);
    padding: 1rem 0;
    position: sticky; /* Sticky Header giống macOS */
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 0 rgba(0,0,0,0.05); /* Đường kẻ nhẹ thay vì bóng lớn */
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: background-color 0.3s ease;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ĐIỀU CHỈNH LOGO: Thêm hình ảnh 100x100px */
.logo {
    display: flex; /* Bật Flexbox để căn hàng ngang */
    align-items: center; /* Căn giữa dọc */
    gap: 15px; /* Khoảng cách giữa ảnh và chữ */
    font-size: 1.8rem;
    font-weight: 700; /* Dùng font weight đậm hơn */
    color: var(--text-dark);
}

.logo img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: var(--border-radius-medium); /* Bo góc nhẹ theo phong cách iOS/macOS */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Bóng mờ tinh tế */
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
	align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
    /* Transition cho màu sắc và hiệu ứng gạch chân mượt mà */
    transition: color 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.3s ease;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: var(--pastel-pink);
    transition: width 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), left 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.nav-links a:hover {
    color: var(--pastel-pink); /* Hover màu tươi */
}

.nav-links a:hover::after {
    width: 100%;
    left: 0;
}

/* Main content */
.main-content {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 2rem;
    margin: 2rem auto;
    max-width: 1200px;
    padding: 0 20px;
}

/* Posts */
.posts {
    display: grid;
    gap: 2rem;
}

.post-card {
    background: var(--card-background); /* Nền mờ */
    backdrop-filter: blur(5px);
    border-radius: var(--border-radius-large); /* Bo góc lớn */
    padding: 1.5rem;
    box-shadow: var(--shadow-light);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.post-card:hover {
    transform: translateY(-8px); /* Nhấc lên cao hơn */
    box-shadow: var(--shadow-hover);
}

.post-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: var(--border-radius-medium); /* Bo góc vừa */
    margin-bottom: 1rem;
}

.post-title {
    font-size: 1.6rem; /* Tăng kích thước font */
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    font-weight: 600;
}

.post-meta {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* Sidebar */
.sidebar {
    background: var(--card-background); /* Nền mờ */
    backdrop-filter: blur(5px);
    border-radius: var(--border-radius-large);
    padding: 1.5rem;
    box-shadow: var(--shadow-light);
}

.sidebar-section {
    margin-bottom: 2rem;
}

.sidebar-title {
    font-size: 1.3rem; /* Tăng kích thước font */
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--pastel-mint);
    font-weight: 600;
}

.category-list {
    list-style: none;
}

.category-list li {
    margin-bottom: 0.75rem; /* Tăng khoảng cách */
}

.category-list a {
    text-decoration: none;
    color: var(--text-dark);
    transition: color 0.3s ease, transform 0.3s ease;
    display: inline-block;
}

.category-list a:hover {
    color: var(--pastel-pink);
    transform: translateX(5px); /* Hiệu ứng dịch chuyển nhẹ */
}

/* Footer */
footer {
    background: var(--text-dark); /* Sử dụng màu tối cho sự tương phản */
    color: var(--text-light);
    text-align: center;
    padding: 2.5rem 0; /* Tăng padding */
    margin-top: 3rem;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

/* Forms - Nâng cấp nút và trường nhập */
.form-group {
    margin-bottom: 1.2rem;
}

.form-control {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius-medium);
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
    border-color: var(--pastel-pink);
    box-shadow: 0 0 0 3px rgba(255, 105, 180, 0.2); /* Shadow focus tinh tế */
    outline: none;
}

.btn {
    padding: 0.75rem 1.8rem; /* Tăng padding nút */
    border: none;
    border-radius: var(--border-radius-medium);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94); /* Chuyển động mượt */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background: var(--pastel-pink);
    color: var(--text-light); /* Chữ màu sáng trên nền đậm */
}

.btn-primary:hover {
    background: #e05e9e; /* Tối hơn một chút khi hover */
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* Admin styles */
.admin-header {
    background: linear-gradient(135deg, var(--pastel-mint), #00A68A); /* Màu admin rõ ràng */
    padding: 1rem 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* ĐIỀU CHỈNH DASHBOARD-STATS: SỬ DỤNG FLEXBOX ĐỂ ĐẢM BẢO LUÔN CÙNG HÀNG TRÊN MÀN HÌNH LỚN */
.dashboard-stats {
    display: flex; /* Dùng flexbox thay vì grid */
    gap: 1.5rem;
    margin-bottom: 2rem;
    /* Cho phép các thẻ gói xuống hàng nếu không đủ chỗ */
    flex-wrap: wrap; 
    /* Đảm bảo mỗi thẻ chiếm 1/4 nếu có 4 thẻ, nhưng sẽ thu gọn nếu cần */
    justify-content: space-between;
}

.stat-card {
    /* Đảm bảo mỗi thẻ chiếm không gian hợp lý, ví dụ: khoảng 22% đến 24% cho 4 thẻ */
    flex: 1 1 22%; 
    min-width: 150px; /* Chiều rộng tối thiểu để thẻ không quá nhỏ */

    background: var(--card-background);
    border-radius: var(--border-radius-large);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-light);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: scale(1.03); /* Phóng to nhẹ khi hover */
}

.stat-number {
    font-size: 2.5rem; /* Tăng kích thước */
    font-weight: 700;
    color: var(--pastel-pink);
    margin-bottom: 0.5rem;
}

.table {
    width: 100%;
    background: white;
    border-radius: var(--border-radius-large);
    overflow: hidden;
    box-shadow: var(--shadow-light);
}

.table th,
.table td {
    padding: 1rem 1.2rem;
    text-align: left;
    border-bottom: 1px solid #f0f0f0; /* Đường kẻ nhẹ */
}

.table th {
    background: #e6f7ff; /* Màu xanh nhạt */
    color: var(--text-dark);
    font-weight: 600;
}

.table tr:last-child td {
    border-bottom: none;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
    gap: 0.75rem; /* Tăng khoảng cách */
}

.pagination a, .pagination span {
    padding: 0.7rem 1.2rem; /* Tăng padding */
    border: 1px solid #ddd;
    border-radius: var(--border-radius-medium);
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: all 0.3s ease;
}

.pagination a:hover {
    background: var(--pastel-pink);
    color: var(--text-light);
    border-color: var(--pastel-pink);
    transform: translateY(-2px);
}

.pagination .current {
    background: var(--pastel-mint);
    border-color: var(--pastel-mint);
    color: var(--text-light);
    font-weight: 600;
}

/* Search Form */
.search-form {
    display: flex;
    margin: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05); /* Shadow nhẹ cho input search */
    border-radius: var(--border-radius-medium);
    overflow: hidden;
}

.search-form input {
    flex: 1;
    border-radius: 0; /* Bo góc đã được kiểm soát bởi div cha */
    border: none;
    padding: 0.8rem 1rem;
}

.search-form button {
    border-radius: 0;
    padding: 0.75rem 1.2rem;
}

/* Comments */
.comments-section {
    margin-top: 3rem;
}

.comment {
    background: var(--card-background);
    border-radius: var(--border-radius-medium);
    padding: 1.2rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

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

.comment-author {
    font-weight: 600;
    color: var(--pastel-pink);
}

.comment-date {
    color: #888;
    font-size: 0.9rem;
}

.comment-form {
    background: var(--card-background);
    border-radius: var(--border-radius-medium);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-light);
}

/* Single Post */
.single-post {
    background: var(--card-background);
    border-radius: var(--border-radius-large);
    padding: 2.5rem; /* Tăng padding */
    box-shadow: var(--shadow-light);
    margin-bottom: 2rem;
}

.post-content {
    line-height: 1.8;
    margin: 1.5rem 0;
    font-size: 1.05rem; /* Tăng kích thước font nội dung */
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius-medium);
    margin: 1.5rem 0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1); /* Shadow nhẹ cho ảnh */
}

/* Admin Comments */
.comment-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.status-approved { background: #d4edda; color: #155724; border-radius: 5px; padding: 0.3rem 0.6rem; font-size: 0.85rem; font-weight: 500; }
.status-pending { background: #fff3cd; color: #856404; border-radius: 5px; padding: 0.3rem 0.6rem; font-size: 0.85rem; font-weight: 500; }
.status-spam { background: #f8d7da; color: #721c24; border-radius: 5px; padding: 0.3rem 0.6rem; font-size: 0.85rem; font-weight: 500; }

/* Responsive */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .nav-links {
        flex-direction: column;
        gap: 1rem;
        /* Thêm toggle menu cho mobile nếu cần HTML/JS */
    }
    
    /* TRÊN MOBILE: Cho phép các thẻ dashboard xếp lại thành 2 cột */
    .dashboard-stats {
        /* Chuyển lại về grid hoặc sử dụng flex-basis 48% */
        display: grid; 
        grid-template-columns: 1fr 1fr; 
        gap: 1rem;
    }

    .stat-card {
        flex: unset; /* Bỏ thuộc tính flex để grid hoạt động */
        min-width: unset;
    }

    /* Đảm bảo sidebar không bị thu nhỏ quá */
    .sidebar {
        margin-top: 1.5rem;
    }
    
    /* Giảm kích thước logo trên thiết bị di động */
    .logo img {
        width: 60px;
        height: 60px;
    }

    header {
        position: static; /* Bỏ sticky header trên mobile */
    }
}

/* Embedded content styles - Giữ nguyên các quy tắc cho admin/embedded */
#admin-content .admin-main {
    margin-top: 0;
    padding-top: 0;
}

#admin-content .container.admin-main {
    padding: 0;
}

#admin-content h1 {
    margin-top: 0;
    padding-top: 0;
}

/* Ensure proper spacing in embedded mode */
#admin-content .table {
    margin-bottom: 2rem;
}

/* About & Contact pages */
.contact-info {
    background: var(--card-background); /* Nền mờ */
    border-left: 5px solid var(--pastel-mint);
    padding: 1.5rem;
    border-radius: var(--border-radius-medium);
    margin: 1.5rem 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.faq-item {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #eee;
}

.faq-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1.5rem;
    margin: 1rem 0;
}

.stat-item {
    text-align: center;
    padding: 1.5rem;
    border-radius: var(--border-radius-medium);
    background: var(--card-background);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    font-weight: 500;
}

/* Social links */
.social-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.social-link {
    display: inline-block;
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    border-radius: 50%; /* Tròn hoàn hảo */
    color: var(--text-light);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.3s ease;
}

.social-link:hover {
    transform: translateY(-4px) scale(1.1); /* Hiệu ứng nhấc/phóng to rõ ràng */
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

/* Tùy chỉnh màu Social Link theo thương hiệu */
.social-link.facebook { background-color: #3b5998; }
.social-link.twitter { background-color: #00acee; }
.social-link.instagram { background-color: #C13584; }
.social-link.linkedin { background-color: #0077B5; }

/* Dropdown Menu */
.dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    padding: 0.5rem 0;
    transition: color var(--transition-duration), transform var(--transition-duration);
}

.dropdown-toggle svg {
    margin-left: 5px;
    transition: transform var(--transition-duration);
}

.dropdown-toggle.active svg {
    transform: rotate(180deg);
}

.dropdown-toggle:hover,
.dropdown-toggle:focus,
.dropdown-toggle.active {
    color: var(--pastel-pink);
    transform: translateY(-2px);
}

.dropdown-menu {
    display: none !important;
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 4px 12px var(--shadow-color);
    min-width: 200px;
    padding: 0.5rem 0;
    z-index: 1000;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity var(--transition-duration) ease-out, transform var(--transition-duration) ease-out;
    pointer-events: none; /* Không nhận touch ban đầu */
}

.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu,
.dropdown.active .dropdown-menu {
    display: block !important;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto; /* Enable touch khi active */
}

.dropdown-menu li {
    list-style: none;
    display: block;
}

.dropdown-menu a {
    display: block !important;
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 400;
    transition: color var(--transition-duration), background var(--transition-duration);
}

.dropdown-menu a:hover,
.dropdown-menu a:focus {
    color: var(--pastel-pink);
    background: rgba(255, 105, 180, 0.1);
}

/* Responsive Dropdown */
@media (max-width: 768px) {
    .nav-links {
        flex-direction: column;
        gap: 1rem;
    }

    .dropdown {
        width: 100%;
    }

    .dropdown-menu {
        display: none !important;
        position: static;
        width: 100%;
        background: rgba(255, 255, 255, 0.9);
        border-radius: 8px;
        margin-top: 0.5rem;
        box-shadow: none;
        pointer-events: none; /* Không nhận touch ban đầu trên mobile */
    }

    .dropdown.active .dropdown-menu {
        display: block !important;
        transform: none;
        opacity: 1;
        pointer-events: auto; /* Enable khi active */
    }
}