/* WooCommerce Affiliate - Frontend Styles */
/* Modern Dashboard Design with Theme Override */

:root {
    --woo-aff-primary: #4F46E5;
    --woo-aff-primary-dark: #4338CA;
    --woo-aff-primary-light: #EEF2FF;
    --woo-aff-success: #10B981;
    --woo-aff-success-light: #D1FAE5;
    --woo-aff-warning: #F59E0B;
    --woo-aff-warning-light: #FEF3C7;
    --woo-aff-danger: #EF4444;
    --woo-aff-danger-light: #FEE2E2;
    --woo-aff-info: #3B82F6;
    --woo-aff-info-light: #DBEAFE;
    --woo-aff-gray-50: #F9FAFB;
    --woo-aff-gray-100: #F3F4F6;
    --woo-aff-gray-200: #E5E7EB;
    --woo-aff-gray-300: #D1D5DB;
    --woo-aff-gray-400: #9CA3AF;
    --woo-aff-gray-500: #6B7280;
    --woo-aff-gray-600: #4B5563;
    --woo-aff-gray-700: #374151;
    --woo-aff-gray-800: #1F2937;
    --woo-aff-gray-900: #111827;
    --woo-aff-radius: 12px;
    --woo-aff-radius-sm: 8px;
    --woo-aff-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --woo-aff-shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --woo-aff-shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

/* ============================================
   THEME OVERRIDE - WRAPPER
   Bọc ngoài toàn bộ dashboard để override theme
   ============================================ */
.woo-aff-wrapper {
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.5;
    color: var(--woo-aff-gray-800);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.woo-aff-wrapper *,
.woo-aff-wrapper *::before,
.woo-aff-wrapper *::after {
    box-sizing: border-box;
}

/* ============================================
   THEME OVERRIDE - INPUT, SELECT, TEXTAREA
   ============================================ */
.woo-aff-wrapper input[type="text"],
.woo-aff-wrapper input[type="email"],
.woo-aff-wrapper input[type="password"],
.woo-aff-wrapper input[type="number"],
.woo-aff-wrapper input[type="tel"],
.woo-aff-wrapper input[type="url"],
.woo-aff-wrapper input[type="search"],
.woo-aff-wrapper input[type="date"],
.woo-aff-wrapper textarea,
.woo-aff-wrapper select {
    display: block;
    width: 100%;
    height: auto;
    padding: 12px 16px;
    font-size: 14px;
    font-family: inherit;
    font-weight: 400;
    line-height: 1.5;
    color: var(--woo-aff-gray-700);
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid var(--woo-aff-gray-300);
    border-radius: var(--woo-aff-radius-sm);
    box-shadow: none;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    outline: none;
    margin: 0;
}

.woo-aff-wrapper input[type="text"]:focus,
.woo-aff-wrapper input[type="email"]:focus,
.woo-aff-wrapper input[type="password"]:focus,
.woo-aff-wrapper input[type="number"]:focus,
.woo-aff-wrapper input[type="tel"]:focus,
.woo-aff-wrapper input[type="url"]:focus,
.woo-aff-wrapper input[type="search"]:focus,
.woo-aff-wrapper input[type="date"]:focus,
.woo-aff-wrapper textarea:focus,
.woo-aff-wrapper select:focus {
    border-color: var(--woo-aff-primary);
    box-shadow: 0 0 0 3px var(--woo-aff-primary-light);
    background-color: #fff;
    outline: none;
}

.woo-aff-wrapper input::placeholder,
.woo-aff-wrapper textarea::placeholder {
    color: var(--woo-aff-gray-400);
    opacity: 1;
}

.woo-aff-wrapper input:disabled,
.woo-aff-wrapper textarea:disabled,
.woo-aff-wrapper select:disabled {
    background-color: var(--woo-aff-gray-100);
    color: var(--woo-aff-gray-500);
    cursor: not-allowed;
    opacity: 0.7;
}

.woo-aff-wrapper select {
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px 12px;
}

.woo-aff-wrapper textarea {
    min-height: 100px;
    resize: vertical;
}

/* ============================================
   THEME OVERRIDE - BUTTONS
   ============================================ */
.woo-aff-wrapper .woo-aff-btn,
.woo-aff-wrapper button[type="submit"],
.woo-aff-wrapper input[type="submit"],
.woo-aff-wrapper .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-family: inherit;
    font-weight: 600;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    border: none;
    border-radius: var(--woo-aff-radius-sm);
    transition: all 0.2s ease-in-out;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    outline: none;
    box-shadow: none;
	margin-bottom:0!important;
}

.woo-aff-wrapper .woo-aff-btn-primary,
.woo-aff-wrapper button[type="submit"],
.woo-aff-wrapper input[type="submit"] {
    background: var(--woo-aff-primary);
    color: #fff !important;
	margin-bottom:0!important;
}

.woo-aff-wrapper .woo-aff-btn-primary:hover,
.woo-aff-wrapper button[type="submit"]:hover,
.woo-aff-wrapper input[type="submit"]:hover {
    background: var(--woo-aff-primary-dark);
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: var(--woo-aff-shadow-md);
}

.woo-aff-wrapper .woo-aff-btn-primary:active,
.woo-aff-wrapper button[type="submit"]:active,
.woo-aff-wrapper input[type="submit"]:active {
    transform: translateY(0);
}

.woo-aff-wrapper .woo-aff-btn-primary:disabled,
.woo-aff-wrapper button[type="submit"]:disabled,
.woo-aff-wrapper input[type="submit"]:disabled {
    background: var(--woo-aff-gray-300);
    color: var(--woo-aff-gray-500) !important;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

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

.woo-aff-wrapper .woo-aff-btn-secondary:hover {
    background: var(--woo-aff-gray-200);
    color: var(--woo-aff-gray-800) !important;
}

.woo-aff-wrapper .woo-aff-btn-success {
    background: var(--woo-aff-success);
    color: #fff !important;
}

.woo-aff-wrapper .woo-aff-btn-success:hover {
    background: #059669;
    color: #fff !important;
}

.woo-aff-wrapper .woo-aff-btn-block {
    display: flex;
    width: 100%;
}

.woo-aff-wrapper .woo-aff-btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.woo-aff-wrapper .woo-aff-btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

/* ============================================
   THEME OVERRIDE - TABLES
   ============================================ */
.woo-aff-wrapper table,
.woo-aff-wrapper .woo-aff-table {
    width: 100%;
    margin: 0;
    padding: 0;
    border-collapse: separate;
    border-spacing: 0;
    border: none;
    background: transparent;
    font-size: 14px;
}

.woo-aff-wrapper table thead,
.woo-aff-wrapper .woo-aff-table thead {
    background: var(--woo-aff-gray-50);
}

.woo-aff-wrapper table thead th,
.woo-aff-wrapper .woo-aff-table thead th {
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--woo-aff-gray-500);
    background: var(--woo-aff-gray-50);
    border: none;
    border-bottom: 1px solid var(--woo-aff-gray-200);
    text-align: left;
    white-space: nowrap;
}

.woo-aff-wrapper table tbody td,
.woo-aff-wrapper .woo-aff-table tbody td {
    padding: 14px 16px;
    font-size: 14px;
    color: var(--woo-aff-gray-700);
    background: #fff;
    border: none;
    border-bottom: 1px solid var(--woo-aff-gray-100);
    vertical-align: middle;
}

.woo-aff-wrapper table tbody tr:last-child td,
.woo-aff-wrapper .woo-aff-table tbody tr:last-child td {
    border-bottom: none;
}

.woo-aff-wrapper table tbody tr:hover td,
.woo-aff-wrapper .woo-aff-table tbody tr:hover td {
    background: var(--woo-aff-gray-50);
}

/* Table Responsive Wrapper */
.woo-aff-wrapper .woo-aff-table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ============================================
   THEME OVERRIDE - LABELS & FORM GROUPS
   ============================================ */
.woo-aff-wrapper label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--woo-aff-gray-700);
}

