﻿/* =========================================
   GLOBAL & VARIABLES (Hiện đại hóa)
========================================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,300;14..32,400;14..32,500;14..32,600;14..32,700&display=swap');

:root {
    --primary: #004080;
    --primary-dark: #002b59;
    --primary-light: #1a5cb0;
    --secondary: #0ea5e9;
    --accent: #f59e0b;
    --white: #ffffff;
    --bg: #f8fafc;
    --text: #0f172a;
    --gray: #64748b;
    --border: #e2e8f0;
    --shadow-sm: 0 4px 6px -1px rgb(0 0 0 / 0.05);
    --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.08);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    --radius-md: 1rem;
    --radius-lg: 1.5rem;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Inter", system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* =========================================
   HEADER (Hiện đại, fixed, glassmorphism)
========================================= */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 99999;
}

/* TOP BAR */
.top-bar {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    height: 38px;
}

.top-content {
    max-width: 1300px;
    margin: auto;
    padding: 0 24px;
    height: 38px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.current-date {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--gray);
    letter-spacing: -0.01em;
}

.top-social {
    display: flex;
    gap: 1.2rem;
}

    .top-social a {
        color: var(--gray);
        transition: var(--transition);
        font-size: 0.9rem;
    }

        .top-social a:hover {
            color: var(--primary);
            transform: translateY(-2px);
        }

/* MAIN HEADER */
.main-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    height: 84px;
    box-shadow: var(--shadow-lg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-container {
    max-width: 1300px;
    margin: auto;
    padding: 0 24px;
    height: 84px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* LOGO */
.logo-wrapper {
    width: 210px;
    height: 70px;
    background: var(--white);
    border-radius: var(--radius-md);
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

    .logo-wrapper:hover {
        transform: translateY(-3px);
        box-shadow: var(--shadow-lg);
    }

    .logo-wrapper img {
        width: auto;
        max-width: 90%;
        max-height: 58px;
        object-fit: contain;
    }

/* MENU CHÍNH - GIÃN ĐỀU */
.main-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
    height: 84px;
}

    .main-nav > a,
    .menu-link {
        height: 84px;
        display: flex;
        align-items: center;
        color: var(--white);
        padding: 0 0.5rem;
        font-size: 0.95rem;
        font-weight: 600;
        transition: var(--transition);
        position: relative;
        white-space: nowrap;
        gap: 0.4rem;
        letter-spacing: -0.01em;
    }

        .menu-link i {
            font-size: 0.75rem;
            transition: transform 0.2s;
        }

.dropdown:hover .menu-link i {
    transform: rotate(180deg);
}

.main-nav > a:hover,
.menu-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #f0f9ff;
}

.main-nav .active::after {
    content: "";
    position: absolute;
    bottom: 18px;
    left: 20%;
    width: 60%;
    height: 3px;
    border-radius: 100px;
    background: var(--white);
    box-shadow: 0 0 6px rgba(255,255,255,0.6);
}

/* DROPDOWN HIỆN ĐẠI */
.dropdown {
    position: relative;
    height: 84px;
    display: flex;
    align-items: center;
}

    /* Tạo vùng đệm ảo nối liền link với menu */
    .dropdown::after {
        content: '';
        position: absolute;
        bottom: -15px;
        left: 0;
        width: 100%;
        height: 20px;
        background: transparent;
        pointer-events: auto;
    }

    .dropdown .menu-link {
        cursor: pointer;
    }

    .dropdown .dropdown-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        min-width: 250px;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(8px);
        border-radius: 1rem;
        box-shadow: var(--shadow-lg);
        padding: 0.6rem 0;
        margin-top: 0; /* Quan trọng: xóa margin-top */
        border: 1px solid rgba(255,255,255,0.3);
        z-index: 999999;
    }

    .dropdown:hover .dropdown-menu,
    .dropdown-menu:hover {
        display: block;
        animation: fadeInUp 0.2s ease;
    }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-menu li a {
    display: block;
    padding: 0.7rem 1.5rem;
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition);
    white-space: nowrap;
}

    .dropdown-menu li a:hover {
        background: rgba(0, 64, 128, 0.08);
        color: var(--primary);
        padding-left: 1.8rem;
    }

