/* Affiliate Page Styles - Clean Responsive Design */

/* Ensure header matches dashboard exactly */
.dashboard-header {
    background: var(--dark-surface) !important;
    border-bottom: 1px solid var(--border-color) !important;
}

/* ============================================
   MAIN CONTENT CONTAINER
   ============================================ */
.affiliate-content {
    display: block;
    padding: 40px 20px 10px 20px; /* Reduced bottom padding */
    max-width: 1000px;
    margin: 0 auto;
    min-height: calc(100vh - 100px);
    width: 100%;
    box-sizing: border-box;
    position: relative;
    overflow: visible;
}

/* Ensure content doesn't go under fixed header */
body.dashboard-body .dashboard-main {
    padding-top: 80px !important;
}

@media (max-width: 768px) {
    body.dashboard-body .dashboard-main {
        padding-top: 75px !important;
    }
}

/* Ensure dashboard-main respects bottom nav on mobile for affiliate page */
@media (max-width: 768px) {
    .dashboard-main:has(.affiliate-content) {
        padding-bottom: 70px !important; /* Keep space for bottom nav */
    }
}

/* Only hide when inside dashboard and not active */
.dashboard-main .affiliate-content {
    display: none !important;
}

.dashboard-main .affiliate-content.active {
    display: block !important;
}

/* Ensure content is visible on affiliate.php page */
.dashboard-main .affiliate-content {
    display: block !important;
}

/* ============================================
   NAVIGATION TABS
   ============================================ */
.affiliate-nav-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 30px;
    background: rgba(15, 15, 35, 0.6);
    padding: 0;
    border-radius: 12px;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: stretch;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.affiliate-tab {
    flex: 1;
    min-width: 0;
    padding: 12px 8px;
    background: transparent;
    border: none;
    border-radius: 0;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    position: relative;
    z-index: 1;
    margin: 0;
}

.affiliate-tab-icon {
    width: 48px;
    height: 48px;
    object-fit: contain;
    display: block;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
    opacity: 0.8;
    filter: brightness(0.9);
}

.affiliate-tab:hover {
    color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.02);
}

.affiliate-tab:hover .affiliate-tab-icon {
    opacity: 0.95;
    filter: brightness(1);
    transform: translateY(-2px);
}

.affiliate-tab.active {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.15), rgba(59, 130, 246, 0.1));
    color: rgba(255, 255, 255, 1);
    border-bottom: 2px solid rgba(59, 130, 246, 0.4);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.affiliate-tab.active:first-child {
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

.affiliate-tab.active:last-child {
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

.affiliate-tab.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.6), rgba(37, 99, 235, 0.4));
    border-radius: 0;
}

.affiliate-tab.active .affiliate-tab-icon {
    opacity: 1;
    filter: brightness(1.1);
    transform: scale(1.05);
}

.affiliate-tab span {
    display: block;
    white-space: nowrap;
    font-weight: 500;
    font-size: 13px;
    letter-spacing: 0.3px;
    position: relative;
    z-index: 1;
    margin-top: 2px;
}

/* ============================================
   TAB CONTENT
   ============================================ */
.affiliate-tab-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

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

.affiliate-tab-content.active {
    display: block;
}

/* ============================================
   BANNER SECTION
   ============================================ */
.affiliate-banner-container {
    position: relative;
    width: 100%;
    min-height: 500px;
    margin: 0 auto 30px auto;
    border-radius: 12px;
    overflow: hidden;
    background-image: url('../images/invite.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #0F0F23;
    padding: 35px 40px;
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
}

.affiliate-banner-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 15, 35, 0.2);
    z-index: 1;
    pointer-events: none;
}

.affiliate-banner-content {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 25px;
    z-index: 2;
    align-items: flex-start;
    justify-content: center;
}

/* ============================================
   CONTRACT CHECKBOX
   ============================================ */
.affiliate-contract-checkbox {
    margin-bottom: 0;
    padding: 0;
    background: transparent;
    border-radius: 0;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.affiliate-contract-label {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 19px;
    cursor: pointer;
    font-weight: 700;
    line-height: 1.6;
    justify-content: flex-start;
    width: auto;
    letter-spacing: 0.2px;
}

.affiliate-contract-label input[type="checkbox"] {
    width: 22px;
    height: 22px;
    cursor: pointer;
    accent-color: #2563eb;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    position: relative;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    margin: 0;
}

.affiliate-contract-label input[type="checkbox"]::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 10px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: translate(-50%, -60%) rotate(45deg) scale(0);
    transition: transform 0.2s ease;
    opacity: 0;
}

.affiliate-contract-label input[type="checkbox"]:checked {
    background: #2563eb;
    border-color: #2563eb;
}

.affiliate-contract-label input[type="checkbox"]:checked::before {
    transform: translate(-50%, -60%) rotate(45deg) scale(1);
    opacity: 1;
}

.affiliate-contract-label input[type="checkbox"]:hover {
    border-color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.08);
}

