/* ===========================
   GLOBAL STYLES
   (variables, reset, base layout, header, footer, helpers)
   =========================== */

:root {
    /* Colors */
    --primary: #1e40af;
    --primary-dark: #1e3a8a;
    --primary-light: #3b82f6;
    --secondary: #0891b2;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #ea580c;
    --info: #0284c7;

    /* Neutrals */
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --spacing-3xl: 4rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);

    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-base: 200ms ease-in-out;
    --transition-slow: 300ms ease-in-out;

    /* Body background */
    --body-bg-start: #f0f9ff;
    --body-bg-end: #f5f3ff;
}

/* ===========================
   DARK THEME
   =========================== */

:root[data-theme="dark"] {
    --primary: #3b82f6;
    --primary-dark: #60a5fa;
    --primary-light: #93c5fd;
    --secondary: #22d3ee;
    --success: #4ade80;
    --danger: #f87171;
    --warning: #fb923c;
    --info: #38bdf8;

    --white: #1e293b;
    --gray-50: #0f172a;
    --gray-100: #1e293b;
    --gray-200: #334155;
    --gray-300: #475569;
    --gray-400: #64748b;
    --gray-500: #94a3b8;
    --gray-600: #cbd5e1;
    --gray-700: #e2e8f0;
    --gray-800: #f1f5f9;
    --gray-900: #f8fafc;

    --body-bg-start: #0b1220;
    --body-bg-end: #161329;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Be Vietnam Pro', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--gray-900);
    background: linear-gradient(135deg, var(--body-bg-start) 0%, var(--body-bg-end) 100%);
    min-height: 100vh;
    transition: background var(--transition-slow), color var(--transition-slow);
}

/* ===========================
   CONTAINER & LAYOUT
   =========================== */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* ===========================
   HEADER
   =========================== */

.header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: #ffffff;
    padding: 10px 0;
    box-shadow: var(--shadow-lg);
    margin-bottom: var(--spacing-md);
}

.header-top {
    display: flex;
    align-items: center;
    gap: var(--spacing-xl);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    text-decoration: none;
    color: inherit;
    flex-shrink: 0;
}

/* Logo chinh thuc cua Truong (day, gom san ten Truong) - dat trong khung
   trang de dam bao tuong phan bat ke nen xung quanh la mau gi. */
.brand-logo-full {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    background: #ffffff;
    border-radius: var(--radius-md);
    padding: 6px 14px;
    box-shadow: var(--shadow-md);
}

.brand-logo-full img {
    display: block;
    height: 34px;
    width: auto;
}

/* ===========================
   FOOTER
   =========================== */

.footer {
    position: relative;
    background:
        radial-gradient(circle at 88% 0%, rgba(34, 211, 238, 0.16), transparent 55%),
        radial-gradient(circle at 8% 100%, rgba(59, 130, 246, 0.14), transparent 50%),
        linear-gradient(160deg, #1e3a8a 0%, #0f172a 100%);
    color: rgba(255, 255, 255, 0.75);
    padding: var(--spacing-2xl) var(--spacing-md) var(--spacing-lg);
    margin-top: var(--spacing-2xl);
    overflow: hidden;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--secondary), var(--primary-light), var(--secondary));
}

.footer p {
    margin: var(--spacing-sm) 0;
    font-size: 0.95rem;
}

.footer a {
    color: rgba(255, 255, 255, 0.75);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.footer a:hover {
    color: #67e8f9;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: left;
    padding-bottom: var(--spacing-xl);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.footer-links-row {
    display: grid;
    /* minmax(0, Nfr), khong phai Nfr: grid item mac dinh min-width:auto,
       de noi dung dai (vd danh sach 2 cot trong "Danh muc thanh tich")
       ep tran ngang thay vi tu xuong dong o man hinh vua. Cot "Danh muc
       thanh tich" rong hon han vi noi dung nhieu hon (8 muc, 2 cot con). */
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.9fr) minmax(0, 1.6fr) minmax(0, 1.1fr);
    gap: var(--spacing-lg);
}

.footer-col {
    min-width: 0;
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
}

.footer-about-text {
    font-size: 0.76rem;
    font-style: italic;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.55);
    margin: 0 0 var(--spacing-md);
}

.footer-about-logos {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    background: #ffffff;
    border-radius: var(--radius-md);
    padding: 8px 14px;
    box-shadow: var(--shadow-md);
}

.footer-about-logos img {
    height: 34px;
    width: auto;
    display: block;
}

.footer-col-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    white-space: nowrap;
    margin-bottom: var(--spacing-md);
}

.footer-col-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #67e8f9;
    flex-shrink: 0;
}

.footer-col-icon svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-links-2col {
    display: grid;
    /* minmax(0, max-content), khong phai max-content thuan: cho phep cot
       co lai khi khong du cho thay vi ep tran ra ngoai the (vd badge
       "SAP RA MAT" canh ten dai). */
    grid-template-columns: minmax(0, max-content) minmax(0, max-content);
    gap: 10px 20px;
}

.footer-links-2col > li {
    min-width: 0;
}

.footer-links a {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: color var(--transition-fast), transform var(--transition-fast);
}

.footer-links a[data-status="coming-soon"] {
    color: rgba(255, 255, 255, 0.4);
}

.footer-links a:not([data-status="coming-soon"]):hover {
    transform: translateX(3px);
}

.footer-links a:hover {
    color: #67e8f9;
}

.footer-mail-icon {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: var(--spacing-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
    flex-wrap: wrap;
    text-align: center;
}

.footer-top-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    transition: color var(--transition-fast), transform var(--transition-fast);
}

.footer-top-link:hover {
    color: #67e8f9;
    transform: translateY(-2px);
}

.footer-bottom p {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
}

/* ===========================
   HELPERS
   =========================== */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-muted { color: var(--gray-500); }
.text-small { font-size: 0.875rem; }
.text-error { color: var(--danger); }

.mt { margin-top: var(--spacing-md); }
.mb { margin-bottom: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-xl); }
.mb-lg { margin-bottom: var(--spacing-xl); }

.hidden { display: none !important; }

.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* ===========================
   SPLASH / WELCOME SCREEN
   =========================== */

.splash-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 55%, var(--secondary) 100%);
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.splash-screen.splash-hide {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.splash-content {
    text-align: center;
    color: var(--white);
    padding: var(--spacing-xl);
    animation: splashFadeUp 0.8s ease;
}

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

.splash-logo {
    width: 84px;
    height: 84px;
    margin: 0 auto var(--spacing-lg);
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    animation: splashPulse 1.8s ease-in-out infinite;
}

.splash-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

@keyframes splashPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
}

.splash-eyebrow {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 6px 16px;
    border-radius: 999px;
    margin-bottom: var(--spacing-md);
}

.splash-title {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: var(--spacing-sm);
}

.splash-desc {
    font-size: 1rem;
    opacity: 0.92;
    max-width: 640px;
    margin: 0 auto var(--spacing-xl);
    line-height: 1.6;
    white-space: nowrap;
}

.splash-progress {
    width: 220px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    margin: 0 auto;
    overflow: hidden;
}

.splash-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--white);
    border-radius: 999px;
    animation: splashProgress 2.2s ease forwards;
}

@keyframes splashProgress {
    to { width: 100%; }
}

@media (max-width: 700px) {
    .splash-desc {
        white-space: normal;
    }
}

@media (max-width: 480px) {
    .splash-title {
        font-size: 1.6rem;
    }

    .splash-desc {
        font-size: 0.9rem;
    }
}
