/* ====================================================================
   THX MEMBER PORTAL — DESIGN SYSTEM
   Tất cả CSS variables và components cho Member Portal
   ==================================================================== */

/* 0. CSS VARIABLES (PHẢI ĐẶT ĐẦU FILE) */
:root {
    --thx-primary: #2271b1;
    --thx-primary-hover: #135e96;
    --thx-accent: #2563eb;
    --thx-bg: #f3f4f6;
    --thx-surface: #ffffff;
    --thx-border: #e5e7eb;
    --thx-text: #1f2937;
    --thx-text-muted: #6b7280;
    --thx-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --thx-shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --thx-radius: 12px;
    --thx-radius-sm: 8px;
}

/* 0.1 GLOBAL RESETS FOR PORTAL */
body.thx-portal-active {
    overflow-y: auto !important;
    height: auto !important;
}

body.thx-portal-active #primary.content-area {
    padding: 0 !important;
    max-width: none !important;
}

body.thx-portal-active .site-main {
    min-height: 100vh;
}

/* ====================================================================
   1. LAYOUT — Sidebar + Content
   ==================================================================== */
.thx-layout {
    display: flex;
    gap: 32px;
    align-items: flex-start;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

.thx-sidebar {
    width: 260px;
    flex-shrink: 0;
    background: var(--thx-surface);
    border-radius: var(--thx-radius);
    border: 1px solid var(--thx-border);
    box-shadow: var(--thx-shadow);
    padding: 16px 0;
    position: sticky;
    top: 100px;
}

.thx-content {
    flex-grow: 1;
    min-width: 0;
}

@media (max-width: 900px) {
    .thx-layout {
        flex-direction: column;
        gap: 24px;
    }

    .thx-sidebar {
        width: 100%;
        position: static;
    }
}

/* ====================================================================
   2. SIDEBAR NAVIGATION
   ==================================================================== */
.thx-nav,
.thx-nav li {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

.thx-nav li::before,
.thx-nav li::after {
    display: none !important;
}

.thx-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: var(--thx-text);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.thx-nav-link:hover {
    background: var(--thx-bg);
    color: var(--thx-primary);
}

.thx-nav-link.is-active {
    background: #f0f6fc;
    color: var(--thx-primary);
    border-left-color: var(--thx-primary);
}

.thx-nav-icon {
    width: 20px;
    height: 20px;
    opacity: 0.6;
}

.thx-nav-link.is-active .thx-nav-icon {
    opacity: 1;
}

/* ====================================================================
   3. CARDS & CONTAINERS
   ==================================================================== */
.thx-card {
    background: var(--thx-surface);
    border: 1px solid var(--thx-border);
    border-radius: var(--thx-radius);
    box-shadow: var(--thx-shadow);
    padding: 24px;
    margin-bottom: 24px;
}

.thx-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 16px;
    margin-top: 0;
    color: var(--thx-text);
}

/* ====================================================================
   4. TABS (Horizontal Navigation)
   ==================================================================== */
.thx-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--thx-border);
    margin-bottom: 24px;
    padding-bottom: 0;
    overflow-x: auto;
    scrollbar-width: none;
    list-style: none;
    margin-top: 0;
    padding-left: 0;
}

.thx-tabs::-webkit-scrollbar {
    display: none;
}

.thx-tab-link {
    display: block;
    padding: 10px 16px;
    font-weight: 600;
    color: var(--thx-text-muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: all 0.2s;
}

.thx-tab-link:hover {
    color: var(--thx-text);
    background: rgba(0, 0, 0, 0.02);
    border-radius: 6px 6px 0 0;
}

.thx-tab-link.is-active {
    color: var(--thx-primary);
    border-bottom-color: var(--thx-primary);
}

/* ====================================================================
   5. FORMS
   ==================================================================== */
.thx-field-group {
    margin-bottom: 20px;
}

.thx-field-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.thx-field-group input[type='text'],
.thx-field-group input[type='email'],
.thx-field-group input[type='password'],
.thx-field-group select,
.thx-field-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #dcdcde;
    border-radius: 6px;
    font-size: 14px;
}

.thx-field-group input[readonly] {
    background: #f9f9f9;
    color: #666;
    cursor: not-allowed;
}

.thx-form-group {
    margin-bottom: 16px;
}

.thx-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--thx-text);
}

