/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    font-size: var(--font-size-sm);
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn-sm {
    padding: var(--space-xs) var(--space-md);
    font-size: var(--font-size-xs);
}

.btn-lg {
    padding: var(--space-md) var(--space-xl);
    font-size: var(--font-size-base);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-blue-dark));
    color: var(--white);
    box-shadow: 0 2px 4px rgba(4, 89, 180, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-blue-light), var(--primary-blue));
    box-shadow: 0 4px 8px rgba(4, 89, 180, 0.4);
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, var(--primary-green), var(--primary-green-dark));
    color: var(--white);
    box-shadow: 0 2px 4px rgba(118, 188, 28, 0.3);
}

.btn-success:hover {
    background: linear-gradient(135deg, var(--primary-green-light), var(--primary-green));
    box-shadow: 0 4px 8px rgba(118, 188, 28, 0.4);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.btn-secondary:hover {
    background: var(--gray-200);
}

.btn-outline {
    background: transparent;
    color: var(--primary-blue);
    border: 1px solid var(--primary-blue);
}

.btn-outline:hover {
    background: var(--primary-blue);
    color: var(--white);
}

.btn-danger {
    background: var(--error);
    color: var(--white);
}

.btn-danger:hover {
    background: #dc2626;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Input Styles */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: var(--space-xs);
}

.form-input {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: var(--space-sm) var(--space-md);
    font-size: var(--font-size-base);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    background: var(--white);
    transition: all var(--transition-fast);
}

.form-input:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(4, 89, 180, 0.1);
    outline: none;
}

.form-input::placeholder {
    color: var(--gray-400);
}

.form-input.error {
    border-color: var(--error);
}

.form-error {
    font-size: var(--font-size-sm);
    color: var(--error);
    margin-top: var(--space-xs);
}

.form-hint {
    font-size: var(--font-size-sm);
    color: var(--gray-500);
    margin-top: var(--space-xs);
}

/* Select */
.form-select {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    font-size: var(--font-size-base);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    background: var(--white);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6,9 12,15 18,9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--space-sm) center;
    background-size: 20px;
    padding-right: var(--space-2xl);
}

.form-select:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(4, 89, 180, 0.1);
    outline: none;
}

/* Card Styles */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

.card-header {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.card-body {
    padding: var(--space-lg);
}

.card-footer {
    padding: var(--space-lg);
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
}

/* Stats Card */
.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-xl);
    margin-bottom: var(--space-md);
}

.stat-card .stat-icon.blue {
    background: rgba(4, 89, 180, 0.1);
    color: var(--primary-blue);
}

.stat-card .stat-icon.green {
    background: rgba(118, 188, 28, 0.1);
    color: var(--primary-green);
}

.stat-card .stat-value {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--gray-900);
}

.stat-card .stat-label {
    font-size: var(--font-size-sm);
    color: var(--gray-500);
    margin-top: var(--space-xs);
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-xs) var(--space-sm);
    font-size: var(--font-size-xs);
    font-weight: 500;
    line-height: 1.4;
    white-space: nowrap;
    border-radius: var(--radius-full);
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.badge-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.badge-info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
}

.badge-primary {
    background: rgba(4, 89, 180, 0.1);
    color: var(--primary-blue);
}

/* Table */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
}

.table {
    width: 100%;
    background: var(--white);
}

.table th {
    padding: var(--space-md) var(--space-lg);
    text-align: left;
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--gray-600);
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.table td {
    padding: var(--space-md) var(--space-lg);
    font-size: var(--font-size-sm);
    color: var(--gray-700);
    border-bottom: 1px solid var(--gray-100);
}

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

.table tr:hover td {
    background: var(--gray-50);
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform var(--transition-fast);
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--gray-900);
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

.modal-body {
    padding: var(--space-lg);
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    padding: var(--space-lg);
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
}

/* Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-sm {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

.spinner-lg {
    width: 60px;
    height: 60px;
    border-width: 4px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.spinner-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    z-index: var(--z-modal);
}

.spinner-text {
    font-size: var(--font-size-sm);
    color: var(--gray-600);
}

/* Toast */
.toast-container {
    position: fixed;
    top: var(--space-lg);
    right: var(--space-lg);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.toast {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    background: var(--white);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    min-width: 300px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-success {
    border-left: 4px solid var(--success);
}

.toast-error {
    border-left: 4px solid var(--error);
}

.toast-warning {
    border-left: 4px solid var(--warning);
}

.toast-info {
    border-left: 4px solid var(--info);
}

.toast-icon {
    font-size: var(--font-size-lg);
}

.toast-success .toast-icon { color: var(--success); }
.toast-error .toast-icon { color: var(--error); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-info .toast-icon { color: var(--info); }

.toast-message {
    flex: 1;
    font-size: var(--font-size-sm);
    color: var(--gray-700);
}

.toast-close {
    color: var(--gray-400);
    transition: color var(--transition-fast);
}

.toast-close:hover {
    color: var(--gray-600);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--space-3xl);
}

.empty-state-icon {
    font-size: 4rem;
    color: var(--gray-300);
    margin-bottom: var(--space-lg);
}

.empty-state-title {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: var(--space-sm);
}

.empty-state-text {
    font-size: var(--font-size-sm);
    color: var(--gray-500);
    margin-bottom: var(--space-lg);
}

/* Avatar */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-green));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 600;
    font-size: var(--font-size-sm);
}

