/*
 * ========================================================================
 * BravenSoft - Modern Frontend Affiliate Dashboard (v1.0)
 * Target File: /bravensoft/assets/frontend-style.css
 * ========================================================================
 */

/* --- 1. Main Container & Tab Navigation --- */
.woocommerce-account-content_bs_aff {
    border: 1px solid #eef2f6;
    border-radius: 12px;
    background-color: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    overflow: hidden; /* To keep rounded corners */
}

/* Tab Navigation */
.bs-aff-nav {
    display: flex;
    flex-wrap: wrap; /* Allow tabs to wrap on mobile */
    border-bottom: 2px solid #eef2f6 !important;
    margin: 0 !important;
    padding: 10px 20px 0 20px !important;
    background-color: #fcfcfc;
}
.bs-aff-nav a {
    display: inline-block;
    padding: 12px 18px !important;
    text-decoration: none !important;
    color: #666 !important;
    font-weight: 500 !important;
    font-size: 1em !important;
    border-bottom: 3px solid transparent !important;
    margin-bottom: -2px; /* Align with bottom border */
    transition: all 0.2s ease;
}
.bs-aff-nav a.active {
    color: #c99947 !important; /* WoodMart Gold */
    border-bottom-color: #c99947 !important;
    font-weight: 600 !important;
}
.bs-aff-nav a:hover {
    color: #111 !important;
    background-color: #f9f9f9;
}

/* Tab Content */
.bs-aff-tab-content {
    padding: 25px 30px !important;
}

/* --- 2. Overview Tab (Stats Grid) --- */
#bs-aff-link-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background-color: #f9f9f9;
    font-family: monospace;
    font-size: 1.1em;
    color: #333;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
}
#bs-aff-link-input:focus {
    border-color: #c99947;
    box-shadow: 0 0 0 3px rgba(201, 153, 71, 0.2);
    outline: none;
}

.bs-aff-stats-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important; /* 2 columns */
    gap: 20px !important;
    margin: 25px 0 !important;
}
.bs-aff-stat-box {
    background-color: #fff !important;
    border: 1px solid #eef2f6 !important;
    border-radius: 10px !important;
    padding: 20px !important;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
}
.bs-aff-stat-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.08);
}
.bs-aff-stat-box h4 { /* Stat Value (Number/Percent) */
    margin: 0 0 5px 0 !important;
    font-size: 2.2em !important;
    font-weight: 700 !important;
    color: #c99947 !important; /* WoodMart Gold */
}
.bs-aff-stat-box p { /* Stat Label (e.g., 'زيارة') */
    margin: 0 !important;
    font-size: 0.95em !important;
    color: #555 !important;
    font-weight: 500;
}
/* Stat Box for Earnings */
.bs-aff-stat-box .woocommerce-Price-amount {
    font-size: 2.2em !important;
    font-weight: 700 !important;
    color: #4CAF50 !important; /* Green for money */
}

/* Total Earnings */
#bs-aff-frontend-dashboard > h2 {
    font-size: 1.5em;
    font-weight: 600;
    margin-top: 20px;
}
#bs-aff-frontend-dashboard > h2 .woocommerce-Price-amount {
    font-size: 1.2em;
    color: #4CAF50;
}

/* --- 3. Tables (Commissions & Payout History) --- */
.bs-aff-tab-content .woocommerce-table {
    width: 100% !important;
    border: 1px solid #eef2f6 !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
    overflow: hidden; /* for border-radius */
}
.bs-aff-tab-content .woocommerce-table th {
    background-color: #f9fafb !important;
    font-weight: 600 !important;
    color: #3c434a !important;
    padding: 12px 15px !important;
}
.bs-aff-tab-content .woocommerce-table td {
    padding: 12px 15px !important;
    vertical-align: middle !important;
    border-bottom: 1px solid #f0f0f1 !important;
}
.bs-aff-tab-content .woocommerce-table tbody tr:last-child td {
    border-bottom: none !important;
}
.bs-aff-tab-content .woocommerce-table td span[style*="color:green"] {
    color: #4CAF50 !important; font-weight: 600;
}
.bs-aff-tab-content .woocommerce-table td span[style*="color:orange"] {
    color: #ff9800 !important; font-weight: 600;
}
.bs-aff-tab-content .woocommerce-table td span[style*="color:red"] {
    color: #d63638 !important; font-weight: 600;
}