/* SEARCH BUTTON */
.search-btn {
    height: 84px;
    display: flex;
    align-items: center;
    padding: 0 0.5rem;
    color: var(--white);
    font-size: 1.2rem;
    transition: var(--transition);
    cursor: pointer;
}

    .search-btn:hover {
        background: rgba(255, 255, 255, 0.08);
        transform: scale(1.05);
    }

/* =========================================
   MAIN CONTENT
========================================= */
main {
    padding-top: 135px;
    min-height: calc(100vh - 135px);
}

.page-container {
    max-width: 1300px;
    margin: 2.5rem auto;
    padding: 0 24px;
}

.card-modern {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 1px solid var(--border);
}

    .card-modern:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-lg);
    }

/* =========================================
   FORM (Hiện đại)
========================================= */
.form-group {
    margin-bottom: 1.5rem;
}

    .form-group label {
        display: block;
        font-weight: 600;
        margin-bottom: 0.5rem;
        font-size: 0.9rem;
        color: var(--text);
    }

.form-control {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 0.8rem 1rem;
    font-size: 0.95rem;
    transition: var(--transition);
    background: var(--white);
}

    .form-control:focus {
        outline: none;
        border-color: var(--primary);
        box-shadow: 0 0 0 4px rgba(0, 64, 128, 0.1);
    }

textarea.form-control {
    min-height: 150px;
    resize: vertical;
}

/* BUTTON */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    color: var(--white);
    padding: 0.8rem 1.8rem;
    border-radius: 2rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

    .btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);
        filter: brightness(1.05);
    }

/* =========================================
   FOOTER (HIỆU ỨNG XANH LOANG - RADIAL GRADIENT)
========================================= */
.td-footer-wrapper {
    /* Hiệu ứng loang: kết hợp radial gradient + linear gradient */
    background: radial-gradient(circle at 10% 20%, #003b6f 0%, #002b55 40%, #001a33 80%, #00122a 100%), linear-gradient(125deg, #0a4c8a, #002855);
    background-blend-mode: overlay;
    font-family: 'Inter', system-ui, sans-serif;
    line-height: 1.5;
    margin-top: 5rem;
    padding: 3rem 0 2rem;
    color: #eef2ff;
    position: relative;
    border-top-left-radius: 2rem;
    border-top-right-radius: 2rem;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.1);
}

    /* Lớp phủ sóng nhẹ để tăng hiệu ứng loang */
    .td-footer-wrapper::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: repeating-radial-gradient(circle at 20% 40%, rgba(255, 255, 255, 0.03) 0px, rgba(255, 255, 255, 0.03) 2px, transparent 2px, transparent 8px);
        pointer-events: none;
        border-radius: inherit;
    }

.td-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 2;
}

.td-pb-row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -15px;
    margin-left: -15px;
}

.td-pb-span4 {
    width: 33.333%;
    padding: 0 15px;
}

.td-pb-span3 {
    width: 25%;
    padding: 0 15px;
}

.td-pb-span5 {
    width: 41.666%;
    padding: 0 15px;
}

/* Block title */
.td-block-title-wrap {
    margin-bottom: 1.5rem;
}

.td-block-title {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    margin: 0;
    color: var(--white);
    position: relative;
    display: inline-block;
    padding-bottom: 0.5rem;
}

    .td-block-title::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        width: 50px;
        height: 3px;
        background: var(--accent);
        border-radius: 100px;
    }

/* List bài viết */
.td_block_inner .td-block-span12 {
    margin-bottom: 1.8rem;
}

.td_module_6 {
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
}

    .td_module_6:hover {
        transform: translateX(6px);
    }