.affiliate-contract-label input[type="checkbox"]:checked:hover {
    background: #2563eb;
    border-color: #2563eb;
}

.affiliate-contract-link {
    color: #2563eb;
    text-decoration: underline;
    cursor: pointer;
    transition: color 0.2s ease;
    font-weight: 700;
    text-underline-offset: 3px;
}

.affiliate-contract-link:hover {
    color: #3b82f6;
}

/* ============================================
   REFERRAL LINK SECTION
   ============================================ */
.affiliate-referral-section {
    background: transparent;
    border-radius: 0;
    padding: 0;
    margin-bottom: 0;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.affiliate-section-title {
    font-size: 15px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-start;
    width: auto;
    letter-spacing: 0.2px;
    text-align: left;
}

.affiliate-section-title i {
    color: rgba(255, 255, 255, 0.9);
    font-size: 18px;
}

.affiliate-referral-link-wrapper {
    display: flex;
    gap: 0;
    margin-bottom: 0;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
    justify-content: flex-start;
}

.affiliate-referral-link-input {
    flex: 1;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px 0 0 8px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-family: inherit;
    min-height: 36px;
    box-sizing: border-box;
    font-weight: 400;
    transition: all 0.2s ease;
    min-width: 0;
    width: 100%;
}

.affiliate-referral-link-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
}

.affiliate-copy-btn {
    padding: 0;
    background: #2563eb;
    border: none;
    border-left: none;
    border-radius: 0 8px 8px 0;
    color: #ffffff;
    cursor: pointer;
    transition: transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 36px;
    box-sizing: border-box;
    flex-shrink: 0;
}

.affiliate-copy-btn:hover {
    background: #2563eb;
    color: #ffffff;
    transform: scale(0.95);
}

.affiliate-copy-btn:active {
    transform: scale(0.9);
}

.affiliate-copy-btn i {
    font-size: 20px;
}

/* ============================================
   QR CODE SECTION
   ============================================ */
.affiliate-qr-section {
    background: transparent;
    border-radius: 0;
    padding: 0;
    margin-bottom: 0;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.affiliate-qr-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 15px;
    cursor: pointer;
    width: 100%;
    max-width: 100%;
    gap: 10px;
}

.affiliate-qr-toggle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    transition: transform 0.3s ease;
    cursor: pointer;
    padding: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.affiliate-qr-toggle.active {
    transform: rotate(180deg);
}

.affiliate-qr-content {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-start;
    width: 100%;
    max-width: 100%;
}

.affiliate-qr-code-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.affiliate-qr-code {
    background: #fff;
    padding: 5px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 5px solid #000000;
}

.affiliate-qr-code img {
    width: 110px;
    height: 110px;
    display: block;
    border-radius: 4px;
}

.affiliate-qr-actions {
    display: flex;
    flex-direction: column;
    gap: 0;
    align-items: flex-start;
    justify-content: center;
    height: 100%;
}

.affiliate-save-qr-btn {
    padding: 12.48px 24.96px;
    background: #10b981;
    border: none;
    border-radius: 8px;
    color: #ffffff;
    cursor: pointer;
    transition: transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 700;
    font-size: 14.56px;
    white-space: nowrap;
    height: auto;
    letter-spacing: 0.2px;
}

.affiliate-save-qr-btn:hover {
    background: #10b981;
    transform: scale(0.95);
}

.affiliate-save-qr-btn:active {
    transform: scale(0.9);
}

/* ============================================
   SHARE SECTION
   ============================================ */
.affiliate-share-section {
    background: transparent;
    border-radius: 0;
    padding: 0;
    margin-bottom: 0;
    margin-top: auto;
    width: 100%;
    box-sizing: border-box;
    padding-top: 12.5px;
}

.affiliate-share-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    justify-content: flex-start;
    flex-wrap: wrap;
    width: 100%;
}

.affiliate-share-section .affiliate-section-title {
    margin-bottom: 0;
    font-weight: 700;
    white-space: nowrap;
    font-size: 17px;
    width: auto;
    flex-shrink: 0;
}

.affiliate-share-section .affiliate-section-title strong {
    font-weight: 700;
    letter-spacing: 0.5px;
}

.affiliate-share-buttons {
    display: flex;
    flex-direction: row;
    gap: 12px;
    align-items: center;
}

.affiliate-share-btn {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s ease;
    text-decoration: none;
    flex-shrink: 0;
    background: rgba(37, 99, 235, 0.2);
    color: rgba(255, 255, 255, 0.9);
}

.affiliate-share-btn:hover {
    background: rgba(37, 99, 235, 0.3);
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
}

.affiliate-share-btn.whatsapp,
.affiliate-share-btn.facebook,
.affiliate-share-btn.telegram {
    background: rgba(37, 99, 235, 0.2);
    color: #ffffff;
}

.affiliate-share-btn.whatsapp:hover,
.affiliate-share-btn.facebook:hover,
.affiliate-share-btn.telegram:hover {
    background: rgba(37, 99, 235, 0.3);
}

