/**
 * Invoice Wizard Styles
 * نسخه 7.0: استایل Wizard و رنگ‌بندی هوشمند
 */

/* ============================================
   Wizard Progress Bar
   ============================================ */

.wizard-container {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    overflow: hidden;
}

.wizard-steps {
    display: flex;
    justify-content: space-between;
    padding: 20px 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.wizard-step {
    display: flex;
    align-items: center;
    flex: 1;
    position: relative;
}

.wizard-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -20%;
    width: 40%;
    height: 2px;
    background: rgba(255,255,255,0.3);
    transform: translateY(-50%);
}

.wizard-step.completed:not(:last-child)::after {
    background: #4ade80;
}

.wizard-step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-left: 10px;
    transition: all 0.3s ease;
}

.wizard-step.active .wizard-step-number {
    background: white;
    color: #667eea;
    box-shadow: 0 0 0 4px rgba(255,255,255,0.3);
}

.wizard-step.completed .wizard-step-number {
    background: #4ade80;
    color: white;
}

.wizard-step-label {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.7);
}

.wizard-step.active .wizard-step-label {
    color: white;
    font-weight: 600;
}

.wizard-step.completed .wizard-step-label {
    color: #4ade80;
}

/* ============================================
   Item Status Colors
   ============================================ */

.item-matched {
    background: linear-gradient(90deg, #d4edda 0%, #fff 100%) !important;
    border-right: 4px solid #28a745 !important;
}

.item-warning {
    background: linear-gradient(90deg, #fff3cd 0%, #fff 100%) !important;
    border-right: 4px solid #ffc107 !important;
}

.item-needs-select {
    background: linear-gradient(90deg, #ffe5d0 0%, #fff 100%) !important;
    border-right: 4px solid #fd7e14 !important;
}

.item-not-matched {
    background: linear-gradient(90deg, #f8d7da 0%, #fff 100%) !important;
    border-right: 4px solid #dc3545 !important;
}

.item-gift {
    background: linear-gradient(90deg, #e2e3e5 0%, #fff 100%) !important;
    border-right: 4px solid #6c757d !important;
}

/* ============================================
   Status Badges
   ============================================ */

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-badge-matched { background: #d4edda; color: #155724; }
.status-badge-warning { background: #fff3cd; color: #856404; }
.status-badge-select { background: #ffe5d0; color: #c45d00; }
.status-badge-error { background: #f8d7da; color: #721c24; }
.status-badge-gift { background: #e2e3e5; color: #383d41; }

/* ============================================
   Conversion & Price Badges
   ============================================ */

.conversion-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    background: #e3f2fd;
    color: #1565c0;
    margin-right: 5px;
}

.conversion-badge.converted { background: #e8f5e9; color: #2e7d32; }

.price-diff-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
}

.price-diff-badge.warning { background: #fff3cd; color: #856404; }
.price-diff-badge.error { background: #f8d7da; color: #721c24; }

/* ============================================
   Quick Match Modal
   ============================================ */

.quick-match-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-match-item:hover {
    background: #f8f9fa;
    border-color: #667eea;
}

.quick-match-item.selected {
    background: #e8f4fd;
    border-color: #667eea;
}

.quick-match-score {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    margin-left: 15px;
}

.quick-match-score.high { background: #d4edda; color: #155724; }
.quick-match-score.medium { background: #fff3cd; color: #856404; }
.quick-match-score.low { background: #f8d7da; color: #721c24; }

/* ============================================
   Summary Cards
   ============================================ */

.summary-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.summary-stat {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

.summary-stat:last-child { border-bottom: none; }

.summary-stat-icon { width: 24px; margin-left: 10px; text-align: center; }
.summary-stat-label { flex: 1; color: #6c757d; }
.summary-stat-value { font-weight: 600; }

.summary-total {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: #667eea;
    color: white;
    border-radius: 8px;
    margin-top: 10px;
}

.summary-total-label { flex: 1; font-size: 1.1rem; }
.summary-total-value { font-size: 1.3rem; font-weight: 700; }

/* ============================================
   Invoice Group Cards
   ============================================ */

.invoice-group-card {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 10px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.invoice-group-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.invoice-group-card.selected {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.invoice-group-header {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.invoice-group-sender { font-weight: 600; font-size: 1.1rem; }
.invoice-group-date { font-size: 0.85rem; color: #6c757d; }

.invoice-group-stats { display: flex; gap: 15px; }

.invoice-group-stat-value { font-weight: 700; font-size: 1.2rem; }
.invoice-group-stat-label { font-size: 0.75rem; color: #6c757d; }

/* ============================================
   Animations
   ============================================ */

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

.fade-in { animation: fadeIn 0.3s ease forwards; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading-pulse { animation: pulse 1.5s ease-in-out infinite; }
