/**
 * أنماط بطاقة نقاط المقايضة المقدّرة + نافذة التأكيد + شاشة النجاح
 * المقايضة الذكية - منصة المقايضة
 * @since 3.1.0
 */

/* =============================================
   1. بطاقة نقاط المقايضة المقدّرة (الخطوة 6)
   ============================================= */

.hwk-points-estimate-card {
    position: relative;
    margin-bottom: 28px;
    border-radius: 16px;
    overflow: visible;
}

/* توهج خفيف حول البطاقة */
.hwk-points-estimate-glow {
    position: absolute;
    inset: -2px;
    border-radius: 18px;
    background: linear-gradient(135deg, #f59e0b, #f97316, #f59e0b);
    opacity: 0.35;
    filter: blur(8px);
    z-index: 0;
    animation: hwkGlowPulse 3s ease-in-out infinite;
}

@keyframes hwkGlowPulse {
    0%, 100% { opacity: 0.25; transform: scale(1); }
    50% { opacity: 0.45; transform: scale(1.01); }
}

.hwk-points-estimate-inner {
    position: relative;
    z-index: 1;
    background: linear-gradient(145deg, #fffbeb, #ffffff, #fff7ed);
    border: 2px solid #fbbf24;
    border-radius: 16px;
    padding: 28px 24px 20px;
    text-align: center;
    box-shadow:
        0 4px 20px rgba(245, 158, 11, 0.12),
        0 1px 3px rgba(0, 0, 0, 0.06);
}

/* أيقونة + عنوان البطاقة */
.hwk-points-estimate-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 16px;
}

.hwk-points-estimate-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: #fff;
    font-size: 18px;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.hwk-points-estimate-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #92400e;
}

/* الرقم الكبير */
.hwk-points-estimate-value {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    margin: 12px 0 8px;
    direction: ltr;
}

