/* ===================================================
   ZD PORTAL - UI & DASHBOARD STYLES (RTL & Clean)
   =================================================== */

/* --- پایه --- */
.zd-portal-container,
.zd-portal-dashboard-wrapper {
    max-width: 960px;
    margin: 30px auto;
    padding: 24px;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    font-family: inherit;
    direction: rtl;
    box-sizing: border-box;
    color: #2c3e50;
}

.zd-portal-container *,
.zd-portal-dashboard-wrapper * {
    box-sizing: border-box;
}

/* --- سربرگ و خوش‌آمدگویی --- */
.zd-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #edf2f7;
    padding-bottom: 18px;
    margin-bottom: 25px;
}

.zd-user-welcome h3 {
    margin: 0 0 6px;
    font-size: 1.35rem;
    color: #1a202c;
    font-weight: 700;
}

.zd-user-mobile {
    display: inline-block;
    font-size: 0.88rem;
    color: #718096;
    background: #f7fafc;
    padding: 3px 10px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
}

/* --- بخش‌ها --- */
.zd-dashboard-section {
    margin-bottom: 35px;
}

.zd-dashboard-section h4 {
    margin: 0 0 16px;
    font-size: 1.1rem;
    color: #2d3748;
    position: relative;
    padding-right: 12px;
}

.zd-dashboard-section h4::before {
    content: '';
    position: absolute;
    right: 0;
    top: 4px;
    bottom: 4px;
    width: 4px;
    background: #3182ce;
    border-radius: 2px;
}

/* --- فرم‌های داشبورد --- */
.zd-form-section-title {
    font-size: 1.05rem;
    color: #2b6cb0;
    border-bottom: 1px dashed #e2e8f0;
    padding-bottom: 8px;
    margin: 22px 0 14px;
}

.zd-form-row {
    margin-bottom: 16px;
}

.zd-form-row label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    color: #4a5568;
}

.zd-form-row input[type="text"],
.zd-form-row input[type="tel"],
.zd-form-row input[type="password"],
.zd-form-row select,
.zd-form-row textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    font-size: 0.92rem;
    font-family: inherit;
    background: #fafafa;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.zd-form-row input:focus,
.zd-form-row select:focus,
.zd-form-row textarea:focus {
    outline: none;
    border-color: #3182ce;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.15);
}

.zd-form-row-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* --- دکمه‌های داشبورد --- */
.zd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 18px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    border: none;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    text-decoration: none;
}

.zd-btn-primary {
    background: #3182ce;
    color: #fff;
}

.zd-btn-primary:hover {
    background: #2b6cb0;
    color: #fff;
}

.zd-btn-success {
    background: #38a169;
    color: #fff;
}

.zd-btn-success:hover {
    background: #2f855a;
    color: #fff;
}

.zd-btn-outline-danger {
    background: transparent;
    color: #e53e3e;
    border: 1px solid #feb2b2;
}

.zd-btn-outline-danger:hover {
    background: #fff5f5;
    border-color: #e53e3e;
}

.zd-btn-sm {
    padding: 6px 12px;
    font-size: 0.82rem;
}

/* --- جدول درخواست‌های در انتظار --- */
.zd-table-responsive {
    overflow-x: auto;
}

.zd-dashboard-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 0.9rem;
}

.zd-dashboard-table th {
    background: #f7fafc;
    color: #4a5568;
    padding: 12px;
    border-bottom: 2px solid #e2e8f0;
    text-align: right;
    font-weight: 600;
}

.zd-dashboard-table td {
    padding: 12px;
    border-bottom: 1px solid #edf2f7;
    color: #4a5568;
}

/* --- نشان‌ها --- */
.zd-badge {
    display: inline-block;
    padding: 3px 9px;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 6px;
}

.zd-badge-warning {
    background: #fefcbf;
    color: #975a16;
}

.zd-badge-danger {
    background: #fed7d7;
    color: #9b2c2c;
}

.zd-badge-gold {
    background: #fffae0;
    color: #b7791f;
    border: 1px solid #f6e05e;
}

.zd-badge-blue {
    background: #ebf8ff;
    color: #2b6cb0;
}

.zd-badge-green {
    background: #f0fff4;
    color: #276749;
}

.zd-block-note {
    display: block;
    margin-top: 4px;
    color: #e53e3e;
    font-size: 0.78rem;
}

/* --- کارت‌های کسب‌وکارهای تاییدشده --- */
.zd-biz-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 12px;
}

.zd-biz-card {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px;
    background: #ffffff;
    transition: box-shadow 0.2s ease;
}

.zd-biz-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.zd-biz-card h5 {
    margin: 0 0 10px;
    font-size: 1.05rem;
    color: #1a202c;
}

.zd-biz-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    min-height: 24px;
}

.zd-biz-card-footer {
    display: flex;
    gap: 8px;
    border-top: 1px solid #f7fafc;
    padding-top: 12px;
}

/* --- وضعیت‌های خالی و پیام‌ها --- */
.zd-empty-state {
    padding: 30px;
    text-align: center;
    background: #f7fafc;
    border: 1px dashed #cbd5e0;
    border-radius: 10px;
    color: #718096;
}

.zd-alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 18px;
    font-size: 0.9rem;
}