.woo-aff-wrapper .woo-aff-form-group {
    margin-bottom: 20px;
}

.woo-aff-wrapper .woo-aff-form-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--woo-aff-gray-500);
}

.woo-aff-wrapper .woo-aff-form-error {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--woo-aff-danger);
}

/* ============================================
   THEME OVERRIDE - ALERTS
   ============================================ */
.woo-aff-wrapper .woo-aff-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--woo-aff-radius-sm);
    font-size: 14px;
    line-height: 1.5;
}

.woo-aff-wrapper .woo-aff-alert svg {
    flex-shrink: 0;
    margin-top: 2px;
}

.woo-aff-wrapper .woo-aff-alert.warning {
    background: var(--woo-aff-warning-light);
    color: #92400E;
    border: 1px solid #FCD34D;
}

.woo-aff-wrapper .woo-aff-alert.success {
    background: var(--woo-aff-success-light);
    color: #065F46;
    border: 1px solid #6EE7B7;
}

.woo-aff-wrapper .woo-aff-alert.error {
    background: var(--woo-aff-danger-light);
    color: #991B1B;
    border: 1px solid #FCA5A5;
}

.woo-aff-wrapper .woo-aff-alert.info {
    background: var(--woo-aff-info-light);
    color: #1E40AF;
    border: 1px solid #93C5FD;
}

