/* === KeyBook Referral System - Complete Styles === */

/* ===== Wrapper ===== */
.kb-referral-wrapper {
    max-width: 960px;
    margin: 0 auto;
    font-family: Vazir, Tahoma, sans-serif;
    direction: rtl;
    color: #1e293b;
}

/* ===== Notification ===== */
.kb-notification {
    background: #d1fae5;
    border: 1px solid #6ee7b7;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 20px;
    color: #065f46;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ===== Subscription Status ===== */
.kb-subscription-status {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.kb-sub-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
    color: #013f98;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.kb-sub-active,
.kb-sub-expired,
.kb-sub-none {
    text-align: center;
}

.kb-sub-days {
    margin-bottom: 8px;
}

.kb-sub-number {
    font-size: 48px;
    font-weight: 700;
    color: #013f98;
    line-height: 1;
}

.kb-sub-unit {
    font-size: 16px;
    color: #64748b;
    margin-right: 6px;
}

.kb-sub-expiry {
    font-size: 13px;
    color: #94a3b8;
    margin-bottom: 16px;
}

.kb-sub-reward-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 13px;
    color: #16a34a;
    margin-bottom: 16px;
}

.kb-sub-warning {
    font-size: 18px;
    font-weight: 700;
    color: #d97706;
    margin-bottom: 8px;
}

.kb-sub-none p {
    color: #64748b;
    font-size: 13px;
    margin-bottom: 16px;
}

/* ===== Referral Box ===== */
.kb-referral-box {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.kb-box-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    color: #111;
    margin: 0 0 12px 0;
}

.kb-box-desc {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 20px;
    line-height: 1.8;
}

.kb-box-desc strong {
    color: #ff4d0f;
}

/* Link Row */
.kb-link-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.kb-link-input {
    flex: 1;
    padding: 12px 14px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-family: Vazir, Tahoma, sans-serif;
    font-size: 13px;
    direction: ltr;
    text-align: left;
    background: #f9fafb;
    color: #334155;
}

.kb-link-input:focus {
    outline: none;
    border-color: #ff4d0f;
    box-shadow: 0 0 0 3px rgba(255, 77, 15, 0.1);
}

.kb-btn-copy {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ff4d0f;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    cursor: pointer;
    font-family: Vazir, Tahoma, sans-serif;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.2s;
}

.kb-btn-copy:hover {
    background: #e0440d;
}

.kb-copy-msg {
    display: none;
    font-size: 12px;
    color: #059669;
    align-items: center;
    gap: 4px;
    margin-bottom: 16px;
}

/* Stats */
.kb-stats-row {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f1f5f9;
}

.kb-stat-box {
    flex: 1;
    text-align: center;
    padding: 12px;
    background: #f8fafc;
    border-radius: 10px;
}

.kb-stat-num {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: #013f98;
}

.kb-stat-label {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 4px;
}

/* ===== Rewards History ===== */
.kb-rewards-history {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.kb-history-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #013f98;
    margin: 0 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.kb-reward-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-radius: 10px;
    margin-bottom: 8px;
    font-size: 13px;
    transition: transform 0.2s;
}

.kb-reward-item:hover {
    transform: translateX(-4px);
}

.kb-reward-item.reward-referrer {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}

.kb-reward-item.reward-referred {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}

.kb-reward-item.reward-other {
    background: #fefce8;
    border: 1px solid #fde68a;
}

.kb-reward-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.kb-reward-days {
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
}

.reward-referrer .kb-reward-days { color: #3b82f6; }
.reward-referred .kb-reward-days { color: #16a34a; }
.reward-other .kb-reward-days { color: #ca8a04; }

.kb-reward-text {
    color: #334155;
}

.kb-reward-date {
    color: #94a3b8;
    font-size: 11px;
    white-space: nowrap;
}

/* ===== Help Box ===== */
.kb-help-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    font-size: 12px;
    color: #64748b;
    line-height: 1.8;
}

.kb-help-box strong {
    color: #334155;
}

/* ===== Buttons ===== */
.kb-btn-primary {
    display: inline-block;
    background: #ff4d0f;
    color: #fff;
    padding: 12px 28px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s;
}

.kb-btn-primary:hover {
    background: #e0440d;
    color: #fff;
    text-decoration: none;
}

/* ===== Mini Dashboard ===== */
.kb-referral-mini {
    background: #f8fafc;
    border-radius: 8px;
    padding: 12px;
    font-size: 13px;
}

.kb-referral-mini code {
    background: #e2e8f0;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    direction: ltr;
    display: inline-block;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .kb-link-row {
        flex-direction: column;
    }
    
    .kb-stats-row {
        flex-direction: column;
    }
    
    .kb-sub-number {
        font-size: 36px;
    }
    
    .kb-reward-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}