/* ============================================
   BONUS SECTION
   ============================================ */
.affiliate-bonus-section {
    background: rgba(37, 99, 235, 0.05);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid rgba(59, 130, 246, 0.2);
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.1);
}

.affiliate-bonus-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 25px;
}

.affiliate-bonus-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.affiliate-bonus-label {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
}

.affiliate-bonus-amount {
    font-size: 36px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    letter-spacing: 0.5px;
}

.affiliate-bonus-actions {
    display: flex;
    gap: 15px;
}

.affiliate-bonus-btn {
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s ease;
    font-size: 15px;
    color: #ffffff;
}

.affiliate-bonus-btn.withdraw {
    background: #10b981;
    color: #ffffff;
}

.affiliate-bonus-btn.withdraw:hover {
    background: #10b981;
    transform: scale(0.95);
}

.affiliate-bonus-btn.withdraw:active {
    transform: scale(0.9);
}

.affiliate-bonus-btn.transfer {
    background: #ef4444;
    color: #ffffff;
}

.affiliate-bonus-btn.transfer:hover {
    background: #ef4444;
    transform: scale(0.95);
}

.affiliate-bonus-btn.transfer:active {
    transform: scale(0.9);
}

.affiliate-bonus-message {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    text-align: center;
}

.affiliate-bonus-message strong {
    font-weight: 700;
    color: #fff;
}

/* ============================================
   COMMISSION RULES SECTION
   ============================================ */
.affiliate-rules-section {
    background: rgba(37, 99, 235, 0.05);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid rgba(59, 130, 246, 0.2);
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.1);
}

.affiliate-rules-title {
    font-size: 20px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 25px;
    text-align: center;
    letter-spacing: 0.3px;
}

.affiliate-rules-list {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.affiliate-rule-item {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    background: rgba(37, 99, 235, 0.03);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid rgba(59, 130, 246, 0.15);
    transition: all 0.2s ease;
}

.affiliate-rule-item:hover {
    background: rgba(37, 99, 235, 0.08);
    border-color: rgba(59, 130, 246, 0.3);
}

.affiliate-rule-number {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
    font-size: 16px;
    flex-shrink: 0;
}

.affiliate-rule-content {
    flex: 1;
}

.affiliate-rule-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 10px;
}

.affiliate-rule-description {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.7;
    margin-bottom: 10px;
}

.affiliate-rule-link {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: underline;
    font-size: 14px;
    font-weight: 400;
    transition: color 0.2s ease;
}

.affiliate-rule-link:hover {
    color: rgba(255, 255, 255, 0.8);
}

/* ============================================
   ACHIEVEMENT REWARDS SECTION
   ============================================ */
.affiliate-achievement-section {
    background: rgba(37, 99, 235, 0.05);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid rgba(59, 130, 246, 0.2);
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.1);
    position: relative;
    overflow: visible; /* Allow scaled content to overflow */
}

.affiliate-achievement-title {
    font-size: 20px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 25px;
    text-align: center;
    letter-spacing: 0.3px;
}

.affiliate-progress-container {
    margin-bottom: 30px;
    position: relative;
    padding: 0;
    z-index: 1;
    min-height: 70px;
    display: flex;
    align-items: center;
    overflow: visible; /* Allow scaled content to overflow */
}

.affiliate-progress-bar-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 1;
    width: 100%;
}

.affiliate-progress-help {
    position: relative;
    z-index: 3;
    flex-shrink: 0;
}

.affiliate-progress-bar {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: visible;
    position: relative;
    border: none;
    z-index: 1;
}

.affiliate-progress-fill {
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    transition: width 0.4s ease;
    width: 0%;
    position: absolute;
    top: 0;
    left: 0;
}

.affiliate-progress-help {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 1);
    border: 2px solid rgba(255, 255, 255, 1);
    color: rgba(0, 0, 0, 1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.affiliate-progress-help:hover {
    background: rgba(255, 255, 255, 1);
    color: rgba(0, 0, 0, 1);
    transform: scale(1.1);
}

.affiliate-reward-tiers {
    display: flex;
    justify-content: flex-start;
    gap: 0;
    margin-bottom: 0;
    flex-wrap: nowrap;
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    z-index: 2;
    padding: 0 0 0 20px;
    align-items: center;
    pointer-events: none;
    transform: translateY(-50%);
}

.affiliate-help-tier {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 0;
    background: transparent;
    border: none;
    pointer-events: auto;
}

.affiliate-help-tier .affiliate-progress-help {
    margin: 0;
}

.affiliate-reward-tier {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 0;
    background: transparent;
    border: none;
    transition: all 0.2s ease;
    position: relative;
    pointer-events: auto;
}

.affiliate-reward-tier:not(.affiliate-help-tier) {
    flex: 1;
}

.affiliate-reward-tier:hover {
    background: transparent;
    border: none;
}

.affiliate-reward-tier.completed {
    border: none;
    background: transparent;
}

.affiliate-reward-amount {
    font-size: 16px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
}

.affiliate-reward-icon {
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    position: relative;
    z-index: 3;
}

.affiliate-reward-tier:hover .affiliate-reward-icon {
    transform: scale(1.1);
}

.affiliate-reward-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0.9;
}

