/* Affiliate Dashboard Styles */
.affiliate-dashboard {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    /* background-color: #f8fafc; */
    border-radius: 12px;
    /* box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05); */
}

.affiliate-dashboard * {
    outline: none !important;
}

.affiliate-dashboard h2 {
    color: #1e293b;
    margin-bottom: 30px;
    font-size: 2rem;
    font-weight: 600;
    text-align: center;
}

/* Affiliate Dashboard Tabs */
.affiliate-dashboard-tabs {
    display: flex;
    max-width: fit-content;
    margin-left: auto;
    margin-right: auto;
    border-radius: 100px;
    padding: 4px;
    margin-bottom: 30px;
    /* box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); */
    overflow-x: auto;
    gap: 4px;
    background-color: #f2f6fa;
}

.affiliate-dashboard-tab {
    padding: 12px 20px;
    cursor: pointer;
    background-color: transparent;
    border: none;
    border-radius: 100px;
    font-weight: 600;
    color: #4f5d70;
    transition: all 0.3s ease;
    position: relative;
    flex-shrink: 0;
    font-size: 16px;
}

.affiliate-dashboard-tab:hover {
    background-color: #f1f5f9;
    color: #334155;
}

.affiliate-dashboard-tab.active {
    background-color: #00ADB5;
    color: #ffffff;
}

.affiliate-dashboard-tab.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #00ADB5;
}

.affiliate-dashboard-content {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

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

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Affiliate Widgets */
.affiliate-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.affiliate-widget {
    background-color: #ffffff;
    border-radius: 24px;
    padding: 24px;
    text-align: center;
    border: 2px solid rgba(226, 232, 240, 0.574);
    /* transition: transform 0.2s ease, box-shadow 0.2s ease; */
}

/* .affiliate-widget:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
} */

.widget-icon-box {
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 24px;
    padding: 16px;
    background: #eff2f6aa;
    border-radius: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.widget-icon {
    width: 2rem;
    height: 2rem;
}

.affiliate-widget h4 {
    color: #1e293b;
    margin-bottom: 8px;
    font-size: 1rem;
    font-weight: 600;
}

.widget-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #00ADB5;
    margin: 0;
}

/* Dashboard Sections */
.dashboard-section {
    background-color: #ffffff;
    border-radius: 24px;
    padding: 24px;
    margin-bottom: 24px;
    /* box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); */
    border: 2px solid rgba(226, 232, 240, 0.574)
}

.dashboard-section h3 {
    color: #1e293b;
    margin-bottom: 16px;
    font-size: 1.25rem;
    font-weight: 600;
    /* border-bottom: 2px solid #141d2c26; */
    padding-bottom: 8px;
}

.dashboard-section h3::before {
    content: '';
    width: 20px;
    height: 12px;
    border-radius: 100px;
    background-color: #00ADB5;
    opacity: 0.3;
    display: inline-block;
    margin-left: 8px;
    margin-top: 4px;
}

.dashboard-section p {
    margin-bottom: 12px;
    color: #475569;
    line-height: 1.6;
}

.dashboard-section strong {
    color: #1e293b;
    font-weight: 600;
}

/* Balance Box */
.pending-balance-box {
    background: #00acb519;
    color: #043d40;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    margin-top: 16px;
}

.pending-balance-box h4 {
    margin-bottom: 8px;
    font-size: 1rem;
    font-weight: 500;
}

.balance-amount {
    font-size: 2rem;
    font-weight: 700;
}

/* Tables */
.referral-table,
.payout-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    background-color: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    /* box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); */
    border: none !important;
}