/* --- 4. Forms (Link Generator & Payout Settings) --- */
.bs-aff-tab-content form {
    margin-top: 15px;
}
.bs-aff-tab-content .form-row,
.bs-aff-tab-content fieldset {
    padding: 0 !important;
    border: none !important;
    margin: 0 0 20px 0 !important;
}
.bs-aff-tab-content label {
    font-weight: 600 !important;
    color: #333;
    font-size: 1.05em;
}
.bs-aff-tab-content input[type="text"],
.bs-aff-tab-content input[type="url"],
.bs-aff-tab-content input[type="email"],
.bs-aff-tab-content textarea {
    border-radius: 6px !important;
    border: 1px solid #ddd !important;
    padding: 10px 12px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    margin-top: 5px;
}
.bs-aff-tab-content input:focus,
.bs-aff-tab-content textarea:focus {
    border-color: #c99947 !important;
    box-shadow: 0 0 0 3px rgba(201, 153, 71, 0.2) !important;
    outline: none !important;
}
.bs-aff-tab-content .button {
    background-color: #c99947 !important;
    color: #fff !important;
    border-radius: 6px !important;
    padding: 10px 20px !important;
    font-weight: 600 !important;
    transition: all 0.2s ease;
}
.bs-aff-tab-content .button:hover {
    background-color: #111 !important;
}
/* Link Generator Result */
#bs-aff-generated-result {
    margin-top: 20px;
    border-top: 1px dashed #ddd;
    padding-top: 20px;
}

/* --- 5. Creatives Tab --- */
.bs-aff-creative-box {
    border: 1px solid #eef2f6;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    margin-bottom: 25px;
    overflow: hidden; /* for border-radius */
}
.bs-aff-creative-box h5 {
    font-size: 1.2em;
    font-weight: 600;
    padding: 15px 20px;
    margin: 0;
    background-color: #f9fafb;
    border-bottom: 1px solid #eef2f6;
}
.bs-aff-creative-preview {
    padding: 20px;
    background-color: #fff;
    text-align: center;
}
.bs-aff-creative-preview img {
    max-width: 100%;
    height: auto;
    border: 1px dashed #ddd;
    padding: 5px;
}
.bs-aff-creative-box textarea.bs-aff-creative-code {
    font-family: monospace;
    background: #282c34 !important; /* Dark theme for code */
    color: #98c379 !important; /* Greenish text */
    border: none !important;
    border-top: 1px solid #eef2f6 !important;
    border-radius: 0 0 8px 8px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    direction: ltr;
    text-align: left;
    padding: 15px 20px !important;
    margin: 0 !important;
}

/* --- 6. Mobile Responsiveness (App-Like) --- */
@media (max-width: 768px) {
    .bs-aff-tab-content {
        padding: 20px !important;
    }
    
    /* Stack stats cards */
    .bs-aff-stats-grid {
        grid-template-columns: 1fr !important; /* 1 column */
    }

    /* Improve tab navigation on mobile */
    .bs-aff-nav {
        padding: 5px !important;
        justify-content: center;
    }
    .bs-aff-nav a {
        font-size: 0.9em !important;
        padding: 10px !important;
        flex-grow: 1; /* Make tabs fill the space */
        text-align: center;
    }
}
/* --- 7. Frontend Branding Footer --- */
.bs-aff-frontend-footer {
    text-align: center;
    padding: 15px 20px;
    margin-top: 20px;
    border-top: 1px solid #eef2f6;
    font-size: 0.9em;
    color: #888;
}
.bs-aff-frontend-footer a {
    color: #007cba !important; /* لون برايڤن سوفت الأزرق */
    font-weight: 600 !important;
    text-decoration: none !important;
}
.bs-aff-frontend-footer a:hover {
    text-decoration: underline !important;
}
/*
 * ========================================================================
 * BravenSoft - Frontend Polish (v1.1)
 * ========================================================================
 */

/* --- 1. إصلاح أعمدة جدول سجل الدفعات --- */
.bs-aff-tab-content .woocommerce-table .bs-payout-notes {
    min-width: 150px; /* إعطاء مساحة لعمود الملاحظات */
    word-wrap: break-word; /* السماح بالتفاف النص */
}
.bs-aff-tab-content .woocommerce-table .bs-payout-amount {
    min-width: 100px;
    white-space: nowrap; /* منع التفاف المبلغ */
}
.bs-aff-tab-content .woocommerce-table .bs-payout-date {
    white-space: nowrap; /* منع التفاف التاريخ */
}
.bs-aff-tab-content .woocommerce-table .bs-payout-status {
    white-space: nowrap; 
}

/* --- 2. تصميم بطاقة إجمالي الأرباح (صفحة نظرة عامة) --- */
.bs-aff-total-earnings-card {
    background: linear-gradient(135deg, #4CAF50 0%, #81C784 100%); /* تدرج أخضر */
    color: #fff;
    padding: 25px 30px;
    border-radius: 10px;
    margin-top: 25px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid #eef2f6;
}
.bs-aff-total-earnings-card .label {
    font-size: 1.1em;
    font-weight: 500;
    opacity: 0.9;
    margin-bottom: 5px;
}
.bs-aff-total-earnings-card .value {
    font-size: 2.5em;
    font-weight: 700;
    line-height: 1.2;
}
/* جعل الخط داخل البطاقة أبيض ومتناسق */
.bs-aff-total-earnings-card .value .woocommerce-Price-amount {
    color: #fff !important; 
    font-size: 1em !important; /* ليتطابق مع حجم 2.5em */
    font-weight: 700 !important;
}