.affiliate-reward-progress {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
}

.affiliate-reward-progress i {
    font-size: 12px;
    color: #60a5fa;
}

.affiliate-achievement-instructions {
    text-align: center;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-weight: 400;
}

.affiliate-achievement-instructions span {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

/* ============================================
   DATE FILTER & CALENDAR
   ============================================ */
.affiliate-date-filter-wrapper {
    margin-bottom: 35px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.affiliate-date-filter {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    padding: 6px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
}

.affiliate-date-btn {
    padding: 10px 22px;
    background: transparent;
    border: none;
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    font-size: 14px;
    position: relative;
    overflow: hidden;
}

.affiliate-date-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.affiliate-date-btn:hover::before {
    opacity: 1;
}

.affiliate-date-btn:hover {
    color: rgba(255, 255, 255, 0.9);
    transform: translateY(-1px);
}

.affiliate-date-btn.active {
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.affiliate-date-btn.active::before {
    opacity: 0;
}

.affiliate-custom-date-picker {
    position: relative;
    display: flex;
    justify-content: center;
}

.affiliate-calendar-btn {
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

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

.affiliate-calendar-btn:hover::before {
    width: 300px;
    height: 300px;
}

.affiliate-calendar-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.affiliate-calendar-btn i,
.affiliate-calendar-btn span {
    position: relative;
    z-index: 1;
}

.affiliate-calendar-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 15px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 15, 35, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 24px;
    min-width: 360px;
    max-width: 90vw;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    backdrop-filter: blur(30px);
    animation: slideDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.affiliate-calendar-dropdown.active {
    display: block;
}

.affiliate-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
}

.affiliate-calendar-nav {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.affiliate-calendar-nav:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.95);
}

.affiliate-calendar-month-year {
    font-size: 16px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    text-align: center;
    flex: 1;
}

.affiliate-calendar-grid {
    margin-bottom: 25px;
}

.affiliate-calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    margin-bottom: 12px;
}

.affiliate-calendar-weekday {
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.7);
    padding: 10px 0;
}

.affiliate-calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.affiliate-calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.2s ease;
    position: relative;
    border: 2px solid transparent;
}

.affiliate-calendar-day.empty {
    cursor: default;
    opacity: 0;
}

.affiliate-calendar-day:not(.empty):hover {
    background: rgba(37, 99, 235, 0.3);
    color: #fff;
    border-color: rgba(37, 99, 235, 0.5);
    transform: scale(1.1);
}

.affiliate-calendar-day.today {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.95);
    font-weight: 600;
    border-color: rgba(255, 255, 255, 0.2);
}

.affiliate-calendar-day.selected {
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.95);
    font-weight: 600;
    border-color: rgba(255, 255, 255, 0.25);
}

.affiliate-calendar-day.in-range {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.8);
    border-color: rgba(255, 255, 255, 0.08);
}

.affiliate-calendar-day.past {
    opacity: 0.4;
    cursor: not-allowed;
}

.affiliate-calendar-footer {
    border-top: 2px solid rgba(255, 255, 255, 0.15);
    padding-top: 20px;
}

.affiliate-date-range-display {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.affiliate-date-input-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.affiliate-date-input-group label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 700;
}

.affiliate-date-input-group input {
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: #fff;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.affiliate-date-input-group input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.12);
}

.affiliate-calendar-actions {
    display: flex;
    gap: 12px;
}

.affiliate-calendar-clear,
.affiliate-calendar-apply {
    flex: 1;
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    font-size: 15px;
    transition: all 0.3s ease;
}

.affiliate-calendar-clear {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.affiliate-calendar-clear:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
}

.affiliate-calendar-apply {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.affiliate-calendar-apply:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
}

/* ============================================
   STATISTICS GRID
   ============================================ */
.affiliate-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    animation: fadeInUp 0.6s ease;
}

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

.affiliate-stat-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px);
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    animation: fadeInScale 0.5s ease backwards;
}

.affiliate-stat-card:nth-child(1) { animation-delay: 0.1s; }
.affiliate-stat-card:nth-child(2) { animation-delay: 0.2s; }
.affiliate-stat-card:nth-child(3) { animation-delay: 0.3s; }
.affiliate-stat-card:nth-child(4) { animation-delay: 0.4s; }
.affiliate-stat-card:nth-child(5) { animation-delay: 0.5s; }
.affiliate-stat-card:nth-child(6) { animation-delay: 0.6s; }
.affiliate-stat-card:nth-child(7) { animation-delay: 0.7s; }
.affiliate-stat-card:nth-child(8) { animation-delay: 0.8s; }
.affiliate-stat-card:nth-child(9) { animation-delay: 0.9s; }

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.affiliate-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, 
        rgba(59, 130, 246, 0.6) 0%, 
        rgba(147, 197, 253, 0.4) 50%, 
        rgba(59, 130, 246, 0.6) 100%);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.affiliate-stat-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.affiliate-stat-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    flex-shrink: 0;
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.affiliate-stat-card:hover .affiliate-stat-icon {
    transform: scale(1.1) rotate(5deg);
}