.referral-table th,
.payout-table th {
    background-color: #f8fafc;
    color: #374151;
    font-weight: 600;
    padding: 12px 16px;
    text-align: right;
    border: none !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

.referral-table td,
.payout-table td {
    padding: 12px 16px;
    border: none !important;
    border-bottom: 1px solid #f1f5f9 !important;
    color: #475569;
}

.referral-table tbody tr:hover,
.payout-table tbody tr:hover {
    background-color: #f8fafc;
}

.referral-table tbody tr:last-child td,
.payout-table tbody tr:last-child td {
    border-bottom: none;
}

/* Forms */
.dashboard-section input[type="text"],
.dashboard-section input[type="url"],
.dashboard-section input[type="number"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.dashboard-section input[type="text"]:focus,
.dashboard-section input[type="url"]:focus,
.dashboard-section input[type="number"]:focus {
    outline: none;
    border-color: #00ADB5;
    box-shadow: 0 0 0 1px #00ADB5;
}

.dashboard-section button,
.dashboard-section input[type="submit"] {
    background-color: #00ADB5;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: background-color 0.2s ease;
    margin-top: 8px;
}

.dashboard-section button:hover,
.dashboard-section input[type="submit"]:hover {
    background-color: #00959d;
}

#generate-product-link {
    background-color: #10b981;
    margin-left: 8px;
}

#generate-product-link:hover {
    background-color: #059669;
}

/* Become Affiliate Section */
.become-affiliate {
    text-align: center;
    background-color: #ffffff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    max-width: 500px;
    margin: 0 auto;
}

.become-affiliate h2 {
    color: #1e293b;
    margin-bottom: 16px;
}

.become-affiliate p {
    color: #64748b;
    margin-bottom: 24px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .affiliate-dashboard {
        padding: 16px;
        margin: 0 8px;
    }

    .affiliate-widgets {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .affiliate-widget {
        padding: 16px;
    }

    .widget-icon {
        width: 1.5rem;
        height: 1.5rem;
    }

    .widget-value {
        font-size: 1.25rem;
    }

    .affiliate-dashboard-tabs {
        min-width: 100%;
        border-radius: 16px;
        flex-direction: column;
        padding: 8px;
    }

    .affiliate-dashboard-tab {
        border-radius: 14px;
        padding: 14px 16px;
        text-align: center;
        margin-bottom: 4px;
    }

    .affiliate-dashboard-tab.active::after {
        display: none;
    }

    .dashboard-section {
        padding: 16px;
        margin-bottom: 16px;
    }

    .dashboard-section h3 {
        font-size: 1.1rem;
    }

    .referral-table,
    .payout-table {
        font-size: 14px;
    }

    .referral-table th,
    .referral-table td,
    .payout-table th,
    .payout-table td {
        padding: 8px 12px;
    }

    .pending-balance-box {
        padding: 16px;
    }

    .balance-amount {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .affiliate-dashboard h2 {
        font-size: 1.5rem;
    }

    .dashboard-section h3 {
        font-size: 1rem;
    }

    .referral-table,
    .payout-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .dashboard-section input[type="text"],
    .dashboard-section input[type="number"] {
        font-size: 16px;
        /* Prevent zoom on iOS */
    }
}

/* Admin Affiliate Pages Styles */
.admin-affiliate-wrap {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
}

.admin-affiliate-wrap h1 {
    color: #1e293b;
    margin-bottom: 30px;
    font-size: 2rem;
    font-weight: 600;
    padding-bottom: 10px;
}

.admin-affiliate-wrap h2 {
    color: #1e293b;
    margin-bottom: 20px;
    font-size: 1.5rem;
    font-weight: 600;
}

.admin-affiliate-card {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    /* box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); */
    /* border: 1px solid #e2e8f0; */
    /* transition: box-shadow 0.2s ease; */
}

/* .admin-affiliate-card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
} */

.admin-affiliate-card h3 {
    color: #1e293b;
    margin-bottom: 16px;
    font-size: 1.25rem;
    font-weight: 600;
    /* border-bottom: 2px solid #f1f5f9; */
    padding-bottom: 8px;
}

.admin-affiliate-card p {
    margin-bottom: 12px;
    color: #475569;
    line-height: 1.6;
}

.admin-affiliate-card strong {
    color: #1e293b;
    font-weight: 600;
}

/* Admin Tables */
.admin-affiliate-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    background-color: rgba(222, 232, 249, 0.303);
    border-radius: 8px;
    overflow: hidden;
    /* box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); */
    /* border: 1px solid #e2e8f0; */
}

.admin-affiliate-table th {
    background-color: #e8eff6;
    color: #374151;
    font-weight: 600;
    padding: 14px 16px;
    text-align: right;
    border-bottom: 2px solid #e2e8f0;
    font-size: 16px;
}

.admin-affiliate-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
    color: #232a34;
    font-size: 14px;
}

