/* assets/style.css - Enhanced Version */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary-color: #ff7b00;
    --primary-hover: #e66a00;
    --primary-light: #ff9933;
    --secondary-bg: #fff5eb;
    --text-dark: #1f2937;
    --text-gray: #6b7280;
    --bg-body: #f3f4f6;
    --bg-card: #ffffff;
    --sidebar-width: 260px;
    --header-height: 70px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --border-color: #e5e7eb;
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-body);
    color: var(--text-dark);
    font-size: 15px;
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { 
    text-decoration: none; 
    color: inherit;
    transition: var(--transition-fast);
}

ul { list-style: none; }

/* --- LAYOUT STRUCTURE --- */
#wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
    transition: var(--transition-normal);
}

/* --- SIDEBAR --- */
#sidebar {
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    transition: var(--transition-normal);
    position: fixed;
    height: 100vh;
    z-index: 1000;
    left: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

#sidebar::-webkit-scrollbar {
    width: 6px;
}

#sidebar::-webkit-scrollbar-track {
    background: transparent;
}

#sidebar::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

#sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--text-gray);
}

#sidebar.toggled {
    margin-left: calc(var(--sidebar-width) * -1);
}

.sidebar-brand {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--primary-color);
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--secondary-bg) 100%);
    position: relative;
}

.sidebar-brand::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
}

.sidebar-menu {
    padding: 20px 10px;
}

/* Thêm style cho heading trong menu (TÀI KHOẢN, QUẢN TRỊ VIÊN) */
.sidebar-menu .menu-heading {
    padding: 15px 15px 8px 15px;
    color: var(--text-gray);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 10px;
}

.sidebar-menu li {
    margin-bottom: 5px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: var(--text-gray);
    border-radius: 8px;
    font-weight: 500;
    transition: var(--transition-fast);
    position: relative;
    overflow: hidden;
    text-decoration: none; /* Xóa gạch chân */
}

.sidebar-menu a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: var(--primary-color);
    transform: scaleY(0);
    transition: var(--transition-fast);
}

.sidebar-menu a:hover::before,
.sidebar-menu a.active::before {
    transform: scaleY(1);
}

.sidebar-menu a i {
    margin-right: 12px;
    font-size: 1.1rem;
    width: 25px;
    text-align: center;
    transition: var(--transition-fast);
}

.sidebar-menu a:hover, 
.sidebar-menu a.active {
    background-color: var(--secondary-bg);
    color: var(--primary-color);
    transform: translateX(3px);
    text-decoration: none; /* Đảm bảo không có gạch chân khi hover */
}

.sidebar-menu a:hover i,
.sidebar-menu a.active i {
    transform: scale(1.1);
}

/* --- MAIN CONTENT --- */
#content-wrapper {
    width: 100%;
    margin-left: var(--sidebar-width);
    transition: var(--transition-normal);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

#content-wrapper.toggled {
    margin-left: 0;
}

/* --- HEADER --- */
header {
    height: var(--header-height);
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 999;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

.toggle-btn {
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-gray);
    padding: 8px;
    border-radius: 6px;
    transition: var(--transition-fast);
}

.toggle-btn:hover {
    background: var(--secondary-bg);
    color: var(--primary-color);
    transform: rotate(90deg);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.balance-badge {
    background: var(--secondary-bg);
    color: var(--primary-color);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    border: 1px solid rgba(255, 123, 0, 0.2);
    transition: var(--transition-fast);
    cursor: default;
}

.balance-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 123, 0, 0.15);
}

.user-dropdown {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 8px;
    transition: var(--transition-fast);
}

.user-dropdown:hover {
    background: var(--secondary-bg);
}

.avatar {
    width: 35px;
    height: 35px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(255, 123, 0, 0.3);
    transition: var(--transition-fast);
}

.user-dropdown:hover .avatar {
    transform: scale(1.1) rotate(5deg);
}

/* --- CONTENT AREA --- */
main {
    padding: 30px;
    flex: 1;
    animation: fadeIn 0.5s ease;
}

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

/* --- COMPONENTS --- */
.card {
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 25px;
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    transform: scaleX(0);
    transition: var(--transition-normal);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card:hover::before {
    transform: scaleX(1);
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: var(--transition-fast);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

.btn-primary { 
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 123, 0, 0.25);
}

.btn-primary:hover { 
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary-color) 100%);
    box-shadow: 0 6px 16px rgba(255, 123, 0, 0.35);
    transform: translateY(-2px);
}

.btn-full { width: 100%; }

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    margin-top: 5px;
    outline: none;
    transition: var(--transition-fast);
    font-size: 0.95rem;
}

