/* --- 1. SETUP HỆ THỐNG (SWISS STYLE) --- */
:root {
    --bg: #ffffff;
    --text: #111111;
    --accent: #E62117; /* Đỏ Swiss - thay cho màu nâu cũ */
    --gray-light: #f5f5f7;
    --gray-medium: #86868b;
    --border: #e5e5e5;
    --font-main: 'Inter', 'Noto Sans JP', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden; /* Chặn tràn ngang tuyệt đối */
    /* Kỹ thuật: Đây là "chốt chặn cuối cùng". Đôi khi một tấm ảnh hoặc một dòng chữ quá dài */
    /* sẽ đẩy chiều ngang web vượt quá màn hình điện thoại, tạo ra khoảng trắng thừa bên phải */
    /* và gây lỗi cuộn ngang. Ưu tiên Max-width : 100% */
}

.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

/* --- 2. HEADER & BRANDING (MINIMAL) --- */
header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 99999 !important;
    padding: 15px 0;
}

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

.brand {
    font-size: 24px;
    font-weight: 700;
    text-decoration: none;
    color: var(--text);
    letter-spacing: -1px;
}
.brand span { color: var(--accent); }

/* Nút ngôn ngữ - Đồng bộ về dạng Minimal */
.lang-btn-real {
    background: none;
    border: 1px solid var(--text);
    color: var(--text);
    width: 35px;
    height: 35px;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
}
.lang-btn-real.active, .lang-btn-real:hover {
    background: var(--text);
    color: var(--white);
}

/* --- 3. NAVIGATION (CLEAN & FLEXIBLE) --- */
nav { background: none; box-shadow: none; }

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-menu a {
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding-bottom: 5px;
    transition: 0.3s;
}

.nav-menu a:hover, .nav-menu a.active {
    color: var(--accent);
    border-bottom: 2px solid var(--accent);
}

/* --- 4. TRANG KIẾN THỨC (ARTICLE, BRSE, BLOG) --- */
.content h1 {
    font-size: clamp(32px, 8vw, 64px); /* Tự co giãn trên Mobile */
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -2px;
    margin: 40px 0 20px;
}

.content h2 {
    font-size: 24px;
    color: var(--text);
    margin: 40px 0 20px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
}

/* Card bài viết phong cách Swiss */
.card {
    background: var(--gray-light);
    border-left: none; /* Bỏ viền cũ */
    padding: 30px;
    margin: 20px 0;
    transition: 0.3s;
    border: 1px solid transparent;
}
.card:hover {
    background: #fff;
    border-color: var(--accent);
    transform: translateY(-5px);
}

/* --- 5. NHK VOCAB & TOOLTIP (TỔI ƯU TỪ BẢN CŨ) --- */
.nhk-vocab {
    color: var(--accent);
    border-bottom: 1px dashed var(--accent);
    cursor: help;
    font-weight: 600;
}

/* Tooltip Mobile Friendly 100% */
@media (max-width: 768px) {
    .nhk-vocab:hover::after {
        position: fixed;
        bottom: 20px;
        left: 5%;
        width: 90%;
        background: var(--text);
        color: white;
        padding: 15px;
        font-size: 14px;
        border-radius: 4px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.2);
        z-index: 100000;
        pointer-events: none;
    }
}

/* --- 6. CODE BLOCK (DARK & CLEAN) --- */
pre {
    background-color: #1a1a1a;
    color: #f8f8f8;
    padding: 20px;
    border-radius: 4px;
    font-size: 14px;
    border: none;
    box-shadow: none;
}

.main-wrapper {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.main-wrapper.switching-lang {
    opacity: 0;
    transform: translateY(5px); /* Hiệu ứng trượt nhẹ đúng chất Swiss */
}

/* About Page Specific */
.lead-text {
    font-size: 1.25rem;
    color: var(--gray-medium);
    margin-bottom: 40px;
    max-width: 800px;
}

.skill-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
}

.skill-list li {
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 500;
}

.content-fade {
    animation: fadeIn 0.6s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Blog Specific Styles */
.blog-header {
    margin-bottom: 50px;
    border-bottom: 2px solid var(--text);
    padding-bottom: 20px;
}

.blog-card {
    border: 1px solid var(--border);
    padding: 30px;
    margin-bottom: 30px;
    background: #fff;
    transition: 0.3s ease;
}

.blog-card:hover {
    border-color: var(--accent);
    transform: translateY(-5px);
}

.blog-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.tag {
    background: var(--text);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.blog-date {
    color: var(--gray-medium);
    margin-left: auto; /* Đẩy ngày đăng sang bên phải */
    font-size: 12px;
}

.read-more {
    display: inline-block;
    margin-top: 15px;
    color: var(--accent);
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
}

/* Style cho Grammar Card tối giản */
.grammar-card {
    transition: transform 0.2s ease;
    border-left: 4px solid #583714 !important;
    background: #fffef2;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px; /* Bo góc nhẹ theo style Swiss */
}

/* Hiệu ứng khi nhấn trên điện thoại */
.grammar-card:active {
    transform: scale(0.98);
    background: #fdfae6;
}

/* Tooltip trên mobile (Dùng data-tip của Huy) */
.nhk-vocab {
    border-bottom: 1px dashed #d4a017;
    cursor: help;
    position: relative;
}

/* --- 7. MOBILE RESPONSIVE CHỐNG TRÀN --- */
@media screen and (max-width: 768px) {
    .container { padding: 0 20px; }
    
    .header-content { flex-direction: column; gap: 15px; }
    
    .nav-menu {
        width: 100%;
        justify-content: center;
        gap: 15px;
    }
    
    .nav-menu a { font-size: 12px; }
    
    /* Chống tràn cho Article BrSE */
    .swiss-grid {
        display: grid;
        grid-template-columns: 1fr; /* 1 cột duy nhất trên mobile */
        gap: 15px;
    }
}

/* --- 8. LOADER (CHỐNG NHÁY TRANG) --- */
#page-loader {
    position: fixed; inset: 0; background: white; z-index: 999999;
    transition: opacity 0.5s ease;
}
body.loaded #page-loader { opacity: 0; pointer-events: none; }