/* ============================================
   DASHBOARD CONTAINER - FULL WIDTH
   ============================================ */
.woo-aff-dashboard {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
}

/* Header Section */
.woo-aff-dashboard-header {
    background: linear-gradient(135deg, var(--woo-aff-primary) 0%, #7C3AED 100%);
    border-radius: var(--woo-aff-radius);
    padding: 30px;
    margin-bottom: 24px;
    color: #fff;
}

.woo-aff-header-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.woo-aff-avatar {
    flex-shrink: 0;
}

.woo-aff-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.3);
    box-shadow: var(--woo-aff-shadow-md);
}

.woo-aff-header-info h1 {
    margin: 0 0 5px 0;
    font-size: 28px;
    font-weight: 700;
    color: #fff;
}

.woo-aff-subtitle {
    margin: 0 0 12px 0;
    font-size: 15px;
    opacity: 0.9;
}

.woo-aff-header-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.woo-aff-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    opacity: 0.85;
    background: rgba(255,255,255,0.15);
    padding: 5px 12px;
    border-radius: 20px;
}

.woo-aff-meta-item svg {
    width: 14px;
    height: 14px;
}

.woo-aff-commission-rate {
    background: rgba(255,255,255,0.25) !important;
    font-weight: 600;
}

/* Section Headers */
.woo-aff-section-header {
    margin-bottom: 16px;
}

.woo-aff-section-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 600;
    color: var(--woo-aff-gray-800);
    margin: 0;
}

.woo-aff-section-header h2 svg {
    color: var(--woo-aff-primary);
}

/* Referral Section */
.woo-aff-referral-section {
    background: #fff;
    border-radius: var(--woo-aff-radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--woo-aff-shadow);
    border: 1px solid var(--woo-aff-gray-200);
}

.woo-aff-referral-content {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 20px;
    align-items: end;
}

.woo-aff-referral-code label,
.woo-aff-referral-link label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--woo-aff-gray-600);
    margin-bottom: 8px;
}

.woo-aff-code-box {
    display: flex;
    align-items: center;
    gap: 10px;
}

.woo-aff-code {
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    font-size: 18px;
    font-weight: 700;
    color: var(--woo-aff-primary);
    background: var(--woo-aff-primary-light);
    padding: 12px 20px;
    border-radius: var(--woo-aff-radius-sm);
    letter-spacing: 1px;
}