.form-control:focus { 
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 123, 0, 0.1);
}

.form-control:hover {
    border-color: var(--text-gray);
}

table { 
    width: 100%; 
    border-collapse: collapse;
}

th { 
    text-align: left; 
    padding: 15px; 
    color: var(--text-gray); 
    border-bottom: 2px solid var(--border-color); 
    font-size: 0.85rem; 
    text-transform: uppercase;
    font-weight: 600;
    background: var(--secondary-bg);
}

td { 
    padding: 15px; 
    border-bottom: 1px solid var(--border-color); 
    color: var(--text-dark);
    transition: var(--transition-fast);
}

tr:hover td {
    background: var(--secondary-bg);
}

tr:last-child td { border-bottom: none; }

.alert { 
    padding: 15px 20px; 
    border-radius: 8px; 
    margin-bottom: 20px; 
    border-left: 4px solid;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.alert-success { 
    background: #ecfdf5; 
    border-color: #10b981; 
    color: #065f46;
}

.alert-danger { 
    background: #fef2f2; 
    border-color: #ef4444; 
    color: #991b1b;
}

/* Grid for Cards */
.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* Form Wrapper */
.form-wrapper {
    max-width: 500px;
    margin: 0 auto;
}

.deposit-card {
    padding: 30px;
}

.form-title {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.8rem;
    font-weight: 700;
}

.balance-box {
    margin-bottom: 20px;
    padding: 20px;
    background: var(--secondary-bg);
    border-radius: 10px;
    border: 1px solid rgba(255, 123, 0, 0.2);
}

.balance-label {
    color: var(--text-gray);
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.balance-value {
    color: var(--primary-color);
    font-size: 2rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(255, 123, 0, 0.1);
}

.balance-value small {
    font-size: 0.5em;
    color: var(--text-gray);
}

/* Tabs */
.deposit-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
}

.tab-secondary {
    background: var(--secondary-bg);
    color: var(--text-gray);
    transition: var(--transition-fast);
}

.tab-secondary:hover {
    background: var(--primary-color);
    color: white;
}

/* Payment Method Box */
.payment-method {
    background: rgba(46, 204, 113, 0.1);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid rgba(46, 204, 113, 0.3);
    display: flex;
    align-items: center;
    transition: var(--transition-fast);
}

.payment-method:hover {
    background: rgba(46, 204, 113, 0.15);
    border-color: rgba(46, 204, 113, 0.5);
    transform: scale(1.02);
}

.payment-icon {
    font-size: 2rem;
    margin-right: 15px;
    animation: pulse 2s infinite;
}

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

.payment-title {
    color: #2ecc71;
    font-weight: bold;
    font-size: 1.1rem;
}

.payment-desc {
    color: var(--text-gray);
    font-size: 0.85rem;
}

/* Footer */
.form-footer {
    margin-top: 20px;
}

.back-link {
    color: var(--text-gray);
    text-decoration: none;
    transition: var(--transition-fast);
}

.back-link:hover {
    color: var(--primary-color);
    transform: translateX(-5px);
    display: inline-block;
}

/* Section Header */
.section-header {
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-title {
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: 600;
    position: relative;
    padding-bottom: 10px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 2px;
}

.balance-info {
    color: white;
    font-size: 1rem;
}

/* Proxy Card */
.proxy-card { 
    display: flex; 
    flex-direction: column; 
    justify-content: space-between; 
    text-align: center; 
    padding: 25px; 
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.proxy-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 123, 0, 0.05) 0%, transparent 70%);
    transform: scale(0);
    transition: var(--transition-slow);
}

.proxy-card:hover::before {
    transform: scale(1);
}

.proxy-card-body {
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.proxy-icon {
    font-size: 3rem;
    margin-bottom: 10px;
    transition: var(--transition-normal);
}

.proxy-card:hover .proxy-icon {
    transform: scale(1.15) rotate(5deg);
}

.proxy-title {
    color: var(--text-dark);
    margin-bottom: 10px;
    font-size: 1.2rem;
    font-weight: 600;
}

.proxy-card:hover { 
    transform: translateY(-8px); 
    border-color: var(--primary-color); 
    box-shadow: var(--shadow-xl);
}

.proxy-desc {
    color: var(--text-gray);
    font-size: 0.95rem;
    line-height: 1.5;
}

.proxy-desc .highlight {
    color: var(--primary-color);
    font-weight: 600;
}

/* Empty State */
.empty-text {
    color: var(--text-gray);
    text-align: center;
    padding: 40px 20px;
    font-size: 1rem;
}

/* --- AVATAR UPLOAD WRAPPER --- */
.avatar-wrapper {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 20px auto;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--secondary-bg);
    box-shadow: 0 4px 12px rgba(255, 123, 0, 0.2);
    transition: var(--transition-normal);
}

