/* ==========================================
   TỐI ƯU HÓA PHÔNG CHỮ (TYPOGRAPHY TOÀN HỆ THỐNG)
   ========================================== */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --primary: #10b981;
    --text-dark: #1e293b;
    --border: #cbd5e1;
    --bg-light: #f8fafc;
}

/* Tối ưu độ nét và khoảng cách chữ cho Body */
html, body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-size: 15px;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

/* Áp dụng phông chữ chính cho văn bản (Đã sửa lỗi xung đột Icon FontAwesome) */
*, input, button, textarea, select, table, th, td, a {
    box-sizing: border-box;
}

body, input, button, textarea, select, a, p, span, h1, h2, h3, h4, h5, h6, table {
    font-family: var(--font-main);
}

/* Tiêu đề */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.02em; 
    line-height: 1.3;
    color: #0f172a;
}

/* Bảng Admin */
.table th {
    font-size: 0.85rem;
    letter-spacing: 0.03em;
}
.table td {
    font-size: 0.95rem;
}

/* ==========================================
   HEADER, LOGO & NAVIGATION (DESKTOP)
   ========================================== */
.navbar {
    background-color: #ffffff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 15px;
}

/* --- LOGO --- */
.logo {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    text-decoration: none !important;
}

.logo-img {
    height: 50px;
    width: auto;
    object-fit: contain;
    border-radius: 50%;
}

.logo-text {
    font-size: 1.2rem;
    font-weight: 800 !important;
    color: var(--primary) !important;
    text-decoration: none !important;
    white-space: nowrap;
}

/* --- MENU --- */
.nav-menu {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    position: relative;
    padding-bottom: 4px;
    transition: color 0.3s ease;
}

.nav-menu a:hover {
    color: var(--primary);
}

.nav-menu a.active {
    color: var(--primary);
    font-weight: 700;
}

.nav-menu a.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary);
    border-radius: 4px;
}

/* Nút Menu Hamburger (Mặc định ẩn trên máy tính) */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #1e293b;
    cursor: pointer;
    padding: 5px;
}

/* ==========================================
   TỐI ƯU HÓA GIAO DIỆN FORM NHẬP LIỆU
   ========================================== */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block !important;
    margin-bottom: 0.5rem !important;
    font-weight: 600 !important;
    color: var(--text-dark) !important;
    font-size: 0.95rem !important;
}

.form-group input[type="text"], 
.form-group input[type="password"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="number"],
.form-group textarea {
    display: block !important;
    width: 100% !important;
    padding: 12px 16px !important;
    border: 1.5px solid var(--border) !important;
    border-radius: 10px !important;
    font-family: inherit !important;
    font-size: 1rem !important;
    background-color: var(--bg-light) !important;
    color: var(--text-dark) !important;
    transition: all 0.3s ease !important;
}

.form-group input::placeholder, 
.form-group textarea::placeholder {
    color: #94a3b8 !important;
}

.form-group input:focus, 
.form-group textarea:focus {
    outline: none !important;
    border-color: var(--primary) !important;
    background-color: #ffffff !important;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15) !important;
}

.form-group input[type="file"] {
    display: block !important;
    width: 100% !important;
    padding: 12px !important;
    border: 1.5px dashed var(--border) !important;
    border-radius: 10px !important;
    background-color: var(--bg-light) !important;
    cursor: pointer !important;
    color: #64748b !important;
}

.form-row {
    display: flex;
    gap: 1.5rem;
    width: 100%;
}

/* ==========================================
   TỐI ƯU HÓA RESPONSIVE (TABLET VÀ MOBILE)
   ========================================== */

/* Tablet lớn (iPad) - 1025px trở xuống */
@media (max-width: 1024px) {
    .navbar .container {
        padding: 10px 12px;
    }
    
    .logo-text {
        font-size: 1.1rem !important;
    }
    
    .nav-menu {
        gap: 1rem;
    }
}

/* Tablet nhỏ & Mobile trung bình - 768px trở xuống */
@media (max-width: 768px) {
    /* Hiển thị nút Hamburger */
    .menu-toggle {
        display: block;
        font-size: 1.3rem;
    }

    /* Logo Mobile */
    .logo-img {
        height: 40px !important;
    }
    .logo-text {
        font-size: 1rem !important;
    }

    /* Đổi Header Menu thành dạng dọc (Dropdown) */
    .nav-menu {
        display: none; 
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: #ffffff;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
        padding: 0;
        z-index: 999;
        gap: 0;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu li {
        width: 100%;
        text-align: center;
    }

    .nav-menu a {
        display: block;
        padding: 15px 20px;
        border-bottom: 1px solid #f1f5f9;
        font-size: 0.95rem;
    }
    
    .nav-menu a.active::after {
        display: none;
    }

    /* Form Responsive */
    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .form-group {
        margin-bottom: 1.2rem;
    }

    /* Footer Mobile Fix */
    .footer {
        padding: 2rem 15px !important; 
    }
    
    .footer-content {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    /* Tương thích font size để không quá lớn trên mobile */
    html, body {
        font-size: 14px;
    }

    h1 {
        font-size: 1.8rem !important;
    }

    h2 {
        font-size: 1.5rem !important;
    }

    h3 {
        font-size: 1.2rem !important;
    }

    p {
        font-size: 0.95rem;
    }
}

/* Mobile nhỏ - 640px trở xuống */
@media (max-width: 640px) {
    .navbar .container {
        padding: 8px 10px;
    }

    .logo-img {
        height: 38px !important;
    }

    .logo-text {
        font-size: 0.9rem !important;
    }

    .menu-toggle {
        font-size: 1.2rem;
    }

    html, body {
        font-size: 13px;
    }

    h1 {
        font-size: 1.5rem !important;
    }

    h2 {
        font-size: 1.3rem !important;
    }

    h3 {
        font-size: 1.1rem !important;
    }

    .form-group {
        margin-bottom: 1rem;
    }

    .form-group input, 
    .form-group textarea {
        padding: 10px 14px !important;
        font-size: 0.9rem !important;
    }

    .form-group label {
        font-size: 0.9rem !important;
    }
}

/* Điện thoại rất nhỏ - 480px trở xuống */
@media (max-width: 480px) {
    .logo-text {
        display: none; /* Ẩn tên trên màn hình rất nhỏ */
    }

    .logo-img {
        height: 35px !important;
    }

    .menu-toggle {
        font-size: 1.1rem;
    }

    html, body {
        font-size: 12px;
    }

    h1 {
        font-size: 1.3rem !important;
    }

    h2 {
        font-size: 1.1rem !important;
    }

    h3 {
        font-size: 1rem !important;
    }

    p {
        font-size: 0.85rem;
        line-height: 1.5;
    }

    .navbar .container {
        padding: 8px 8px;
    }

    .form-group {
        margin-bottom: 0.8rem;
    }

    .form-group input, 
    .form-group textarea {
        padding: 8px 12px !important;
        font-size: 0.85rem !important;
        border-radius: 8px !important;
    }

    .form-group label {
        font-size: 0.85rem !important;
        margin-bottom: 0.3rem !important;
    }
}