.td-module-thumb {
    flex-shrink: 0;
}

    .td-module-thumb img {
        width: 90px;
        height: 70px;
        border-radius: 0.75rem;
        object-fit: cover;
        transition: var(--transition);
        box-shadow: var(--shadow-sm);
    }

        .td-module-thumb img:hover {
            transform: scale(1.03);
            opacity: 0.9;
        }

.item-details h3 {
    font-size: 0.95rem;
    line-height: 1.4;
    margin: 0;
    font-weight: 600;
}

    .item-details h3 a {
        color: #f1f5f9;
        transition: var(--transition);
    }

        .item-details h3 a:hover {
            color: #facc15;
            text-decoration: none;
        }

/* Widget danh mục */
.widget_categories ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget_categories li {
    margin-bottom: 0.8rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

    .widget_categories li a {
        color: #f1f5f9;
        display: flex;
        justify-content: space-between;
        font-size: 0.9rem;
        transition: var(--transition);
    }

        .widget_categories li a:hover {
            color: #facc15;
            padding-left: 6px;
        }

.td-cat-no {
    color: rgba(255,255,255,0.6);
    font-size: 0.8rem;
}

/* Floating social icons */
.footer-social-floating {
    position: fixed;
    right: 24px;
    bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 9999;
}

    .footer-social-floating .social-icon {
        width: 48px;
        height: 48px;
        background: var(--white);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: var(--shadow-lg);
        transition: var(--transition);
    }

        .footer-social-floating .social-icon svg {
            width: 24px;
            height: 24px;
        }

        .footer-social-floating .social-icon:hover {
            transform: scale(1.1);
            background: #facc15;
        }

/* Footer bottom (logo + info + social) */
.td-footer-bottom-full {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.15);
}

.footer-logo-wrap img {
    max-width: 180px;
    background: var(--white);
    border-radius: 1rem;
    padding: 0.5rem 1rem;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

    .footer-logo-wrap img:hover {
        transform: scale(1.02);
    }

.footer-text-wrap {
    font-size: 0.85rem;
    line-height: 1.6;
    color: #e2e8f0;
}

    .footer-text-wrap .block-title {
        font-size: 1.2rem;
        font-weight: 700;
        margin-bottom: 1rem;
        color: var(--white);
    }

.footer-social-wrap .td-social-icon-wrap {
    display: inline-block;
    margin-right: 1rem;
}

    .footer-social-wrap .td-social-icon-wrap a {
        color: var(--white);
        font-size: 1.5rem;
        transition: var(--transition);
        display: inline-block;
    }

        .footer-social-wrap .td-social-icon-wrap a:hover {
            transform: translateY(-5px);
            color: #facc15;
        }

/* =========================================
   RESPONSIVE (Hiện đại, linh hoạt)
========================================= */
@media (max-width: 992px) {
    .main-nav {
        display: none;
        /* Bạn có thể thêm menu mobile nếu cần */
    }

    .td-pb-span4,
    .td-pb-span3,
    .td-pb-span5 {
        width: 100%;
        margin-bottom: 2rem;
    }

    .footer-social-floating {
        right: 16px;
        bottom: 16px;
    }

    main {
        padding-top: 120px;
    }

    .td_module_6 {
        flex-direction: row;
    }

    .td-module-thumb img {
        width: 80px;
        height: 60px;
    }
}

@media (max-width: 768px) {
    .header-container {
        padding: 0 16px;
    }

    .logo-wrapper {
        width: 160px;
        height: 55px;
    }

    .td-block-title {
        font-size: 1.1rem;
    }

    .td-footer-wrapper {
        border-top-left-radius: 1rem;
        border-top-right-radius: 1rem;
        padding: 2rem 0 1rem;
    }

    .footer-logo-wrap img {
        max-width: 140px;
    }

    .footer-social-floating .social-icon {
        width: 40px;
        height: 40px;
    }
}

/* =========================================
   Blazor ERROR UI
========================================= */
#blazor-error-ui {
    display: none !important;
}
