/* =======================
   HUB / PORTFOLIO VIEW
======================= */

.hub-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 9999;
    background: radial-gradient(circle at 50% 10%, #1a2236 0%, #070a14 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    overflow-x: hidden;
    opacity: 1;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.hub-wrapper.is-hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.95);
    display: none !important;
    /* Hide completely */
}

.hub-content {
    max-width: 1000px;
    width: 100%;
    padding: 2rem;
    box-sizing: border-box;
    text-align: center;
}

/* Dashboard Header Style Sync */
/* Dashboard Header Style Sync */
.glass-navbar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.25rem 0;
    background: rgba(10, 25, 47, 0.2);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 10;
}

.glass-navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    box-sizing: border-box;
}

/* Ensure buttons look right in Hub */
.btn-gold {
    background-color: #f59e0b;
    color: #1e293b;
    font-weight: 600;
    padding: 0.5rem 1.25rem;
    border-radius: 0.5rem;
    text-decoration: none;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    display: inline-block;
}

.btn-gold:hover {
    background-color: #d97706;
    transform: translateY(-2px);
}

.hub-header {
    display: none;
    /* Hide old header if present */
}

/* Use exact same brand style as Dashboard */
.brand-logo-lg {
    font-size: 1.25rem !important;
    /* Reset from 2.5rem */
    font-weight: 700;
    letter-spacing: 0.5px;
    background: none;
    -webkit-text-fill-color: initial;
    color: #e2e8f0;
    /* var(--text) */
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.brand-logo-lg span {
    color: #f59e0b;
    -webkit-text-fill-color: initial;
    font-weight: 800;
}

/* Hide subtitle to match clean dashboard look */
.hub-subtitle {
    display: none;
}

.system-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 1rem;
}

.system-card {
    position: relative;
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 2rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    backdrop-filter: blur(10px);
    animation: fadeUp 0.8s ease-out;
    /* Default animation */
}

/* Stagger animation */
.system-card:nth-child(2) {
    animation-delay: 0.1s;
}

.system-card:nth-child(3) {
    animation-delay: 0.2s;
}

.system-card:hover {
    transform: translateY(-5px);
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.4);
}

.system-card .card-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 0%, rgba(96, 165, 250, 0.1), transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.system-card:hover .card-glow {
    opacity: 1;
}

.sys-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 99px;
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid rgba(16, 185, 129, 0.2);
    margin-bottom: 1.5rem;
}

.sys-name {
    font-size: 1.5rem;
    color: #f1f5f9;
    margin: 0 0 0.75rem 0;
    font-weight: 700;
}

.text-gold {
    color: #f59e0b;
}

.text-blue {
    color: #3b82f6;
}

.text-emerald {
    color: #10b981;
}

.sys-desc {
    color: #94a3b8;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    height: 3rem;
    /* Fixed height for alignment */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sys-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.metric {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 6px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

/* Color accents for each metric card using nth-child logic for this specific layout */
.metric:nth-child(1) {
    border-bottom: 2px solid rgba(16, 185, 129, 0.5);
    /* Emerald */
    background: linear-gradient(180deg, rgba(16, 185, 129, 0.08) 0%, rgba(16, 185, 129, 0.02) 100%);
}

.metric:nth-child(2) {
    border-bottom: 2px solid rgba(245, 158, 11, 0.5);
    /* Gold */
    background: linear-gradient(180deg, rgba(245, 158, 11, 0.08) 0%, rgba(245, 158, 11, 0.02) 100%);
}

.metric:nth-child(3) {
    border-bottom: 2px solid rgba(59, 130, 246, 0.5);
    /* Blue */
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.08) 0%, rgba(59, 130, 246, 0.02) 100%);
}

.metric:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.08);
}

.metric .label {
    font-size: 0.7rem;
    color: #94a3b8;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.metric .value {
    font-size: 1.25rem;
    font-weight: 800;
    color: #e2e8f0;
    line-height: 1.2;
}

.metric .value.text-emerald {
    color: #10b981;
    text-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

.metric .value.text-gold {
    color: #f59e0b;
    text-shadow: 0 0 20px rgba(245, 158, 11, 0.3);
}

.metric .value.text-blue {
    color: #3b82f6;
    text-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.btn-access {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-access:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

/* Coming Soon State */
.system-card.coming-soon {
    cursor: default;
    opacity: 0.8;
}

.system-card.coming-soon:hover {
    transform: none;
    box-shadow: none;
    border-color: rgba(255, 255, 255, 0.08);
}

.system-card.coming-soon .sys-badge {
    background: rgba(148, 163, 184, 0.1);
    color: #94a3b8;
    border-color: rgba(148, 163, 184, 0.2);
}

.system-card.coming-soon .sys-name,
.system-card.coming-soon .sys-desc {
    color: #64748b;
}

.system-card.coming-soon .sys-metrics {
    opacity: 0.5;
    filter: blur(2px);
}

.btn-access.disabled {
    background: rgba(30, 41, 59, 0.8);
    color: #64748b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: not-allowed;
}

.btn-access.disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Back Button in Detail View */
.btn-back-hub {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #94a3b8;
    margin-right: 15px;
    transition: all 0.2s;
    cursor: pointer;
}

.btn-back-hub:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Animations */
@keyframes fadeDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .hub-wrapper {
        align-items: flex-start;
        /* Cho phép cuộn từ đầu trang trên mobile */
    }

    .hub-content {
        padding: 1rem;
        padding-top: 100px;
        /* Tránh bị navbar che mất */
        width: 100%;
    }

    .brand-logo-lg {
        font-size: 1.5rem;
    }

    .system-grid {
        grid-template-columns: 1fr;
        /* 1 cột duy nhất */
        gap: 1rem;
    }

    .system-card {
        padding: 1.25rem;
        border-radius: 16px;
    }

    .sys-badge {
        margin-bottom: 1rem;
        font-size: 0.7rem;
    }

    .sys-name {
        font-size: 1.25rem;
        margin-bottom: 0.5rem;
    }

    .sys-desc {
        font-size: 0.85rem;
        line-height: 1.5;
        height: auto;
        -webkit-line-clamp: 3;
        /* Hiển thị tối đa 3 dòng */
        margin-bottom: 1.25rem;
    }

    .sys-metrics {
        padding-top: 1rem;
        margin-bottom: 1.25rem;
        gap: 8px;
    }

    .metric {
        padding: 10px 6px;
    }

    .metric .value {
        font-size: 1rem;
    }

    .metric .label {
        font-size: 0.65rem;
    }

    .btn-access {
        padding: 10px;
        font-size: 0.95rem;
    }
}