/* fei-ui.css — تنسيقات قسم المدخلات الدولية (FEI) */

/* ============== شريط الإعدادات العلوي ============== */
.fei-config-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: end;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin: 1rem 0 1.5rem;
    direction: rtl;
}

.fei-config-bar label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: #0c4a6e;
    font-weight: 600;
    flex: 1 1 180px;
}

.fei-config-bar input,
.fei-config-bar select {
    padding: 0.55rem 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.9rem;
    background: #ffffff;
    color: #0f172a;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.fei-config-bar input:focus,
.fei-config-bar select:focus {
    border-color: #0ea5e9;
    outline: none;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.18);
}

.fei-config-bar .btn-primary {
    padding: 0.55rem 1.2rem;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #0284c7, #0369a1);
    color: white;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.1s, box-shadow 0.15s;
}

.fei-config-bar .btn-primary:hover {
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35);
}

.fei-config-bar .btn-primary:active {
    transform: translateY(1px);
}

/* ============== التبويبات ============== */
.fei-tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 1.5rem;
    direction: rtl;
    flex-wrap: wrap;
}

.fei-tab {
    padding: 0.7rem 1.3rem;
    border: none;
    background: transparent;
    color: #475569;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    transition: all 0.15s;
    position: relative;
}

.fei-tab:hover {
    background: #f1f5f9;
    color: #0ea5e9;
}

.fei-tab.active {
    color: #0369a1;
    background: #f0f9ff;
    border-bottom: 3px solid #0ea5e9;
    margin-bottom: -2px;
}

/* ============== بطاقات القسم ============== */
.fei-tab-pane {
    display: none;
    animation: feiFadeIn 0.25s ease-out;
}

.fei-tab-pane.active {
    display: block;
}

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

.fei-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    direction: rtl;
}

.fei-card h3 {
    margin: 0 0 1rem 0;
    color: #0c4a6e;
    font-size: 1.15rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e0f2fe;
}

.fei-card .form-row {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.fei-card .form-row input,
.fei-card .form-row select {
    flex: 1 1 200px;
    padding: 0.6rem 0.85rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.95rem;
    background: #f8fafc;
    font-family: inherit;
}

.fei-card .form-row input:focus,
.fei-card .form-row select:focus {
    outline: none;
    border-color: #0ea5e9;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

/* ============== بطاقة نتيجة التحقق ============== */
.fei-result-card {
    margin-top: 1rem;
    padding: 1.1rem 1.25rem;
    border-radius: 10px;
    border-right: 4px solid;
    direction: rtl;
    animation: feiFadeIn 0.25s ease-out;
}

.fei-result-card.success {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-color: #10b981;
}

.fei-result-card.error {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-color: #ef4444;
}

.fei-result-card.pending {
    background: linear-gradient(135deg, #fef9c3 0%, #fef08a 100%);
    border-color: #eab308;
}

.fei-result-card h4 {
    margin: 0 0 0.75rem 0;
    color: #0c4a6e;
    font-size: 1.05rem;
}

.fei-result-card.success h4 { color: #065f46; }
.fei-result-card.error h4   { color: #991b1b; }

.fei-result-card .field-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.6rem 1rem;
    margin: 0.75rem 0;
}

.fei-result-card .field {
    display: flex;
    flex-direction: column;
    background: rgba(255,255,255,0.6);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
}

.fei-result-card .field-label {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 600;
}

.fei-result-card .field-value {
    font-size: 0.95rem;
    color: #0f172a;
    font-weight: 700;
    margin-top: 2px;
}

/* ============== أزرار ============== */
.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    padding: 0.55rem 1.3rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    margin-top: 0.5rem;
    transition: box-shadow 0.15s, transform 0.1s;
}

.btn-success:hover { box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35); }
.btn-success:active { transform: translateY(1px); }

.btn-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border: none;
    padding: 0.55rem 1.3rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
}

.btn-warning:hover { box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35); }

/* ============== زر القائمة الجانبية ============== */
.sidebar-item.feiLinkClass {
    background: linear-gradient(135deg, #0ea5e9 0%, #0369a1 100%) !important;
    color: white !important;
    font-weight: 700;
    position: relative;
    overflow: hidden;
}

.sidebar-item.feiLinkClass::before {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #fbbf24, #f59e0b);
}

.sidebar-item.feiLinkClass:hover {
    background: linear-gradient(135deg, #0284c7 0%, #075985 100%) !important;
}

/* ============== شارة الحالة ============== */
.fei-badge {
    display: inline-block;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.fei-badge.ok    { background: #d1fae5; color: #065f46; }
.fei-badge.warn  { background: #fef3c7; color: #92400e; }
.fei-badge.err   { background: #fee2e2; color: #991b1b; }
.fei-badge.info  { background: #dbeafe; color: #1e40af; }

/* ============== تخطيط النتيجة + QR ============== */
.fei-result-layout {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.fei-result-fields {
    flex: 1 1 300px;
}

.fei-qr-block {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.7);
    border: 1px dashed #0ea5e9;
    border-radius: 10px;
    padding: 0.75rem;
}

.fei-qr-block canvas {
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

@media (max-width: 600px) {
    .fei-result-layout {
        flex-direction: column;
    }
    .fei-qr-block {
        align-self: center;
    }
}

/* ============== استجابة الجوال ============== */
@media (max-width: 768px) {
    .fei-config-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .fei-config-bar label {
        flex: 1 1 100%;
    }
    .fei-card .form-row {
        flex-direction: column;
    }
    .fei-card .form-row input,
    .fei-card .form-row select {
        flex: 1 1 100%;
    }
    .fei-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
    }
    .fei-tab {
        white-space: nowrap;
    }
}