.woo-aff-link-box {
    display: flex;
    gap: 10px;
}

.woo-aff-link-box input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--woo-aff-gray-300);
    border-radius: var(--woo-aff-radius-sm);
    font-size: 14px;
    color: var(--woo-aff-gray-700);
    background: var(--woo-aff-gray-50);
    transition: all 0.2s;
}

.woo-aff-link-box input:focus {
    outline: none;
    border-color: var(--woo-aff-primary);
    background: #fff;
    box-shadow: 0 0 0 3px var(--woo-aff-primary-light);
}

.woo-aff-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 20px;
    background: var(--woo-aff-primary);
    color: #fff;
    border: none;
    border-radius: var(--woo-aff-radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.woo-aff-copy-btn:hover {
    background: var(--woo-aff-primary-dark);
    transform: translateY(-1px);
}

.woo-aff-copy-btn.copied {
    background: var(--woo-aff-success);
}

/* Stats Section */
.woo-aff-stats-section {
    margin-bottom: 24px;
}

.woo-aff-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.woo-aff-stat-card {
    background: #fff;
    border-radius: var(--woo-aff-radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--woo-aff-shadow);
    border: 1px solid var(--woo-aff-gray-200);
    transition: all 0.2s;
}

.woo-aff-stat-card:hover {
    box-shadow: var(--woo-aff-shadow-md);
    transform: translateY(-2px);
}

.woo-aff-stat-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--woo-aff-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.woo-aff-stat-icon.clicks {
    background: #EDE9FE;
    color: #7C3AED;
}

.woo-aff-stat-icon.orders {
    background: #FEF3C7;
    color: #D97706;
}

.woo-aff-stat-icon.conversion {
    background: #D1FAE5;
    color: #059669;
}

.woo-aff-stat-icon.balance {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

.woo-aff-stat-content {
    flex: 1;
    min-width: 0;
}

.woo-aff-stat-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: var(--woo-aff-gray-900);
    line-height: 1.2;
}

.woo-aff-stat-label {
    display: block;
    font-size: 13px;
    color: var(--woo-aff-gray-500);
    margin-top: 4px;
}

.woo-aff-stat-card.featured {
    background: linear-gradient(135deg, var(--woo-aff-primary) 0%, #7C3AED 100%);
    border: none;
}

.woo-aff-stat-card.featured .woo-aff-stat-value,
.woo-aff-stat-card.featured .woo-aff-stat-label {
    color: #fff;
}

.woo-aff-stat-card.featured .woo-aff-stat-label {
    opacity: 0.85;
}

/* Commission Section */
.woo-aff-commission-section {
    margin-bottom: 24px;
}

.woo-aff-commission-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.woo-aff-commission-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px;
    border-radius: var(--woo-aff-radius);
    transition: all 0.2s;
}

.woo-aff-commission-card.pending {
    background: var(--woo-aff-warning-light);
    border: 1px solid #FCD34D;
}

.woo-aff-commission-card.approved {
    background: var(--woo-aff-success-light);
    border: 1px solid #6EE7B7;
}

.woo-aff-commission-card.paid {
    background: var(--woo-aff-info-light);
    border: 1px solid #93C5FD;
}

.woo-aff-commission-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.woo-aff-commission-card.pending .woo-aff-commission-icon {
    background: rgba(245, 158, 11, 0.2);
    color: var(--woo-aff-warning);
}

.woo-aff-commission-card.approved .woo-aff-commission-icon {
    background: rgba(16, 185, 129, 0.2);
    color: var(--woo-aff-success);
}

.woo-aff-commission-card.paid .woo-aff-commission-icon {
    background: rgba(59, 130, 246, 0.2);
    color: var(--woo-aff-info);
}

.woo-aff-commission-amount {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: var(--woo-aff-gray-900);
}

.woo-aff-commission-label {
    display: block;
    font-size: 13px;
    color: var(--woo-aff-gray-600);
    margin-top: 2px;
}

/* Two Column Layout */
.woo-aff-two-columns {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

.woo-aff-column {
    min-width: 0;
}

/* Card */
.woo-aff-card {
    background: #fff;
    border-radius: var(--woo-aff-radius);
    box-shadow: var(--woo-aff-shadow);
    border: 1px solid var(--woo-aff-gray-200);
    height: 100%;
}

.woo-aff-card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--woo-aff-gray-100);
}