.thx-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--thx-border);
    border-radius: var(--thx-radius-sm);
    background: var(--thx-surface);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.thx-input:focus {
    outline: none;
    border-color: var(--thx-accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.thx-help-text {
    display: block;
    margin-top: 4px;
    font-size: 0.85rem;
    color: var(--thx-text-muted);
}

/* ====================================================================
   6. BUTTONS
   ==================================================================== */
.thx-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--thx-radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.thx-btn-primary {
    background: var(--thx-primary);
    color: #fff;
}

.thx-btn-primary:hover {
    background: var(--thx-primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--thx-shadow-hover);
    color: #fff;
}

.thx-btn-outline {
    background: transparent;
    border-color: var(--thx-border);
    color: var(--thx-text);
}

.thx-btn-outline:hover {
    background: var(--thx-bg);
}

.thx-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}

.thx-button-primary {
    background: var(--thx-primary);
    color: #fff;
    border-color: var(--thx-primary);
}

.thx-button-primary:hover {
    background: var(--thx-primary-hover);
    color: #fff;
}

.thx-btn-full {
    width: 100%;
}

/* ====================================================================
   7. DASHBOARD OVERVIEW GRID
   ==================================================================== */
.thx-dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

@media(min-width: 1024px) {
    .thx-dashboard-grid {
        grid-template-columns: 320px 1fr;
    }
}

.thx-stat-box {
    background: var(--thx-bg);
    border-radius: var(--thx-radius-sm);
    padding: 16px;
    text-align: center;
}

.thx-stat-num {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--thx-primary);
    line-height: 1;
}

.thx-stat-label {
    font-size: 0.85rem;
    color: var(--thx-text-muted);
    font-weight: 600;
    margin-top: 4px;
}

.thx-stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 20px;
}

/* ====================================================================
   8. LISTS
   ==================================================================== */
.thx-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.thx-list li {
    padding: 12px 0;
    border-bottom: 1px solid var(--thx-border);
}

.thx-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.thx-list-link {
    text-decoration: none;
    color: var(--thx-text);
    font-weight: 600;
    transition: color 0.2s;
}

.thx-list-link:hover {
    color: var(--thx-accent);
}

.thx-list-meta {
    font-size: 0.85rem;
    color: var(--thx-text-muted);
    display: block;
    margin-top: 2px;
}

.thx-list-empty {
    color: var(--thx-text-muted);
    font-style: italic;
}

/* ====================================================================
   9. NOTICES / ALERTS
   ==================================================================== */
.thx-msg {
    padding: 12px 16px;
    border-radius: var(--thx-radius-sm);
    margin-bottom: 16px;
    font-weight: 500;
}

.thx-msg-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.thx-msg-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.thx-notice {
    padding: 12px 16px;
    border-radius: var(--thx-radius-sm);
    margin-bottom: 16px;
    font-weight: 600;
}

.thx-notice.ok {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.thx-notice.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* ====================================================================
   10. AUTH PAGES
   ==================================================================== */
.thx-auth-container {
    max-width: 450px;
    margin: 60px auto;
    padding: 40px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    border: 1px solid #eee;
}

.thx-auth-links {
    text-align: center;
    margin-top: 25px;
    font-size: 14px;
    color: #666;
}

/* Login tabs */
.thx-login-tabs {
    display: flex;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
}

.thx-tab-item {
    flex: 1;
    text-align: center;
    padding: 10px 5px;
    background: #f9f9f9;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #555;
    border-right: 1px solid #ddd;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.thx-tab-item:last-child {
    border-right: none;
}

.thx-tab-item:hover {
    background: #eee;
}

.thx-tab-item.active {
    background: #fff;
    color: var(--thx-primary);
    font-weight: 700;
    box-shadow: inset 0 -3px 0 var(--thx-primary);
}

.thx-tab-item .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    margin-bottom: 2px;
}

#login-input-text,
#login-input-phone {
    animation: thxFadeIn 0.3s ease-in-out;
}

@keyframes thxFadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#thx-social-login-section .loginizer_social_box {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

#thx-social-login-section br {
    display: none;
}

/* ====================================================================
   11. AVATAR
   ==================================================================== */
.thx-avatar-wrapper {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 30px;
}

.thx-avatar-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.thx-avatar-upload-btn {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: var(--thx-primary);
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: 0.2s;
    z-index: 10;
}

.thx-avatar-upload-btn:hover {
    background: var(--thx-primary-hover);
    transform: scale(1.1);
}

.thx-avatar-upload-btn input {
    display: none;
}

.thx-avatar-remove-btn {
    position: absolute;
    top: 0;
    right: 0;
    background: #e74c3c;
    color: #fff;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    font-size: 14px;
    z-index: 20;
    transition: 0.2s;
}