.affiliate-stat-content {
    flex: 1;
    position: relative;
    z-index: 1;
}

.affiliate-stat-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.65);
    margin-bottom: 10px;
    font-weight: 500;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.affiliate-stat-value {
    font-size: 26px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.2;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.75) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   MEMBERS SECTION
   ============================================ */
.affiliate-members-section {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.affiliate-members-title {
    font-size: 20px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 25px;
    text-align: center;
    letter-spacing: 0.3px;
}

.affiliate-members-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.affiliate-member-item {
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 15px;
    padding: 20px 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.affiliate-member-item:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(37, 99, 235, 0.5);
    transform: translateX(5px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.2);
}

.affiliate-member-info {
    display: flex;
    align-items: center;
    gap: 18px;
    flex: 1;
}

.affiliate-member-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 20px;
    flex-shrink: 0;
}

.affiliate-member-details {
    flex: 1;
}

.affiliate-member-name {
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
}

.affiliate-member-email {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.7);
}

.affiliate-member-view-btn {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.affiliate-member-view-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.18);
}

.affiliate-loading,
.affiliate-empty-state {
    text-align: center;
    padding: 50px;
    color: rgba(255, 255, 255, 0.7);
}

.affiliate-empty-state i {
    font-size: 56px;
    margin-bottom: 20px;
    color: rgba(255, 255, 255, 0.5);
}

/* ============================================
   BAUS MODAL
   ============================================ */
.affiliate-baus-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    backdrop-filter: blur(5px);
}

.affiliate-baus-modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.affiliate-baus-modal-content {
    background: rgba(15, 15, 35, 0.98);
    border-radius: 12px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden; /* Prevent horizontal scroll */
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
    backdrop-filter: blur(20px);
}

.affiliate-baus-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 25px 30px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.15);
}

.affiliate-baus-modal-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    margin: 0;
}

.affiliate-baus-modal-close {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.affiliate-baus-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 1);
    transform: rotate(90deg);
}

.affiliate-baus-modal-body {
    padding: 30px;
}

.affiliate-baus-conditions {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.affiliate-baus-conditions h4 {
    font-size: 16px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 15px;
}

.affiliate-baus-conditions-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.affiliate-baus-conditions-item:last-child {
    margin-bottom: 0;
}

.affiliate-baus-conditions-item i {
    color: rgba(255, 255, 255, 0.6);
}

.affiliate-baus-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* Always 4 columns */
    gap: 20px;
    margin-top: 20px;
    width: 100%;
}

.affiliate-bau-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.2s ease;
    position: relative;
    min-width: 150px; /* Fixed minimum width to prevent compression */
    width: 100%;
    max-width: 100%;
}