.hwk-points-estimate-num {
    font-size: 52px;
    font-weight: 800;
    color: #d97706;
    line-height: 1.1;
    letter-spacing: -1px;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hwk-points-estimate-num.hwk-points-updating {
    animation: hwkPointsUpdate 0.6s ease;
}

@keyframes hwkPointsUpdate {
    0% { transform: scale(1); color: #d97706; }
    30% { transform: scale(1.15); color: #f59e0b; }
    60% { transform: scale(0.97); color: #b45309; }
    100% { transform: scale(1); color: #d97706; }
}

/* نبض عند الظهور الأول */
.hwk-points-estimate-num.hwk-points-pulse {
    animation: hwkPointsPulse 1.5s ease-in-out;
}

@keyframes hwkPointsPulse {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.05); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

.hwk-points-estimate-unit {
    font-size: 20px;
    font-weight: 600;
    color: #b45309;
}

/* النص التوضيحي */
.hwk-points-estimate-note {
    margin: 0 0 4px;
    font-size: 14px;
    color: #78716c;
    font-weight: 500;
}

.hwk-points-estimate-subnote {
    margin: 0 0 14px;
    font-size: 12.5px;
    color: #a8a29e;
    line-height: 1.5;
}

/* زر طي/فتح الإخلاء المسؤولية */
.hwk-points-disclaimer-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 1px dashed #d6d3d1;
    border-radius: 8px;
    padding: 6px 14px;
    cursor: pointer;
    font-size: 12px;
    color: #78716c;
    transition: all 0.2s ease;
    font-family: inherit;
}

.hwk-points-disclaimer-toggle:hover {
    border-color: #f59e0b;
    color: #b45309;
    background: rgba(245, 158, 11, 0.04);
}

.hwk-points-disclaimer-arrow {
    font-size: 10px;
    transition: transform 0.3s ease;
}

.hwk-points-disclaimer-toggle[aria-expanded="true"] .hwk-points-disclaimer-arrow,
.hwk-points-disclaimer-toggle.hwk-open .hwk-points-disclaimer-arrow {
    transform: rotate(180deg);
}

/* محتوى الإخلاء */
.hwk-points-disclaimer-content {
    margin-top: 10px;
    padding: 12px 16px;
    background: rgba(245, 158, 11, 0.05);
    border: 1px solid #fde68a;
    border-radius: 10px;
    text-align: right;
    animation: hwkFadeSlideDown 0.3s ease;
}

.hwk-points-disclaimer-content p {
    margin: 0;
    font-size: 12.5px;
    color: #78716c;
    line-height: 1.7;
}

@keyframes hwkFadeSlideDown {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* حالة عدم توفر التقدير */
.hwk-points-estimate-card.hwk-points-unavailable .hwk-points-estimate-num {
    font-size: 22px;
    font-weight: 600;
    color: #78716c;
}

.hwk-points-estimate-card.hwk-points-unavailable .hwk-points-estimate-unit {
    display: none;
}

/* =============================================
   2. نافذة تأكيد الإرسال (Modal)
   ============================================= */

.hwk-confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: hwkOverlayIn 0.25s ease;
}

@keyframes hwkOverlayIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.hwk-confirm-modal {
    background: #ffffff;
    border-radius: 20px;
    width: 100%;
    max-width: 440px;
    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(245, 158, 11, 0.1);
    animation: hwkModalSlideIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

@keyframes hwkModalSlideIn {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* رأس النافذة */
.hwk-confirm-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #f3f4f6;
}

.hwk-confirm-modal-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hwk-confirm-modal-header h3 i {
    color: #f59e0b;
}

.hwk-confirm-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: none;
    background: #f3f4f6;
    color: #6b7280;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.hwk-confirm-modal-close:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* جسم النافذة */
.hwk-confirm-modal-body {
    padding: 24px;
}

/* قسم النقاط داخل النافذة */
.hwk-confirm-points-section {
    background: linear-gradient(135deg, #fffbeb, #fff7ed);
    border: 1.5px solid #fde68a;
    border-radius: 14px;
    padding: 20px;
    text-align: center;
    margin-bottom: 16px;
}

.hwk-confirm-points-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #92400e;
}

.hwk-confirm-points-label i {
    color: #f59e0b;
    font-size: 16px;
}

.hwk-confirm-points-value {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 6px;
    direction: ltr;
}

.hwk-confirm-points-value span:first-child {
    font-size: 44px;
    font-weight: 800;
    color: #d97706;
    line-height: 1.1;
}

.hwk-confirm-points-unit {
    font-size: 18px;
    font-weight: 600;
    color: #b45309;
}

/* إشعار داخل النافذة */
.hwk-confirm-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 18px;
}

.hwk-confirm-notice i {
    color: #3b82f6;
    font-size: 15px;
    margin-top: 2px;
    flex-shrink: 0;
}

.hwk-confirm-notice p {
    margin: 0;
    font-size: 13px;
    color: #1e40af;
    line-height: 1.6;
}

/* سؤال التأكيد */
.hwk-confirm-question {
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    color: #374151;
    margin: 0;
}

/* أزرار النافذة */
.hwk-confirm-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px 24px 24px;
}

.hwk-confirm-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    border-radius: 12px;
    border: none;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.25s ease;
}

.hwk-confirm-btn-approve {
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}

.hwk-confirm-btn-approve:hover {
    background: linear-gradient(135deg, #d97706, #ea580c);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.45);
    transform: translateY(-1px);
}

.hwk-confirm-btn-approve:active {
    transform: translateY(0);
}

.hwk-confirm-btn-approve.hwk-btn-loading {
    pointer-events: none;
    opacity: 0.8;
}

.hwk-confirm-btn-approve.hwk-btn-loading i {
    animation: hwkSpin 1s linear infinite;
}

@keyframes hwkSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.hwk-confirm-btn-cancel {
    background: #f3f4f6;
    color: #374151;
    border: 1.5px solid #d1d5db;
}

.hwk-confirm-btn-cancel:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

/* =============================================
   3. شاشة نجاح الإرسال
   ============================================= */

.hwk-result-success {
    text-align: center;
    padding: 40px 24px;
    max-width: 480px;
    margin: 0 auto;
}

.hwk-result-success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #16a34a, #22c55e);
    color: #fff;
    font-size: 32px;
    margin-bottom: 20px;
    box-shadow: 0 8px 24px rgba(22, 163, 74, 0.25);
    animation: hwkSuccessBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes hwkSuccessBounce {
    0% { transform: scale(0); }
    60% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.hwk-result-success h2 {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 800;
    color: #1f2937;
}

.hwk-result-success > p {
    margin: 0 0 24px;
    font-size: 14px;
    color: #6b7280;
    line-height: 1.5;
}

/* بطاقة النقاط في شاشة النجاح */
.hwk-result-points-card {
    background: linear-gradient(145deg, #fffbeb, #ffffff, #fff7ed);
    border: 1.5px solid #fde68a;
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
    animation: hwkFadeSlideDown 0.4s ease 0.3s both;
}

.hwk-result-points-card-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #92400e;
    margin-bottom: 8px;
}

.hwk-result-points-card-label i {
    color: #f59e0b;
}

.hwk-result-points-card-value {
    font-size: 36px;
    font-weight: 800;
    color: #d97706;
    direction: ltr;
    line-height: 1.1;
}

.hwk-result-points-card-value .hwk-result-points-unit {
    font-size: 16px;
    font-weight: 600;
    color: #b45309;
}

.hwk-result-points-note {
    font-size: 12px;
    color: #a8a29e;
    margin-top: 6px;
}

/* إشعار النجاح النهائي */
.hwk-result-notification {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    padding: 14px 18px;
    text-align: right;
    animation: hwkFadeSlideDown 0.4s ease 0.5s both;
}

.hwk-result-notification i {
    color: #16a34a;
    font-size: 20px;
    flex-shrink: 0;
}

.hwk-result-notification p {
    margin: 0;
    font-size: 13.5px;
    color: #166534;
    line-height: 1.6;
}

/* أزرار ما بعد النجاح */
.hwk-result-actions {
    display: flex;
    gap: 10px;
    margin-top: 28px;
    animation: hwkFadeSlideDown 0.4s ease 0.7s both;
}

.hwk-result-actions .hwk-wizard-btn {
    flex: 1;
}

/* =============================================
   4. التجاوب (Responsive)
   ============================================= */

@media (max-width: 640px) {
    .hwk-points-estimate-num {
        font-size: 40px;
    }

    .hwk-points-estimate-inner {
        padding: 20px 16px 16px;
    }

    .hwk-confirm-points-value span:first-child {
        font-size: 36px;
    }

    .hwk-confirm-modal {
        max-width: 100%;
        border-radius: 16px;
    }

    .hwk-confirm-modal-actions {
        flex-direction: column-reverse;
    }

    .hwk-result-success {
        padding: 28px 16px;
    }

    .hwk-result-points-card-value {
        font-size: 30px;
    }

    .hwk-result-actions {
        flex-direction: column;
    }
}

@media (max-width: 380px) {
    .hwk-points-estimate-num {
        font-size: 34px;
    }

    .hwk-points-estimate-header h3 {
        font-size: 16px;
    }

    .hwk-confirm-points-value span:first-child {
        font-size: 30px;
    }
}

/* =============================================
   5. تقليل الحركة (Accessibility)
   ============================================= */

@media (prefers-reduced-motion: reduce) {
    .hwk-points-estimate-glow,
    .hwk-points-estimate-num.hwk-points-pulse,
    .hwk-points-estimate-num.hwk-points-updating {
        animation: none;
    }

    .hwk-confirm-overlay,
    .hwk-confirm-modal,
    .hwk-points-disclaimer-content,
    .hwk-result-success-icon,
    .hwk-result-points-card,
    .hwk-result-notification,
    .hwk-result-actions {
        animation: none;
    }
}