.thx-avatar-remove-btn:hover {
    background: #c0392b;
    transform: scale(1.1);
}

/* ====================================================================
   12. TOAST NOTIFICATION
   ==================================================================== */
.thx-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #333;
    color: #fff;
    padding: 12px 24px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.thx-toast.show {
    transform: translateY(0);
    opacity: 1;
}

.thx-toast-success {
    background: #46b450;
}

.thx-toast-error {
    background: #d63638;
}

/* ====================================================================
   13. SETTINGS PAGE
   ==================================================================== */
.thx-settings-heading {
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    font-size: 16px;
    color: var(--thx-primary);
}

.thx-desc {
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
    margin-top: -5px;
}

.thx-toggle-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px dashed #eee;
}

.thx-toggle-item:last-of-type {
    border-bottom: none;
}

.thx-toggle-info strong {
    display: block;
    font-size: 14px;
    color: #333;
}

.thx-toggle-info span {
    display: block;
    font-size: 12px;
    color: #888;
    margin-top: 3px;
}

/* Toggle Switch */
.thx-switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
}

.thx-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}

input:checked+.slider {
    background-color: var(--thx-primary);
}

input:focus+.slider {
    box-shadow: 0 0 1px var(--thx-primary);
}

input:checked+.slider:before {
    transform: translateX(22px);
}

.slider.round {
    border-radius: 24px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Radio Group */
.thx-radio-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: normal;
    cursor: pointer;
    padding: 8px;
    border: 1px solid transparent;
    border-radius: 6px;
    transition: 0.2s;
}

.thx-radio-group label:hover {
    background: #f9f9f9;
}

.thx-radio-group input {
    margin-right: 10px;
}

/* ====================================================================
   14. PUBLIC PROFILE CARD
   ==================================================================== */
.thx-profile-public-card {
    max-width: 700px;
    margin: 40px auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    border: 1px solid #eee;
}

.thx-profile-cover {
    height: 150px;
    background: linear-gradient(120deg, var(--thx-primary), #74b9ff);
}

.thx-profile-body {
    padding: 0 30px 40px;
    text-align: center;
    position: relative;
}

.thx-profile-avatar {
    margin-top: -75px;
    display: inline-block;
    padding: 5px;
    background: #fff;
    border-radius: 50%;
}

.thx-profile-avatar img {
    border-radius: 50%;
    display: block;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.thx-profile-name {
    margin: 15px 0 5px;
    font-size: 28px;
    color: #333;
}

.thx-profile-meta {
    display: flex;
    justify-content: center;
    gap: 20px;
    font-size: 14px;
    color: #666;
    margin-bottom: 25px;
}

.thx-profile-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.thx-phone-public {
    color: #27ae60;
    font-weight: 500;
}

.thx-phone-hidden {
    color: #95a5a6;
    cursor: help;
}

.thx-profile-bio {
    max-width: 500px;
    margin: 0 auto;
    color: #444;
    line-height: 1.6;
    font-size: 15px;
}

.thx-profile-actions {
    margin-top: 30px;
}

/* ====================================================================
   15. HEADER LOGIN WIDGET (từ le-member-hub)
   ==================================================================== */
.le-header-login {
    display: inline-flex;
    align-items: center;
    position: relative;
}

.le-header-btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .4rem .7rem;
    border: 1px solid #e5e7eb;
    border-radius: .5rem;
    background: #fff;
    color: #111827;
    text-decoration: none;
    font-weight: 600;
}

.le-header-hub {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    text-decoration: none;
    color: inherit;
    padding: .25rem .5rem;
    border-radius: .5rem;
}

.le-header-hub:hover {
    background: rgba(17, 24, 39, .06);
}

.le-header-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.le-header-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 160px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: .5rem;
    box-shadow: 0 12px 28px rgba(0, 0, 0, .12);
    padding: 6px;
    display: none;
    z-index: 9999;
    text-align: center;
}

.le-header-login--wrap:hover .le-header-menu,
.le-header-login--wrap:focus-within .le-header-menu {
    display: block;
}

.le-header-logout {
    display: block;
    padding: .5rem .6rem;
    border-radius: .35rem;
    text-decoration: none;
    color: #111827;
    font-weight: 600;
}

.le-header-logout:hover {
    background: #f3f4f6;
}

/* ====================================================================
   16. FULL-WIDTH UTILITY
   ==================================================================== */
.thx-full-width {
    padding: 0 !important;
}