.admin-affiliate-table tbody tr:nth-child(even) {
    background-color: #f8fafc;
}

.admin-affiliate-table tbody tr:hover {
    background-color: #f1f5f9;
}

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

/* Admin Forms */
.admin-affiliate-form {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.admin-affiliate-form .form-table th {
    padding: 16px 0 8px;
    font-weight: 600;
    color: #1e293b;
    border-bottom: none;
    background: transparent;
}

.admin-affiliate-form .form-table td {
    padding: 16px 0 8px;
    border-bottom: none;
}

.admin-affiliate-form input[type="text"],
.admin-affiliate-form input[type="number"],
.admin-affiliate-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.admin-affiliate-form input[type="text"]:focus,
.admin-affiliate-form input[type="number"]:focus,
.admin-affiliate-form textarea:focus {
    outline: none;
    border-color: #00ADB5;
    box-shadow: 0 0 0 1px #00ADB5;
}

.admin-affiliate-form textarea {
    resize: vertical;
    min-height: 80px;
}

/* Admin Buttons */
.admin-affiliate-button,
.admin-affiliate-form input[type="submit"],
.admin-affiliate-form .button {
    background-color: #00ADB5;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease, transform 0.1s ease;
    text-decoration: none;
    display: inline-block;
    margin-right: 8px;
    margin-bottom: 8px;
}

.admin-affiliate-button:hover,
.admin-affiliate-form input[type="submit"]:hover,
.admin-affiliate-form .button:hover {
    background-color: #2563eb;
    transform: translateY(-1px);
}

.admin-affiliate-button:active,
.admin-affiliate-form input[type="submit"]:active,
.admin-affiliate-form .button:active {
    transform: translateY(0);
}

.admin-affiliate-button.secondary {
    background-color: #6b7280;
    color: #fff !important;
}

.admin-affiliate-button.danger {
    background-color: #dc2626;
}

.admin-affiliate-button.danger:hover {
    background-color: #b91c1c;
}

/* Admin Notices */
.admin-affiliate-notice {
    background-color: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 14px;
}

.admin-affiliate-notice.success {
    background-color: #dcfce7;
    color: #166534;
    border-color: #bbf7d0;
}

.admin-affiliate-notice.error {
    background-color: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

/* Admin Stats */
.admin-affiliate-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.admin-affiliate-stat-card {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    /* box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); */
    /* border: 1px solid #e2e8f0; */
    /* transition: transform 0.2s ease, box-shadow 0.2s ease; */
}

/* .admin-affiliate-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
} */

.admin-affiliate-stat-card h3 {
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-affiliate-stat-card p {
    font-size: 2rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

/* Responsive Admin Styles */
@media (max-width: 768px) {
    .admin-affiliate-wrap {
        padding: 0 16px;
        margin: 16px auto;
    }

    .admin-affiliate-wrap h1 {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }

    .admin-affiliate-card,
    .admin-affiliate-form {
        padding: 16px;
        margin-bottom: 16px;
    }

    .admin-affiliate-table {
        font-size: 13px;
    }

    .admin-affiliate-table th,
    .admin-affiliate-table td {
        padding: 10px 12px;
    }

    .admin-affiliate-stats {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .admin-affiliate-stat-card {
        padding: 16px;
    }

    .admin-affiliate-stat-card p {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .admin-affiliate-wrap h1 {
        font-size: 1.25rem;
    }

    .admin-affiliate-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .admin-affiliate-form input[type="text"],
    .admin-affiliate-form input[type="number"],
    .admin-affiliate-form textarea {
        font-size: 16px;
        /* Prevent zoom on iOS */
    }
}