.woo-aff-card-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: var(--woo-aff-gray-800);
    margin: 0;
}

.woo-aff-card-header h3 svg {
    color: var(--woo-aff-primary);
}

.woo-aff-card-body {
    padding: 24px;
}

/* Withdrawal Form */
.woo-aff-withdrawal-form .woo-aff-input-group {
    position: relative;
    display: flex;
    align-items: stretch;
}

.woo-aff-withdrawal-form .woo-aff-input-group input {
    width: 100%;
    padding: 14px 16px;
    font-size: 18px;
    font-weight: 600;
    border-radius: var(--woo-aff-radius-sm);
}

/* Bank Info */
.woo-aff-bank-info {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.woo-aff-bank-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--woo-aff-gray-100);
}

.woo-aff-bank-row:last-child {
    border-bottom: none;
}

.woo-aff-bank-label {
    font-size: 14px;
    color: var(--woo-aff-gray-500);
}

.woo-aff-bank-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--woo-aff-gray-800);
}

/* Table Sections */
.woo-aff-table-section {
    background: #fff;
    border-radius: var(--woo-aff-radius);
    box-shadow: var(--woo-aff-shadow);
    border: 1px solid var(--woo-aff-gray-200);
    margin-bottom: 24px;
    overflow: hidden;
}

.woo-aff-table-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--woo-aff-gray-100);
}

.woo-aff-table-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: var(--woo-aff-gray-800);
    margin: 0;
}

.woo-aff-table-header h3 svg {
    color: var(--woo-aff-primary);
}

/* Status Badges */
.woo-aff-status {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
}

.woo-aff-status.status-pending {
    background: var(--woo-aff-warning-light);
    color: #B45309;
}

.woo-aff-status.status-approved {
    background: var(--woo-aff-success-light);
    color: #047857;
}

.woo-aff-status.status-rejected {
    background: var(--woo-aff-danger-light);
    color: #B91C1C;
}

.woo-aff-status.status-paid {
    background: var(--woo-aff-info-light);
    color: #1D4ED8;
}

/* Empty State */
.woo-aff-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--woo-aff-gray-400);
}

.woo-aff-empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

/* Load More */
.woo-aff-load-more {
    text-align: center;
    padding: 16px;
    border-top: 1px solid var(--woo-aff-gray-100);
}

.woo-aff-load-more a {
    color: var(--woo-aff-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
}

.woo-aff-load-more a:hover {
    text-decoration: underline;
}

/* ============================================
   MODAL
   ============================================ */
.woo-aff-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.woo-aff-modal-overlay.active {
    display: flex;
}

.woo-aff-modal-box {
    background: #fff;
    border-radius: var(--woo-aff-radius);
    box-shadow: var(--woo-aff-shadow-lg);
    width: 90%;
    max-width: 440px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.95);
    transition: all 0.3s ease;
}

.woo-aff-modal-overlay.active .woo-aff-modal-box {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.woo-aff-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: var(--woo-aff-gray-100);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.woo-aff-modal-close:hover {
    background: var(--woo-aff-gray-200);
}

.woo-aff-auth-form {
    padding: 32px;
    display: none;
}

.woo-aff-auth-form.active {
    display: block;
}

.woo-aff-auth-form h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--woo-aff-gray-900);
    margin: 0 0 8px 0;
    text-align: center;
}