.affiliate-bau-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.affiliate-bau-item.bloqueado {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.affiliate-bau-item.bloqueado:hover {
    transform: none;
}

.affiliate-bau-item.fechado {
    border-color: rgba(16, 185, 129, 0.3);
}

.affiliate-bau-item.fechado.clickable {
    cursor: pointer;
    pointer-events: auto;
}

.affiliate-bau-item.fechado.clickable:hover {
    border-color: rgba(16, 185, 129, 0.6);
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.affiliate-bau-item.aberto {
    cursor: default;
    pointer-events: none;
}

.affiliate-bau-item.aberto {
    border-color: rgba(59, 130, 246, 0.3);
}

/* Bau Opening Animation */
.affiliate-bau-icon {
    position: relative;
    transition: transform 0.3s ease;
}

.affiliate-bau-icon.bau-opening {
    animation: bauOpen 0.6s ease-in-out;
}

.affiliate-bau-icon.bau-opened {
    transform: scale(1.1);
}

@keyframes bauOpen {
    0% {
        transform: scale(1) rotate(0deg);
    }
    25% {
        transform: scale(1.15) rotate(-5deg);
    }
    50% {
        transform: scale(1.1) rotate(5deg);
    }
    75% {
        transform: scale(1.15) rotate(-3deg);
    }
    100% {
        transform: scale(1.1) rotate(0deg);
    }
}

.bau-image {
    transition: all 0.3s ease;
}

.affiliate-bau-icon.bau-opening .bau-image {
    filter: brightness(1.2);
}

.affiliate-bau-icon {
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.affiliate-bau-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.affiliate-bau-info {
    text-align: center;
    width: 100%;
}

.affiliate-bau-pessoas {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 5px;
}

.affiliate-bau-valor {
    font-size: 16px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.affiliate-bau-status {
    font-size: 11px;
    margin-top: 5px;
    padding: 4px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 600;
}

.affiliate-bau-status.bloqueado {
    background: rgba(239, 68, 68, 0.2);
    color: rgba(239, 68, 68, 1);
}

.affiliate-bau-status.fechado {
    background: rgba(16, 185, 129, 0.2);
    color: rgba(16, 185, 129, 1);
}

.affiliate-bau-status.aberto {
    background: rgba(59, 130, 246, 0.2);
    color: rgba(59, 130, 246, 1);
}

@media (max-width: 768px) {
    .affiliate-baus-grid {
        grid-template-columns: repeat(4, 1fr); /* Always 4 columns */
        gap: 8px; /* Reduced gap for mobile */
        width: 100%; /* Full width, no overflow */
    }
    
    .affiliate-bau-item {
        min-width: 0; /* Allow flex shrinking */
        width: 100%;
        max-width: 100%;
        padding: 10px; /* Reduced padding */
        gap: 6px; /* Reduced gap */
    }
    
    .affiliate-bau-icon {
        width: 50px; /* Smaller icon */
        height: 50px;
    }
    
    .affiliate-bau-pessoas {
        font-size: 11px; /* Smaller text */
    }
    
    .affiliate-bau-valor {
        font-size: 12px; /* Smaller text */
    }
    
    .affiliate-bau-status {
        font-size: 10px; /* Smaller text */
        padding: 4px 8px; /* Smaller button */
    }
}

@media (max-width: 480px) {
    .affiliate-baus-grid {
        grid-template-columns: repeat(4, 1fr); /* Always 4 columns */
        gap: 6px; /* Reduced gap for smaller screens */
        width: 100%; /* Full width, no overflow */
    }
    
    .affiliate-bau-item {
        min-width: 0; /* Allow flex shrinking */
        width: 100%;
        max-width: 100%;
        padding: 8px; /* Reduced padding */
        gap: 4px; /* Reduced gap */
    }
    
    .affiliate-bau-icon {
        width: 40px; /* Smaller icon */
        height: 40px;
    }
    
    .affiliate-bau-pessoas {
        font-size: 10px; /* Smaller text */
    }
    
    .affiliate-bau-valor {
        font-size: 11px; /* Smaller text */
    }
    
    .affiliate-bau-status {
        font-size: 9px; /* Smaller text */
        padding: 3px 6px; /* Smaller button */
    }
}

/* ============================================
   BAU NOTIFICATION
   ============================================ */
.affiliate-bau-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10001;
    min-width: 320px;
    max-width: 400px;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.affiliate-bau-notification.show {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.affiliate-bau-notification-content {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.95) 0%, rgba(5, 150, 105, 0.95) 100%);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.affiliate-bau-notification-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0.2) 100%);
    animation: notificationShine 2s infinite;
}

@keyframes notificationShine {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.affiliate-bau-notification-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #ffffff;
    flex-shrink: 0;
    animation: notificationPulse 2s infinite;
}

@keyframes notificationPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 8px rgba(255, 255, 255, 0);
    }
}

.affiliate-bau-notification-text {
    flex: 1;
    color: #ffffff;
}

.affiliate-bau-notification-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.affiliate-bau-notification-message {
    font-size: 14px;
    opacity: 0.95;
    font-weight: 500;
}

.affiliate-bau-notification-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #ffffff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    padding: 0;
    line-height: 1;
}

.affiliate-bau-notification-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

@media (max-width: 480px) {
    .affiliate-bau-notification {
        right: 10px;
        left: 10px;
        min-width: auto;
        max-width: none;
    }
    
    .affiliate-bau-notification-content {
        padding: 16px;
    }
    
    .affiliate-bau-notification-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .affiliate-bau-notification-title {
        font-size: 16px;
    }
    
    .affiliate-bau-notification-message {
        font-size: 13px;
    }
}

/* ============================================
   MEMBER MODAL
   ============================================ */
.affiliate-member-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    backdrop-filter: blur(5px);
}

.affiliate-member-modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.affiliate-member-modal-content {
    background: rgba(15, 15, 35, 0.98);
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: visible; /* Allow scaled grid to overflow horizontally */
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
    backdrop-filter: blur(20px);
}

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

.affiliate-member-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 25px 30px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.15);
}

.affiliate-member-modal-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    margin: 0;
}

.affiliate-member-modal-close {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.affiliate-member-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    transform: rotate(90deg);
}

.affiliate-member-modal-body {
    padding: 30px;
}

.affiliate-member-detail-item {
    padding: 20px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.affiliate-member-detail-item:last-child {
    border-bottom: none;
}

.affiliate-member-detail-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 10px;
    font-weight: 600;
}