.avatar-wrapper:hover {
    border-color: var(--primary-color);
    box-shadow: 0 6px 20px rgba(255, 123, 0, 0.35);
    transform: scale(1.05);
}

.avatar-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-normal);
}

.avatar-wrapper:hover img {
    transform: scale(1.1);
}

.upload-btn {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: var(--transition-fast);
    font-size: 0.85rem;
    font-weight: 500;
}

.avatar-wrapper:hover .upload-btn {
    opacity: 1;
}

.upload-btn i {
    margin-right: 5px;
}

/* --- HEADER AVATAR --- */
.header-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--secondary-bg);
    box-shadow: 0 2px 8px rgba(255, 123, 0, 0.2);
    transition: var(--transition-fast);
}

/* --- DROPDOWN MENU --- */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    width: 220px;
    background: white;
    box-shadow: var(--shadow-xl);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    padding: 8px 0;
    z-index: 1000;
    margin-top: 10px;
    animation: dropdownSlide 0.3s ease;
}

/* Tạo lớp nền trong suốt nối liền khoảng trống */
.dropdown-menu::before {
    content: "";
    display: block;
    position: absolute;
    top: -20px;  /* Đẩy lên trên để lấp khoảng trống margin 10px */
    left: 0;
    width: 100%;
    height: 20px; /* Chiều cao đủ che khoảng hở */
    background: transparent; /* Trong suốt */
}

@keyframes dropdownSlide {
    from { 
        opacity: 0; 
        transform: translateY(-10px) scale(0.95);
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1);
    }
}

.user-dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--text-dark);
    font-size: 0.9rem;
    transition: var(--transition-fast);
    position: relative;
    text-decoration: none; /* Xóa gạch chân */
}

.dropdown-menu a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: var(--primary-color);
    transform: scaleY(0);
    transition: var(--transition-fast);
}

.dropdown-menu a:hover {
    background-color: var(--secondary-bg);
    color: var(--primary-color);
    padding-left: 23px;
    text-decoration: none; /* Đảm bảo không có gạch chân khi hover */
}

.dropdown-menu a:hover::before {
    transform: scaleY(1);
}

.dropdown-menu a i {
    width: 20px;
    margin-right: 10px;
    color: var(--text-gray);
    transition: var(--transition-fast);
}

.dropdown-menu a:hover i {
    color: var(--primary-color);
    transform: scale(1.1);
}

.dropdown-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
    margin: 8px 0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    #sidebar { margin-left: calc(var(--sidebar-width) * -1); }
    #sidebar.toggled { margin-left: 0; }
    #content-wrapper { margin-left: 0; }
    #content-wrapper.toggled { margin-left: 0; }
    .sidebar-brand { justify-content: flex-start; padding-left: 20px; }
    
    main { padding: 20px 15px; }
    header { padding: 0 15px; }
    
    .grid-cards {
        grid-template-columns: 1fr;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .user-info {
        gap: 10px;
    }
    
    .balance-badge {
        font-size: 0.8rem;
        padding: 6px 12px;
    }
}
/* --- SIDEBAR DROPDOWN --- */
.sidebar-menu li { position: relative; }

/* Link chính của Dropdown */
.dropdown-toggle {
    display: flex;
    justify-content: space-between; /* Đẩy mũi tên sang phải */
    align-items: center;
    cursor: pointer;
}

/* Mũi tên xoay */
.dropdown-toggle .arrow {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

/* Khi menu mở thì xoay mũi tên */
.sidebar-menu li.open .dropdown-toggle .arrow {
    transform: rotate(90deg);
}

/* Menu con (ẩn mặc định) */
.submenu {
    display: none;
    list-style: none;
    padding-left: 20px; /* Thụt đầu dòng */
    background: rgba(0, 0, 0, 0.02); /* Màu nền nhẹ cho menu con */
    border-radius: 8px;
    margin-top: 5px;
}

.submenu li { margin-bottom: 2px; }

.submenu a {
    font-size: 0.9rem;
    padding: 8px 15px;
    color: var(--text-gray);
    border-left: 2px solid transparent; /* Đường viền trang trí */
}

.submenu a:hover, .submenu a.active {
    color: var(--primary-color);
    background: transparent;
    border-left-color: var(--primary-color);
}

/* Hiển thị menu con khi có class open */
.sidebar-menu li.open .submenu {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}