.woo-aff-auth-form > p {
    text-align: center;
    color: var(--woo-aff-gray-500);
    margin: 0 0 24px 0;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1200px) {
    .woo-aff-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .woo-aff-commission-cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .woo-aff-two-columns {
        grid-template-columns: 1fr;
    }
    
    .woo-aff-commission-cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .woo-aff-dashboard {
        padding: 16px;
    }
    
    .woo-aff-header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .woo-aff-header-meta {
        justify-content: center;
    }
    
    .woo-aff-header-info h1 {
        font-size: 22px;
    }
    
    .woo-aff-referral-content {
        grid-template-columns: 1fr;
    }
    
    .woo-aff-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .woo-aff-stat-card {
        padding: 16px;
    }
    
    .woo-aff-stat-value {
        font-size: 20px;
    }
    
    .woo-aff-commission-cards {
        grid-template-columns: 1fr;
    }
    
    .woo-aff-code {
        font-size: 16px;
        padding: 10px 16px;
    }
    
    /* Table Responsive */
    .woo-aff-wrapper .woo-aff-table-responsive {
        margin: 0 -16px;
        padding: 0 16px;
    }
    
    .woo-aff-wrapper table thead th,
    .woo-aff-wrapper .woo-aff-table thead th {
        padding: 10px 12px;
        font-size: 10px;
    }
    
    .woo-aff-wrapper table tbody td,
    .woo-aff-wrapper .woo-aff-table tbody td {
        padding: 12px;
        font-size: 13px;
    }
}

@media (max-width: 576px) {
    .woo-aff-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .woo-aff-code-box,
    .woo-aff-link-box {
        flex-direction: column;
    }
    
    .woo-aff-copy-btn {
        width: 100%;
        justify-content: center;
    }
    
    .woo-aff-card-header,
    .woo-aff-card-body,
    .woo-aff-table-header {
        padding: 16px;
    }
    
    .woo-aff-withdrawal-form .woo-aff-input-group input {
        font-size: 16px;
    }
    
    /* Hide some columns on mobile */
    .woo-aff-wrapper table.woo-aff-hide-cols-mobile th:nth-child(5),
    .woo-aff-wrapper table.woo-aff-hide-cols-mobile td:nth-child(5) {
        display: none;
    }
}

@media (max-width: 480px) {
    .woo-aff-dashboard {
        padding: 12px;
    }
    
    .woo-aff-dashboard-header {
        padding: 20px;
    }
    
    .woo-aff-avatar img {
        width: 60px;
        height: 60px;
    }
    
    .woo-aff-header-info h1 {
        font-size: 20px;
    }
    
    .woo-aff-meta-item {
        font-size: 12px;
        padding: 4px 10px;
    }
}

/* ============================================
   PRODUCT COMMISSION DISPLAY STYLES
   Hiển thị hoa hồng trên sản phẩm (Loop & Single)
   ============================================ */

/* Commission Badge trên Product Loop */
.woo-aff-commission-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
    padding: 8px 12px;
    background: linear-gradient(135deg, var(--woo-aff-success-light) 0%, #A7F3D0 100%);
    border: 1px solid #6EE7B7;
    border-radius: var(--woo-aff-radius-sm);
    font-size: 12px;
    text-align: center;
}

.woo-aff-commission-badge .commission-rate {
    font-weight: 600;
    color: #047857;
}

.woo-aff-commission-badge .commission-amount {
    color: #059669;
    font-size: 11px;
}

/* Commission Info trên Single Product */
.woo-aff-commission-info-single {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0;
    padding: 10px 16px;
    background: var(--woo-aff-success-light);
    border: 1px solid #6EE7B7;
    border-radius: var(--woo-aff-radius-sm);
    font-size: 14px;
}