.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: var(--font-size-xs);
}

.avatar-lg {
    width: 56px;
    height: 56px;
    font-size: var(--font-size-lg);
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 200px;
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-200);
    padding: var(--space-xs) 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-fast);
    z-index: var(--z-dropdown);
}

.dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    font-size: var(--font-size-sm);
    color: var(--gray-700);
    transition: background var(--transition-fast);
    width: 100%;
}

.dropdown-item:hover {
    background: var(--gray-50);
}

.dropdown-item i {
    width: 20px;
    text-align: center;
    color: var(--gray-500);
}

.dropdown-divider {
    height: 1px;
    background: var(--gray-200);
    margin: var(--space-xs) 0;
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    color: var(--gray-400);
    font-size: var(--font-size-sm);
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gray-200);
}

#turnstileWidget {
    display: flex;
    justify-content: center;
}

/* --- Sự kiện khuyến mãi nạp tiền (banner / ví) --- */
/* padding-top khi nằm dưới nav cố định: định nghĩa ở home.css (.home-page > .deposit-promo-home-wrap) */
.deposit-promo-home-wrap {
    padding-bottom: 0;
}

.deposit-promo-banner {
    border-radius: var(--radius-md);
    border: 1px solid rgba(5, 150, 105, 0.35);
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.09), rgba(4, 89, 180, 0.07));
    padding: var(--space-sm) 0;
}

.deposit-promo-banner-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.deposit-promo-banner-item:last-child {
    border-bottom: none;
}

.deposit-promo-banner-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: rgba(5, 150, 105, 0.15);
    color: #059669;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.deposit-promo-banner-body {
    flex: 1;
    min-width: 0;
}

.deposit-promo-banner-title {
    font-weight: 600;
    font-size: var(--font-size-base);
    color: var(--gray-800);
    margin-bottom: var(--space-xs);
}

.deposit-promo-banner-line,
.deposit-promo-banner-meta {
    font-size: var(--font-size-sm);
    color: var(--gray-700);
    line-height: 1.45;
}

.deposit-promo-banner-meta {
    color: var(--gray-600);
    margin-top: 4px;
}

.deposit-promo-banner-dates {
    font-size: var(--font-size-xs);
}

.deposit-promo-banner-actions {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-xs);
}

@media (max-width: 640px) {
    .deposit-promo-banner-item {
        flex-wrap: wrap;
    }
    .deposit-promo-banner-actions {
        width: 100%;
        flex-direction: row;
        justify-content: flex-end;
    }
}

.wallet-deposit-promo-section {
    margin-bottom: var(--space-xl);
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    border: 1px solid rgba(4, 89, 180, 0.2);
    background: linear-gradient(180deg, rgba(4, 89, 180, 0.06), rgba(5, 150, 105, 0.04));
}

.wallet-deposit-promo-heading {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--gray-800);
    margin: 0 0 var(--space-md) 0;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.wallet-deposit-promo-heading i {
    color: var(--primary-blue);
}

.wallet-deposit-promo-card {
    padding: var(--space-md);
    border-radius: var(--radius-md);
    background: var(--white);
    border: 1px solid var(--gray-200);
    margin-bottom: var(--space-md);
}

.wallet-deposit-promo-card:last-child {
    margin-bottom: 0;
}

.wallet-deposit-promo-card-title {
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: var(--space-sm);
}

.wallet-deposit-promo-card-lead,
.wallet-deposit-promo-card-meta,
.wallet-deposit-promo-card-dates {
    font-size: var(--font-size-sm);
    color: var(--gray-600);
    line-height: 1.5;
    margin: 0 0 var(--space-xs) 0;
}

.wallet-deposit-promo-card-dates {
    font-size: var(--font-size-xs);
    color: var(--gray-500);
    margin-bottom: 0;
}

.wallet-deposit-promo-card-dates i {
    margin-right: 4px;
    color: var(--primary-blue);
}