.zd-alert-success {
    background: #f0fff4;
    color: #22543d;
    border: 1px solid #c6f6d5;
}

.zd-alert-error {
    background: #fff5f5;
    color: #742a2a;
    border: 1px solid #fed7d7;
}

.zd-alert-warning {
    background: #fffff0;
    color: #744210;
    border: 1px solid #fefcbf;
}

/* ===================================================
   مودال دریافت شماره لید
   =================================================== */

.zd-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: rgba(20, 24, 35, 0.72);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    direction: rtl;
}

.zd-modal-box {
    position: relative;
    width: 100%;
    max-width: 440px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 30px 28px 26px;
    background: #fff;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.24);
    font-family: inherit;
    direction: rtl;
    text-align: right;
    animation: zd-modal-enter 0.22s ease-out;
}

@keyframes zd-modal-enter {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.zd-modal-close {
    position: absolute;
    top: 14px;
    left: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #64748b;
    font-family: Arial, sans-serif;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.zd-modal-close:hover,
.zd-modal-close:focus {
    outline: none;
    background: #f1f5f9;
    color: #1e293b;
}

.zd-modal-box h3 {
    margin: 0 42px 12px 0;
    color: #172033;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.6;
}

.zd-modal-box p,
.zd-modal-description {
    margin: 0 0 18px;
    color: #64748b;
    font-size: 14px;
    line-height: 1.9;
}

.zd-form-group {
    margin: 20px 0 14px;
}

.zd-form-group input {
    display: block;
    width: 100%;
    min-height: 50px;
    padding: 12px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    background: #fff;
    color: #172033;
    font-family: inherit;
    font-size: 16px;
    text-align: center;
    direction: ltr;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.zd-form-group input::placeholder {
    color: #94a3b8;
    opacity: 1;
}

.zd-form-group input:focus {
    outline: none;
    border-color: #172b85;
    box-shadow: 0 0 0 3px rgba(23, 43, 133, 0.12);
}

.zd-error-msg {
    margin: 0 0 15px;
    padding: 10px 12px;
    border: 1px solid #fecaca;
    border-radius: 8px;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 13px;
    line-height: 1.7;
}

.zd-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    padding: 12px 18px;
    border: 0;
    border-radius: 9px;
    background: #172b85;
    color: #fff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.zd-submit-btn:hover,
.zd-submit-btn:focus {
    outline: none;
    background: #10206b;
    color: #fff;
    box-shadow: 0 5px 14px rgba(23, 43, 133, 0.2);
}

.zd-submit-btn:active {
    transform: translateY(1px);
}

/* --- حالت بارگذاری درخواست --- */
.zd-lead-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 72px;
    margin-top: 12px;
    color: #64748b;
    font-size: 14px;
    text-align: center;
}

.zd-lead-loading::before {
    content: '';
    width: 18px;
    height: 18px;
    margin-left: 10px;
    border: 2px solid #dbe3f1;
    border-top-color: #172b85;
    border-radius: 50%;
    animation: zd-lead-spin 0.75s linear infinite;
}

@keyframes zd-lead-spin {
    to {
        transform: rotate(360deg);
    }
}

/* --- نتیجه موفق و شماره تماس --- */
.zd-phone-result {
    margin-top: 22px;
    padding: 20px 16px;
    border: 1px solid #e6eaf2;
    border-radius: 12px;
    background: #f8faff;
    text-align: center;
}

.zd-phone-number {
    display: block;
    margin: 0 0 18px;
    color: #172033;
    font-family: Arial, sans-serif;
    font-size: 25px;
    font-weight: 700;
    letter-spacing: 0.4px;
    line-height: 1.5;
    direction: ltr;
    unicode-bidi: isolate;
}

.zd-direct-call-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    padding: 11px 18px;
    border: 0;
    border-radius: 9px;
    background: #172b85;
    color: #fff !important;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.5;
    text-align: center;
    text-decoration: none !important;
    transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.zd-direct-call-btn::before {
    content: '☎';
    margin-left: 9px;
    font-family: Arial, sans-serif;
    font-size: 17px;
    line-height: 1;
}

.zd-direct-call-btn:hover,
.zd-direct-call-btn:focus {
    outline: none;
    background: #10206b;
    color: #fff !important;
    text-decoration: none !important;
    box-shadow: 0 5px 14px rgba(23, 43, 133, 0.2);
}

.zd-direct-call-btn:active {
    transform: translateY(1px);
}

/* --- ریسپانسیو --- */
@media (max-width: 600px) {
    .zd-form-row-group {
        grid-template-columns: 1fr;
    }

    .zd-dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .zd-portal-container,
    .zd-portal-dashboard-wrapper {
        margin: 16px auto;
        padding: 18px;
    }

    .zd-modal-overlay {
        padding: 14px;
    }

    .zd-modal-box {
        max-width: 100%;
        max-height: calc(100vh - 28px);
        padding: 26px 20px 20px;
        border-radius: 14px;
    }

    .zd-modal-box h3 {
        font-size: 18px;
    }

    .zd-phone-number {
        font-size: 23px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .zd-modal-box,
    .zd-lead-loading::before {
        animation: none;
    }

    .zd-submit-btn,
    .zd-direct-call-btn,
    .zd-modal-close {
        transition: none;
    }
}