.affiliate-member-detail-value {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
}

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */
@media (max-width: 768px) {
    .affiliate-content {
        padding: 20px 5px 10px 5px; /* Reduced bottom padding before footer */
        padding-bottom: 75px !important; /* Space for mobile bottom nav (70px) + small extra */
    }

    .affiliate-nav-tabs {
        margin-bottom: 20px;
    }

    .affiliate-tab {
        padding: 10px 6px;
        font-size: 12px;
        gap: 6px;
    }

    .affiliate-tab-icon {
        width: 40px;
        height: 40px;
    }

    .affiliate-tab span {
        font-size: 11px;
    }

    .affiliate-banner-container {
        padding: 20px 15px;
        min-height: auto;
        margin-bottom: 20px;
    }

    .affiliate-banner-content {
        gap: 18px;
    }

    .affiliate-contract-label {
        font-size: 16px;
    }

    .affiliate-section-title {
        font-size: 14px;
    }

    .affiliate-referral-link-input {
        font-size: 13px;
        padding: 8px 12px;
        min-height: 36px;
    }

    .affiliate-copy-btn {
        width: 42px;
        height: 36px;
    }

    .affiliate-share-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .affiliate-share-buttons {
        width: 100%;
        justify-content: flex-start;
    }

    .affiliate-bonus-section,
    .affiliate-rules-section,
    .affiliate-achievement-section {
        padding: 20px 5px; /* Reduced horizontal padding to allow scaled content */
        margin-bottom: 20px;
        overflow: visible; /* Allow scaled content to overflow */
    }

    .affiliate-bonus-display {
        flex-direction: row;
        align-items: center;
        gap: 10px;
        flex-wrap: wrap;
    }

    .affiliate-bonus-info {
        gap: 10px;
    }

    .affiliate-bonus-label {
        font-size: 16px;
    }

    .affiliate-bonus-amount {
        font-size: 24px;
    }

    .affiliate-bonus-actions {
        width: auto;
        gap: 8px;
    }

    .affiliate-bonus-btn {
        padding: 10px 18px;
        font-size: 13px;
        white-space: nowrap;
    }

    .affiliate-date-filter-wrapper {
        margin-bottom: 25px;
        gap: 15px;
    }

    .affiliate-date-filter {
        display: flex;
        gap: 8px;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 8px;
        justify-content: flex-start;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
    }

    .affiliate-date-filter::-webkit-scrollbar {
        height: 4px;
    }

    .affiliate-date-filter::-webkit-scrollbar-track {
        background: transparent;
    }

    .affiliate-date-filter::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.2);
        border-radius: 2px;
    }

    .affiliate-date-btn {
        padding: 10px 18px;
        font-size: 13px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .affiliate-custom-date-picker {
        width: 100%;
    }

    .affiliate-calendar-btn {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
        font-size: 14px;
    }

    .affiliate-stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .affiliate-stat-card {
        padding: 14px;
        gap: 12px;
        border-radius: 14px;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .affiliate-stat-icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
        border-radius: 12px;
    }

    .affiliate-stat-content {
        width: 100%;
        text-align: center;
    }

    .affiliate-stat-label {
        font-size: 12px;
        margin-bottom: 6px;
    }

    .affiliate-stat-value {
        font-size: 20px;
    }

    .affiliate-reward-tiers {
        flex-direction: row;
        gap: 8px;
        flex-wrap: nowrap;
        top: 50%;
        transform: translateY(-50%) scale(0.75);
        transform-origin: left center;
        width: 133.33%; /* Compensate for scale (100/0.75) */
        left: 0;
        padding-left: 10px; /* Small padding to adjust position */
    }

    .affiliate-reward-tier {
        flex: 0 0 auto;
        width: 120px; /* Fixed width to prevent compression */
        min-width: 120px;
        max-width: 120px;
        padding: 0;
        gap: 6px;
    }

    .affiliate-progress-container {
        min-height: 50px;
        margin-bottom: 25px;
        overflow: visible; /* Allow scaled content to overflow */
    }

    .affiliate-progress-help {
        width: 32px;
        height: 32px;
    }

    .affiliate-reward-amount {
        font-size: 16px; /* Original size, will be scaled */
    }

    .affiliate-reward-icon {
        width: 70px; /* Original size, will be scaled */
        height: 70px;
    }

    .affiliate-reward-progress {
        font-size: 13px; /* Original size, will be scaled */
        gap: 6px;
    }

    .affiliate-reward-progress i {
        font-size: 12px; /* Original size, will be scaled */
    }

    .affiliate-member-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .affiliate-member-view-btn {
        width: 100%;
        justify-content: center;
    }

    .affiliate-calendar-dropdown {
        left: 10px !important;
        right: 10px !important;
        transform: none !important;
        min-width: auto;
        width: calc(100% - 20px) !important;
        max-width: none;
        padding: 20px;
        position: fixed !important;
        top: auto !important;
        max-height: calc(100vh - 20px);
        overflow-y: auto;
    }

    .affiliate-date-range-display {
        flex-direction: column;
    }

    .affiliate-calendar-actions {
        flex-direction: column;
    }

    .affiliate-calendar-clear,
    .affiliate-calendar-apply {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .affiliate-content {
        padding: 20px 5px 10px 5px; /* Reduced bottom padding before footer */
        padding-bottom: 75px !important; /* Space for mobile bottom nav (70px) + small extra */
    }

    .affiliate-nav-tabs {
        margin-bottom: 15px;
    }

    .affiliate-tab {
        padding: 8px 4px;
        font-size: 11px;
        gap: 4px;
    }

    .affiliate-tab-icon {
        width: 36px;
        height: 36px;
    }

    .affiliate-tab span {
        font-size: 10px;
    }

    .affiliate-banner-container {
        padding: 15px 12px;
        margin-bottom: 15px;
    }

    .affiliate-banner-content {
        gap: 15px;
    }

    .affiliate-contract-label {
        font-size: 14px;
        gap: 10px;
    }

    .affiliate-contract-label input[type="checkbox"] {
        width: 20px;
        height: 20px;
    }

    .affiliate-section-title {
        font-size: 13px;
    }

    .affiliate-referral-link-input {
        font-size: 12px;
        padding: 8px 10px;
        min-height: 34px;
    }

    .affiliate-copy-btn {
        width: 40px;
        height: 34px;
    }

    .affiliate-copy-btn i {
        font-size: 18px;
    }

    .affiliate-qr-code img {
        width: 100px;
        height: 100px;
    }

    .affiliate-save-qr-btn {
        padding: 10px 20px;
        font-size: 13px;
    }

    .affiliate-share-btn {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }

    .affiliate-bonus-section,
    .affiliate-rules-section,
    .affiliate-achievement-section {
        padding: 15px 5px; /* Reduced horizontal padding to allow scaled content */
        margin-bottom: 15px;
        overflow: visible; /* Allow scaled content to overflow */
    }

    .affiliate-bonus-display {
        flex-direction: row;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
    }

    .affiliate-bonus-info {
        gap: 8px;
    }

    .affiliate-bonus-label {
        font-size: 14px;
    }

    .affiliate-bonus-amount {
        font-size: 20px;
    }

    .affiliate-bonus-actions {
        width: auto;
        gap: 6px;
    }

    .affiliate-bonus-btn {
        padding: 8px 14px;
        font-size: 12px;
        white-space: nowrap;
    }

    .affiliate-rules-title,
    .affiliate-achievement-title {
        font-size: 18px;
    }

    .affiliate-rule-item {
        padding: 15px;
        gap: 12px;
    }

    .affiliate-rule-number {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .affiliate-rule-title {
        font-size: 16px;
    }

    .affiliate-rule-description {
        font-size: 14px;
    }

    .affiliate-stat-card {
        padding: 14px;
        gap: 12px;
        border-radius: 14px;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .affiliate-stat-icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
        border-radius: 12px;
    }

    .affiliate-stat-content {
        width: 100%;
        text-align: center;
    }

    .affiliate-date-filter-wrapper {
        margin-bottom: 20px;
        gap: 12px;
    }

    .affiliate-date-filter {
        gap: 6px;
        padding: 6px;
    }

    .affiliate-date-btn {
        padding: 8px 14px;
        font-size: 12px;
        border-radius: 10px;
    }

    .affiliate-calendar-btn {
        padding: 12px 18px;
        font-size: 13px;
    }

    .affiliate-stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .affiliate-stat-card {
        padding: 12px;
        gap: 10px;
        border-radius: 12px;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .affiliate-stat-icon {
        width: 44px;
        height: 44px;
        font-size: 18px;
        border-radius: 10px;
    }

    .affiliate-stat-content {
        width: 100%;
        text-align: center;
    }

    .affiliate-stat-label {
        font-size: 9px;
        margin-bottom: 4px;
        line-height: 1.2;
    }

    .affiliate-stat-value {
        font-size: 14px;
    }

    .affiliate-reward-tiers {
        flex-direction: row;
        gap: 6px;
        flex-wrap: nowrap;
        top: 50%;
        transform: translateY(-50%) scale(0.65);
        transform-origin: left center;
        width: 153.85%; /* Compensate for scale (100/0.65) */
        left: 0;
        padding-left: 5px; /* Small padding to adjust position */
    }

    .affiliate-reward-tier {
        flex: 0 0 auto;
        width: 120px; /* Fixed width to prevent compression */
        min-width: 120px;
        max-width: 120px;
        padding: 0;
        gap: 5px;
    }

    .affiliate-progress-container {
        min-height: 45px;
        margin-bottom: 20px;
        overflow: visible; /* Allow scaled content to overflow */
    }

    .affiliate-progress-help {
        width: 30px;
        height: 30px;
    }

    .affiliate-reward-amount {
        font-size: 16px; /* Original size, will be scaled */
    }

    .affiliate-reward-icon {
        width: 70px; /* Original size, will be scaled */
        height: 70px;
    }

    .affiliate-reward-progress {
        font-size: 13px; /* Original size, will be scaled */
        gap: 6px;
    }

    .affiliate-reward-progress i {
        font-size: 12px; /* Original size, will be scaled */
    }
}
