/* =========================================
   1. GLOBAL VARIABLES & RESET
   ========================================= */
:root {
    --primary-color: #26D0CE;
    --secondary-color: #1A2980;
    --success-color: #2ecc71;
    --warning-color: #f1c40f;
    --danger-color: #e74c3c;
    --light-bg: #f8f9fa;
    --dark-text: #2c3e50;
    --white: #ffffff;
    --radius-sm: 8px;
    --radius-md: 15px;
    --radius-lg: 30px;
    --shadow-soft: 0 5px 15px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Fix lỗi font và box-sizing */
.wallet-wrapper, .vn-wallet-admin-wrap {
    font-family: 'Inter', 'Segoe UI', Roboto, sans-serif;
    box-sizing: border-box;
    max-width: 100%;
}

.wallet-wrapper *, .vn-wallet-admin-wrap * {
    box-sizing: border-box;
}

/* =========================================
   2. FRONTEND UI (NGƯỜI DÙNG)
   ========================================= */

/* Header Card: Glassmorphism Effect */
.wallet-header {
    background: linear-gradient(135deg, #1A2980 0%, #26D0CE 100%);
    color: var(--white);
    padding: 30px;
    border-radius: var(--radius-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    box-shadow: 0 10px 30px rgba(38, 208, 206, 0.3);
    position: relative;
    overflow: hidden;
}

/* Hiệu ứng ánh sáng nền */
.wallet-header::before {
    content: '';
    position: absolute;
    top: -50px; right: -50px;
    width: 200px; height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    filter: blur(50px);
}

.balance-text {
    font-size: 36px;
    margin: 10px 0;
    color: var(--white);
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* QR Code Box */
.header-qr-box {
    background: rgba(255, 255, 255, 0.9);
    padding: 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-align: center;
    width: 90px;
    transition: var(--transition);
    backdrop-filter: blur(5px);
}

.header-qr-box:hover {
    transform: scale(1.05) rotate(2deg);
    background: var(--white);
}

.header-qr-box img {
    width: 100%;
    display: block;
    border-radius: 4px;
}

/* Action Buttons Area */
.wallet-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 20px;
    margin-bottom: 35px;
}

/* Nút chức năng bo tròn & Hiệu ứng */
.action-btn {
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    background: var(--white);
    padding: 15px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    border: 1px solid transparent;
}

.action-btn:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
}

.icon-box {
    width: 60px;
    height: 60px;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%; /* Bo tròn hoàn toàn */
    color: var(--white);
    font-size: 28px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* Gradients cho icon */
.green-grad { background: linear-gradient(135deg, #2ecc71, #26A69A); }
.blue-grad { background: linear-gradient(135deg, #3498db, #2980b9); }
.orange-grad { background: linear-gradient(135deg, #f1c40f, #f39c12); }
.purple-grad { background: linear-gradient(135deg, #9b59b6, #8e44ad); }

/* Tooltip (Chú thích) */
.action-btn::after {
    content: attr(data-tooltip); /* Lấy nội dung từ HTML */
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: #333;
    color: #fff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 10;
    pointer-events: none;
}

.action-btn:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* History Section */
.wallet-history-section {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 25px;
    box-shadow: var(--shadow-soft);
}

.history-list li {
    padding: 15px;
    margin-bottom: 10px;
    background: #fcfcfc;
    border-radius: var(--radius-sm);
    border: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition);
}

.history-list li:hover {
    background: var(--white);
    transform: translateX(5px);
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* Modal Styles Modern */
.w-modal { display: none; position: fixed; z-index: 99999; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.5); backdrop-filter: blur(8px); }
.w-modal.show { display: block; }
.w-modal-content {
    background-color: var(--white);
    margin: 8% auto;
    padding: 30px;
    width: 90%;
    max-width: 450px;
    border-radius: 20px;
    position: relative;
    animation: zoomIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
}
@keyframes zoomIn { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.w-close {
    position: absolute;
    top: 15px; right: 20px;
    font-size: 24px;
    background: #eee;
    width: 30px; height: 30px;
    border-radius: 50%;
    text-align: center;
    line-height: 30px;
    cursor: pointer;
    color: #666;
    transition: var(--transition);
}
.w-close:hover { background: var(--danger-color); color: white; }

.w-input {
    width: 100%;
    padding: 15px;
    margin: 10px 0;
    border: 2px solid #eee;
    border-radius: 12px;
    font-size: 15px;
    transition: 0.2s;
    outline: none;
}
.w-input:focus { border-color: var(--primary-color); background: #faffff; }

.w-btn {
    width: 100%;
    padding: 15px;
    border: none;
    color: var(--white);
    border-radius: 50px; /* Nút bo tròn */
    cursor: pointer;
    font-weight: 700;
    font-size: 16px;
    margin-top: 15px;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.w-btn:hover { filter: brightness(1.1); transform: translateY(-2px); box-shadow: 0 5px 15px rgba(0,0,0,0.2); }

/* =========================================
   3. ADMIN UI (QUẢN TRỊ VIÊN) - Nâng cấp toàn diện
   ========================================= */

/* Wrapper chính cho Admin để không ảnh hưởng WP Core */
.vn-wallet-admin-wrap {
    background: #f0f2f5;
    padding: 20px;
    border-radius: var(--radius-md);
    margin: 20px 20px 0 0;
}

.vn-wallet-admin-wrap h1 {
    font-weight: 800;
    color: var(--secondary-color);
    margin-bottom: 20px;
}

/* Tabs hiện đại */
.nav-tab-wrapper {
    border-bottom: none !important;
    display: flex;
    gap: 10px;
    margin-bottom: 20px !important;
    background: transparent !important;
}

.nav-tab {
    background: var(--white) !important;
    border: none !important;
    border-radius: 50px !important; /* Tab bo tròn */
    padding: 10px 20px !important;
    font-weight: 600 !important;
    color: #7f8c8d !important;
    transition: var(--transition) !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    margin: 0 !important;
}

.nav-tab:hover {
    transform: translateY(-2px);
    color: var(--primary-color) !important;
}

.nav-tab-active {
    background: var(--secondary-color) !important;
    color: var(--white) !important;
    box-shadow: 0 5px 15px rgba(26, 41, 128, 0.3);
}

.nav-tab-active:hover {
    color: var(--white) !important;
}

/* Cards & Containers trong Admin */
.wrap-content-box {
    background: var(--white);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.03);
    margin-bottom: 20px;
    border: 1px solid rgba(0,0,0,0.05);
}

/* Custom Table trong Admin */
.wp-list-table {
    border: none !important;
    box-shadow: none !important;
    border-collapse: separate !important;
    border-spacing: 0 10px !important; /* Tạo khoảng cách giữa các hàng */
    background: transparent !important;
}

.wp-list-table thead th {
    border-bottom: none !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    color: #95a5a6;
    font-size: 12px;
    padding: 10px !important;
}

.wp-list-table tbody tr {
    background: var(--white);
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
    transition: var(--transition);
}

.wp-list-table tbody tr:hover {
    transform: scale(1.01);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.wp-list-table tbody td {
    padding: 15px 10px !important;
    vertical-align: middle !important;
    border-top: 1px solid #f9f9f9;
    border-bottom: 1px solid #f9f9f9;
}

.wp-list-table tbody td:first-child {
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
    border-left: 1px solid #f9f9f9;
}

.wp-list-table tbody td:last-child {
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
    border-right: 1px solid #f9f9f9;
}

/* Nút trong Admin */
.button.button-primary {
    background: var(--secondary-color) !important;
    border-color: var(--secondary-color) !important;
    border-radius: 20px !important;
    padding: 5px 20px !important;
    transition: var(--transition) !important;
}

.button.button-primary:hover {
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* Rút tiền Items (Admin Withdraw) */
.withdraw-item {
    background: var(--white);
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
    border-left: 5px solid var(--warning-color);
    transition: var(--transition);
}

.withdraw-item:hover {
    transform: translateX(5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.withdraw-actions .button {
    margin-left: 5px;
    border-radius: 20px !important;
}

.withdraw-approve {
    background: var(--success-color) !important;
    color: white !important;
    border: none !important;
}

.withdraw-reject {
    background: var(--danger-color) !important;
    color: white !important;
    border: none !important;
}

/* Badge trạng thái */
.status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
}
.status-badge.pending { background: #fff3cd; color: #856404; }
.status-badge.completed { background: #d4edda; color: #155724; }
.status-badge.failed { background: #f8d7da; color: #721c24; }