/**
 * @file
 * =================================================================================
 * City4Market - ملف الأنماط لصفحة تتبع الطلب (track-order-style.css)
 * =================================================================================
 *
 * @version 2.0 - (10 أغسطس 2025)
 * @author Gemini
 *
 * @description
 * ملف أنماط محسن بالكامل لصفحة تتبع الطلب، مع إعادة تصميم شريط حالة الطلب
 * ليكون أكثر تفاعلية ووضوحًا.
 *
 * @enhancements
 * - **شريط حالة ديناميكي**: إعادة تصميم كامل لشريط تتبع حالة الطلب.
 * - **تحسين التصميم**: تصميم متناسق وجذاب لبطاقات البحث والنتائج.
 * - **كود منظم**: هيكلة شاملة مع تعليقات عربية مفصلة.
 */

/* --- 1. متغيرات عامة وإعادة الضبط --- */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #1abc9c;
    --success-color: #27ae60;
    --text-color: #34495e;
    --text-light: #7f8c8d;
    --bg-light: #f4f6f9;
    --bg-white: #ffffff;
    --border-color: #e8eaf0;
    --danger-color: #e74c3c;
    --radius-lg: 16px;
    --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.07);
    --focus-ring-color: rgba(26, 188, 156, 0.4);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Cairo', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-color);
    line-height: 1.8;
}

.container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 20px;
}

/* --- 2. الرأس والفوتر --- */
.page-header { background-color: var(--primary-color); padding: 1rem 0; box-shadow: 0 2px 10px rgba(0,0,0,0.1); text-align: center; }
.logo { color: var(--bg-white); font-size: 1.8rem; font-weight: 900; text-decoration: none; }

/* --- 3. العناوين الرئيسية والبطاقات --- */
.page-title { text-align: center; color: var(--primary-color); font-size: 2.2rem; margin-bottom: 0.5rem; }
.page-subtitle { text-align: center; color: var(--text-light); font-size: 1.1rem; margin-bottom: 2rem; }

.track-card {
    background: var(--bg-white);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
}

/* --- 4. نموذج البحث --- */
#track-form { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.search-options { display: flex; gap: 1.5rem; margin-bottom: 1rem; width: 100%; }
.search-options label { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; font-weight: 600; }
.form-group { flex-grow: 1; }
#searchInput {
    width: 100%;
    min-height: 52px;
    padding: 0.8rem 1.2rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1.1rem;
    transition: all 0.2s ease;
}
#searchInput:focus-visible {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 4px var(--focus-ring-color);
}
.track-btn {
    min-height: 52px;
    padding: 0.8rem 2rem;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}
.track-btn:hover { background-color: #16a085; }
.track-btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--focus-ring-color); }
.track-btn:disabled { background-color: var(--text-light); cursor: wait; }
.error-message { color: var(--danger-color); font-weight: 600; margin-top: 1rem; width: 100%; }
.hidden { display: none !important; }

/* --- 5. بطاقة النتائج --- */
.results-title {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 2.5rem;
}

/* --- 6. **محسن**: شريط تتبع حالة الطلب --- */
.status-timeline {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin-bottom: 3rem;
}
.status-timeline::before { /* الخط الرمادي الأساسي */
    content: '';
    position: absolute;
    top: 25px; /* في منتصف الأيقونة */
    right: 25px;
    left: 25px;
    height: 4px;
    background-color: var(--border-color);
    z-index: 1;
}
.status-timeline .status-step {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-light);
    font-weight: 600;
}
.status-step .icon-wrapper {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--bg-white);
    border: 4px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}
.status-step.active {
    color: var(--success-color);
}
.status-step.active .icon-wrapper {
    background-color: var(--success-color);
    border-color: var(--success-color);
    color: white;
    transform: scale(1.1);
}
/* الخط الأخضر الذي يظهر عند اكتمال المراحل */
.status-step.active::before {
    content: '';
    position: absolute;
    top: 25px;
    right: 50%;
    width: 100%;
    height: 4px;
    background-color: var(--success-color);
    z-index: 1; /* يظهر فوق الخط الرمادي */
}
/* إخفاء الخط الأخضر للمرحلة الأولى */
.status-timeline .status-step:first-of-type::before {
    width: 0;
}

/* --- 7. تفاصيل الطلب --- */
.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}
.detail-box {
    background-color: var(--bg-light);
    padding: 1.25rem;
    border-radius: 8px;
}
.detail-box .label { display: block; font-weight: 600; color: var(--text-light); margin-bottom: 0.25rem; }
.detail-box .value { font-weight: 700; font-size: 1.1rem; }
.detail-box.full-width { grid-column: 1 / -1; }
.detail-box.total .value { color: var(--success-color); font-size: 1.4rem; }

.back-to-store { text-align: center; }
.action-btn {
    padding: 0.8rem 1.8rem; font-size: 1.1rem; font-weight: 700;
    color: var(--primary-color); background-color: transparent;
    border: 2px solid var(--primary-color); border-radius: 8px;
    cursor: pointer; text-decoration: none; transition: all 0.3s ease;
}
.action-btn:hover { background: var(--primary-color); color: #fff; }