.woo-aff-commission-info-single .dashicons {
    color: var(--woo-aff-success);
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.woo-aff-commission-info-single .commission-text {
    color: #047857;
}

.woo-aff-commission-info-single .commission-text strong {
    color: #065F46;
}

.woo-aff-commission-info-single .commission-amount {
    color: #059669;
    font-size: 13px;
    margin-left: 4px;
}

/* Affiliate Box trên Single Product */
.woo-aff-product-affiliate-box {
    margin: 20px 0;
    padding: 20px;
    background: linear-gradient(135deg, var(--woo-aff-primary-light) 0%, #E0E7FF 100%);
    border: 1px solid #C7D2FE;
    border-radius: var(--woo-aff-radius);
}

.woo-aff-product-affiliate-box h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--woo-aff-primary-dark);
}

.woo-aff-product-affiliate-box h4 .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.woo-aff-link-input-wrap {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.woo-aff-link-input {
    flex: 1;
    padding: 12px 14px;
    border: 1px solid #C7D2FE;
    border-radius: var(--woo-aff-radius-sm);
    font-size: 13px;
    color: var(--woo-aff-gray-700);
    background: #fff;
}

.woo-aff-link-input:focus {
    outline: none;
    border-color: var(--woo-aff-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.woo-aff-copy-link.button {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    padding: 10px 18px !important;
    background: var(--woo-aff-primary) !important;
    color: #fff !important;
    border: none !important;
    border-radius: var(--woo-aff-radius-sm) !important;
    font-weight: 500 !important;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.woo-aff-copy-link.button:hover {
    background: var(--woo-aff-primary-dark) !important;
    transform: translateY(-1px);
}

.woo-aff-copy-link.button .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.woo-aff-copy-link.button.copied {
    background: var(--woo-aff-success) !important;
}

/* Affiliate Details */
.woo-aff-affiliate-details {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(79, 70, 229, 0.15);
}

.woo-aff-affiliate-details p {
    margin: 0;
    font-size: 13px;
    color: var(--woo-aff-gray-600);
}

.woo-aff-affiliate-details .label {
    color: var(--woo-aff-gray-500);
    margin-right: 4px;
}

.woo-aff-affiliate-details code {
    background: #fff;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--woo-aff-primary);
    border: 1px solid #C7D2FE;
}

.woo-aff-affiliate-details small {
    color: var(--woo-aff-gray-400);
    font-size: 11px;
    margin-left: 4px;
}

.woo-aff-commission-info strong {
    color: var(--woo-aff-success);
}

.woo-aff-commission-info .amount {
    color: var(--woo-aff-gray-500);
    font-size: 12px;
}

/* Copy Link Wrap trên Product Loop */
.woo-aff-copy-link-wrap {
    margin-top: 10px;
    text-align: center;
}

.woo-aff-copy-link-wrap .woo-aff-copy-link {
    font-size: 12px !important;
    padding: 8px 14px !important;
}

.woo-aff-copy-link-wrap .woo-aff-copy-link .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

/* Status Badge */
.woo-aff-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
}

.woo-aff-status-badge.status-pending {
    background: var(--woo-aff-warning-light);
    color: #B45309;
}

.woo-aff-status-badge.status-approved {
    background: var(--woo-aff-success-light);
    color: #047857;
}

.woo-aff-status-badge.status-rejected {
    background: var(--woo-aff-danger-light);
    color: #B91C1C;
}

.woo-aff-status-badge.status-processing {
    background: var(--woo-aff-info-light);
    color: #1D4ED8;
}

/* Responsive for Product Commission */
@media (max-width: 768px) {
    .woo-aff-product-affiliate-box {
        padding: 16px;
    }
    
    .woo-aff-link-input-wrap {
        flex-direction: column;
    }
    
    .woo-aff-copy-link.button {
        width: 100%;
        justify-content: center;
    }
    
    .woo-aff-affiliate-details {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .woo-aff-commission-info-single {
        flex-wrap: wrap;
        font-size: 13px;
    }
}