@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;600;800&family=Roboto:wght@300;400;500;700&display=swap');

:root {
    --primary-grad: linear-gradient(135deg, #0062ff 0%, #00d4ff 100%);
    --admin-grad: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    --accent-grad: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    --success-grad: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --bg-light: #f8fafc;
    --white: #ffffff;
    --text-dark: #1e293b;
    --text-gray: #64748b;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.1);
    --radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, .font-title { font-family: 'Montserrat', sans-serif; font-weight: 700; }

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex; align-items: center; gap: 8px;
}
.btn-primary { background: var(--primary-grad); color: white; }
.btn-danger { background: #ef4444; color: white; }
.btn-success { background: var(--success-grad); color: white; }
/* --- 1. GLASSMORPHISM HEADER & NAVIGATION --- */
.glass-header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    padding: 10px 25px;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 10000;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.5);
}

.header-left { display: flex; align-items: center; gap: 15px; }
.header-logo {
    width: 48px; height: 48px; border-radius: 12px; overflow: hidden; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.08); background: white;
}
.header-logo img { width: 100%; height: 100%; object-fit: cover; }

.header-titles { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.title-top { font-size: 0.75rem; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 2px; }
.title-bottom { font-size: 1.15rem; font-weight: 900; color: #0062ff; letter-spacing: 4px; margin-left: 4px; line-height: 1; }

.header-right { display: flex; align-items: center; gap: 20px; }
.nav-links { display: flex; gap: 10px; align-items: center; }
.nav-links a { text-decoration: none; color: #475569; font-weight: 600; font-size: 0.9rem; padding: 8px 15px; border-radius: 10px; transition: 0.3s; }
.nav-links a:hover, .nav-links a.active { background: #f1f5f9; color: #0062ff; }
.nav-divider { width: 1px; height: 18px; background: #cbd5e1; }

.user-profile {
    display: none; align-items: center; gap: 10px; background: #f8fafc; 
    padding: 5px 15px 5px 5px; border-radius: 30px; border: 1px solid #e2e8f0;
}
.user-profile img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.user-name { font-size: 0.85rem; font-weight: 700; color: #1e293b; }

.page-has-header { padding-top: 85px; }

/* --- 2. HEADER & BANNER HERO CŨ --- */
.main-header {
    background: var(--primary-grad);
    color: white;
    padding: 100px 20px;
    text-align: center;
    position: relative;
    clip-path: polygon(0 0, 100% 0, 100% 85%, 0% 100%);
    z-index: 1;
}
.main-header h1 { font-size: 2.5rem; margin-bottom: 15px; letter-spacing: -1px; }
.main-header p { font-size: 1.2rem; opacity: 0.9; font-weight: 300; }

/* --- 3. SLIDER THÔNG BÁO --- */
.announcement-slider {
    max-width: 1100px;
    margin: 85px auto 40px !important;
    background: white;
    height: 400px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
    z-index: 10;
}

.slide-item {
    position: absolute;
    width: 100%; height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: 0.8s ease-in-out;
    background-size: cover;
    background-position: center;
}
.slide-item.active { opacity: 1; visibility: visible; }

.slide-content {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 60px 40px 40px;
    background: linear-gradient(transparent, rgba(0,0,0,0.9));
    color: white;
}

/* --- 4. DANH SÁCH BÀI VIẾT / BÀI ĐĂNG (POST CARDS) --- */
.post-card {
    background: white; 
    border-radius: 15px; 
    overflow: hidden; 
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.post-card-img {
    width: 100%; 
    height: 200px; 
    object-fit: cover;
}

.post-card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.post-card-title {
    font-size: 1.05rem; 
    line-height: 1.4;
    height: 2.8em; 
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-desc {
    color: var(--text-gray); 
    font-size: 0.85rem; 
    line-height: 1.5;
    height: 3em; 
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2; 
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-btn {
    margin-top: auto; 
    width: 100%; 
    justify-content: center; 
    text-decoration: none;
}

/* --- 5. MODAL XEM BÀI VIẾT --- */
.modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.9);
    display: none; z-index: 1000;
    justify-content: center; align-items: center;
    padding: 20px;
}

.modal-content {
    background: white; width: 100%; max-width: 900px;
    max-height: 90vh; border-radius: 20px; overflow-y: auto;
    position: relative; padding: 40px;
}

#modal-body-content {
    white-space: pre-line;
    word-wrap: break-word;
}

#modal-body-content iframe {
    max-width: 100%;
    border-radius: 10px;
    margin: 15px 0;
    display: block;
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn 0.6s ease forwards; }

/* --- 6. FOOTER & THỐNG KÊ TRUY CẬP --- */
.footer {
    background: #0f172a;
    color: white;
    padding: 80px 20px 40px;
    text-align: center;
    margin-top: 100px;
}

.footer .designer-tag {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 25px;
    background: var(--primary-grad);
    border-radius: 50px;
    font-weight: 800;
    letter-spacing: 1px;
}

.visit-stats {
    margin-top: 30px;
    padding: 15px;
    text-align: center;
    background: #fff;
    border-radius: 8px;
    border: 1px dashed #ccc;
    color: #555;
    font-size: 0.9rem;
}

#visit-count {
    color: var(--primary, #0062ff);
    font-size: 1.1rem;
}

/* --- 7. VTS HEALTH AI CHATBOT BUBBLE --- */
.chat-bot-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: var(--primary-grad);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    box-shadow: 0 10px 20px rgba(0, 98, 255, 0.4);
    cursor: pointer;
    z-index: 9999;
    border: none;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.chat-bot-btn:hover { transform: scale(1.1); }

.chat-window {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    z-index: 9998;
    overflow: hidden;
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
}
.chat-window.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
}

.chat-header {
    background: var(--primary-grad);
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.chat-header h3 { font-size: 1.1rem; margin: 0; }
.chat-header p { font-size: 0.8rem; margin: 0; opacity: 0.8; }

.chat-body {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-msg {
    max-width: 85%;
    padding: 10px 15px;
    border-radius: 15px;
    font-size: 0.95rem;
    line-height: 1.4;
    word-wrap: break-word;
}
.chat-msg.bot {
    background: white;
    color: var(--text-dark);
    border: 1px solid #e2e8f0;
    align-self: flex-start;
    border-bottom-left-radius: 5px;
}
.chat-msg.user {
    background: #0062ff;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 5px;
}

.chat-footer {
    padding: 15px;
    background: white;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 10px;
}
.chat-footer input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    outline: none;
}
.chat-footer button {
    background: #10b981;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
}

/* --- 8. RESPONSIVE DÀNH RIÊNG CHO TRANG CHỦ & MOBILE --- */
@media screen and (max-width: 900px) {
    .nav-links a i { margin-right: 0; }
    .nav-links a { font-size: 0.85rem; padding: 8px 10px; }
}

@media screen and (max-width: 768px) {
    /* Main Header & Slider */
    .main-header { padding: 40px 20px; }
    .slider-container, .swiper-container { height: 200px !important; }
    
    /* Header Glassmorphism Mobile */
    .page-has-header { padding-top: 105px; } 
    .glass-header { flex-direction: column; align-items: flex-start; padding: 10px 15px; gap: 12px; }
    .header-left { gap: 10px; }
    .header-logo { width: 36px; height: 36px; border-radius: 8px; flex-shrink: 0; }
    .header-titles { align-items: flex-start; }
    .title-top { font-size: 0.6rem; letter-spacing: 0; white-space: nowrap; }
    .title-bottom { font-size: 0.95rem; letter-spacing: 1px; margin-left: 0; white-space: nowrap; }

    .user-profile { 
        position: absolute; top: 12px; right: 15px; 
        padding: 4px 10px 4px 4px; gap: 6px;
    }
    .user-profile img { width: 28px; height: 28px; }
    .user-name { font-size: 0.75rem; max-width: 70px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

    .header-right { width: 100%; gap: 0; }
    .nav-links { 
        width: 100%; display: flex; gap: 8px; 
        overflow-x: auto; padding-bottom: 5px; scrollbar-width: none; 
    }
    .nav-links::-webkit-scrollbar { display: none; }
    
    .nav-links a { 
        display: flex; align-items: center; gap: 5px;
        font-size: 0.8rem; padding: 6px 14px; white-space: nowrap; 
        background: #f1f5f9; border-radius: 20px;
    }
    .nav-links a.active { background: #e0e7ff; color: #0062ff; font-weight: 700; }
    .nav-divider { display: none; }

    .announcement-slider { margin-top: 110px !important; height: 220px !important; }
    .slide-content { padding: 30px 20px 20px !important; }
    .slide-content h2 { font-size: 1.3rem !important; margin-bottom: 5px; }
    .slide-content .btn { padding: 6px 15px !important; font-size: 0.8rem !important; margin-top: 8px !important; }

    /* Post Cards Mobile */
    #pinned-grid, #main-grid {
        grid-template-columns: repeat(2, 1fr) !important; 
        gap: 12px !important;
    }
    .post-card-img { height: 120px !important; }
    .post-card-body { padding: 10px !important; }
    .post-card-title { font-size: 0.85rem !important; line-height: 1.4 !important; height: 2.8em !important; }
    .post-card-desc { font-size: 0.75rem !important; line-height: 1.4 !important; height: 2.8em !important; margin-bottom: 12px !important; }
    .post-card-btn { padding: 6px 5px !important; font-size: 0.75rem !important; border-radius: 8px !important; }

    .chat-window { 
        width: 90%; 
        right: 5%; 
        bottom: 90px; 
        height: 450px;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .chat-footer input {
        font-size: 16px !important;
    }

    .chat-window.chat-focused {
        position: fixed !important;
        top: 10px !important;
        bottom: 10px !important;
        left: 10px !important;
        right: 10px !important;
        width: calc(100% - 20px) !important;
        height: calc(100dvh - 20px) !important;
        transform: scale(1.02) !important;
        z-index: 99999 !important;
    }
}

.search-box-container {
    background: white;
    padding: 5px 5px 5px 20px; 
    border-radius: 50px;
    display: flex;
    gap: 10px;
    align-items: center;
    box-shadow: var(--shadow-sm);
    margin-bottom: 40px;
    border: 1px solid #e2e8f0;
    transition: var(--transition);
    overflow: hidden;
}

.search-box-container:focus-within {
    border-color: #0062ff;
    box-shadow: 0 4px 20px rgba(0, 98, 255, 0.15);
}

.search-box-container .search-icon {
    color: var(--text-gray);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.search-box-container input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    font-size: 0.95rem;
    background: transparent;
    color: var(--text-dark);
}

.search-box-container .search-btn {
    border-radius: 40px; 
    padding: 10px 22px;
    white-space: nowrap;
    font-size: 0.9rem;
    flex-shrink: 0; 
    box-shadow: none; 
}

@media (max-width: 600px) {
    .search-box-container {
        padding: 4px 4px 4px 12px;
    }
    .search-box-container .search-btn {
        padding: 8px 14px;
        font-size: 0.85rem;
    }
}
