/* ====================================
   tracking-style.css
   هوية Wared App - صفحة تتبع الشحنة
   ==================================== */

:root {
    --primary-blue: #003366;
    --primary-blue-light: #004580;
    --secondary-orange: #ff8c00;
    --bg-color: #f0f4f8;
    --card-shadow: 0 4px 20px rgba(0,0,0,0.06);
    --card-shadow-hover: 0 8px 30px rgba(0,0,0,0.1);
    --text-dark: #1a1a1a;
    --text-muted: #888;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Tajawal', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: var(--bg-color);
    color: #333;
    padding-bottom: 85px;
    overflow-x: hidden;
    min-height: 100vh;
}

/* ========== Header ========== */
header {
    background: linear-gradient(135deg, #fff 0%, #f8fafc 100%);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 15px rgba(0,0,0,0.04);
    backdrop-filter: blur(10px);
}

.logo {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary-blue);
    letter-spacing: -1px;
}

.logo span { 
    color: var(--secondary-orange); 
}

.user-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #eef2f7 0%, #dfe6ed 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-blue);
    font-size: 1.1rem;
    cursor: pointer;
    border: 2px solid #e8ecf1;
    transition: all 0.3s;
}
.user-icon:hover {
    background: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
    transform: scale(1.05);
}

/* ========== Hero ========== */
.hero-section {
    position: relative;
    overflow: hidden;
    background: linear-gradient(160deg, #002b4f 0%, #003366 30%, #0a2a5e 70%, #001a33 100%);
    padding: 40px 20px 50px;
    color: white;
    border-bottom-left-radius: 40px;
    border-bottom-right-radius: 40px;
    margin-bottom: -20px;
}
.hero-section::before,
.hero-section::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}
.hero-section::before {
    top: -60px;
    right: -40px;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(255,140,0,0.25) 0%, transparent 70%);
}
.hero-section::after {
    bottom: -80px;
    left: -50px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255,255,255,0.04) 0%, transparent 70%);
}

.hero-content {
    position: relative;
    z-index: 2;
}
.hero-content h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 8px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}
.hero-content p {
    font-size: 1rem;
    opacity: 0.85;
    margin-bottom: 24px;
}

.search-box {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 5px;
    display: flex;
    align-items: center;
    border: 2px solid rgba(255,255,255,0.25);
    transition: all 0.3s;
    position: relative;
    z-index: 2;
}
.search-box:focus-within {
    background: rgba(255,255,255,0.22);
    border-color: rgba(255,255,255,0.5);
    box-shadow: 0 0 0 4px rgba(255,140,0,0.2);
}
.search-box form {
    width: 100%;
    display: flex;
    align-items: center;
}
.search-box i.fa-search {
    margin: 0 14px;
    font-size: 1.1rem;
    color: rgba(255,255,255,0.8);
}
.search-box input {
    border: none;
    outline: none;
    flex: 1;
    background: transparent;
    color: white;
    font-size: 1rem;
    font-weight: 500;
    padding: 12px 0;
}
.search-box input::placeholder {
    color: rgba(255,255,255,0.6);
    font-weight: 400;
}
.btn-search {
    background: var(--secondary-orange);
    border: none;
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    margin-left: 5px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(255,140,0,0.4);
}
.btn-search:hover {
    background: #ff9f20;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255,140,0,0.5);
}

/* ========== Main Container ========== */
.main-container {
    position: relative;
    z-index: 10;
    padding: 0 16px;
    margin-top: 30px;
}

/* ========== خط السير البصري ========== */
.pipeline-card {
    background: white;
    border-radius: 20px;
    padding: 24px 16px 20px;
    margin-bottom: 20px;
    box-shadow: var(--card-shadow);
    border: 1px solid #eef2f7;
    animation: fadeInUp 0.5s ease;
}

.pipeline {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    position: relative;
}

.pipeline-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    z-index: 2;
    position: relative;
    flex: 1;
}

.stage-dot {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #e8ecf1;
    color: #aaa;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.4s;
    position: relative;
    border: 3px solid #e8ecf1;
}
.stage-label {
    margin-top: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #bbb;
    transition: all 0.3s;
}

/* الخط الواصل بين المراحل */
.pipeline-line {
    height: 4px;
    background: #e8ecf1;
    flex: 1;
    margin: 24px 6px 0;
    position: relative;
    z-index: 1;
    border-radius: 10px;
    transition: background 0.4s;
}
.line-done {
    background: #198754;
}

/* حالات المراحل */
.stage-done .stage-dot {
    background: #198754;
    border-color: #198754;
    color: white;
    box-shadow: 0 0 0 6px rgba(25,135,84,0.15);
}
.stage-done .stage-label {
    color: #198754;
}

.stage-current .stage-dot {
    background: var(--secondary-orange);
    border-color: var(--secondary-orange);
    color: white;
    box-shadow: 0 0 0 8px rgba(255,140,0,0.2);
    animation: pulse 2s infinite;
}
.stage-current .stage-label {
    color: var(--secondary-orange);
    font-weight: 700;
}

.stage-failed .stage-dot {
    background: #dc3545;
    border-color: #dc3545;
    color: white;
    box-shadow: 0 0 0 6px rgba(220,53,69,0.2);
}
.stage-failed .stage-label {
    color: #dc3545;
}

.stage-pending .stage-dot {
    background: #f8fafc;
    border-color: #e8ecf1;
    color: #ccc;
}
.stage-pending .stage-label {
    color: #ccc;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255,140,0,0.35); }
    70% { box-shadow: 0 0 0 18px rgba(255,140,0,0); }
    100% { box-shadow: 0 0 0 0 rgba(255,140,0,0); }
}

/* رسالة تعذر التسليم */
.delivery-alert {
    background: #fff3cd;
    color: #856404;
    padding: 14px 16px;
    border-radius: 12px;
    margin-top: 20px;
    font-weight: 500;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #ffeeba;
    animation: fadeInUp 0.6s ease;
}
.delivery-alert i {
    font-size: 1.4rem;
}

/* ========== عناوين الأقسام ========== */
.section-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin: 20px 0 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.section-title i {
    color: var(--secondary-orange);
    font-size: 1.4rem;
}

/* ========== بطاقة المعلومات ========== */
.info-card {
    background: white;
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--card-shadow);
    border: 1px solid #eef2f7;
    animation: fadeInUp 0.6s ease;
}
.info-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 2px solid #f0f4f8;
}
.info-card-header i {
    font-size: 1.3rem;
    color: var(--secondary-orange);
    background: rgba(255,140,0,0.08);
    padding: 10px;
    border-radius: 12px;
}
.info-card-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary-blue);
    margin: 0;
}
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.info-item {
    background: #f8fafc;
    padding: 12px 14px;
    border-radius: 12px;
    transition: background 0.2s;
}
.info-item:hover {
    background: #eef2f7;
}
.info-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.info-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
}
.info-value.price {
    color: #198754;
}
.full-width {
    grid-column: 1 / -1;
}

/* ========== سجل التحديثات ========== */
.history-card {
    background: white;
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--card-shadow);
    border: 1px solid #eef2f7;
    animation: fadeInUp 0.8s ease;
}
.history-item {
    background: #f8fafc;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 10px;
    border-right: 4px solid var(--secondary-orange);
    transition: all 0.2s;
}
.history-item:last-child {
    margin-bottom: 0;
}
.hi-status {
    font-weight: 700;
    color: var(--text-dark);
    font-size: 0.95rem;
}
.hi-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.hi-notes {
    font-size: 0.8rem;
    color: #666;
    margin-top: 6px;
}

/* ========== رسالة الخطأ ========== */
.error-message {
    background: linear-gradient(135deg, #fff5f5 0%, #ffe3e3 100%);
    color: #c92a2a;
    padding: 18px 20px;
    margin: 0 0 20px;
    border-radius: 16px;
    text-align: center;
    font-weight: 500;
    border: 1px solid #ffc9c9;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    animation: fadeInUp 0.4s ease;
}

/* ========== لا توجد نتائج ========== */
.no-results {
    text-align: center;
    padding: 40px 20px;
    color: #aaa;
}
.no-results i {
    font-size: 4rem;
    display: block;
    margin-bottom: 16px;
    color: #ddd;
}

/* ========== شريط التنقل السفلي ========== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(20px);
    height: 70px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -4px 25px rgba(0,0,0,0.08);
    z-index: 2000;
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    padding-bottom: env(safe-area-inset-bottom, 0);
}
.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #999;
    font-size: 0.72rem;
    font-weight: 500;
    transition: all 0.3s;
    padding: 8px 12px;
    border-radius: 12px;
}
.nav-item.active {
    color: var(--primary-blue);
    background: rgba(0,51,102,0.06);
}
.nav-item i {
    font-size: 1.3rem;
    margin-bottom: 4px;
}

/* ========== تأثيرات حركية ========== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========== تجاوب الموبايل ========== */
@media (max-width: 600px) {
    .hero-content h1 {
        font-size: 1.6rem;
    }
    .hero-section {
        padding: 30px 16px 40px;
        border-bottom-left-radius: 30px;
        border-bottom-right-radius: 30px;
    }
    .info-grid {
        grid-template-columns: 1fr;
    }
    .pipeline {
        flex-direction: column;
        align-items: flex-start;
    }
    .pipeline-stage {
        flex-direction: row;
        width: 100%;
        margin-bottom: 12px;
    }
    .pipeline-line {
        display: none; /* في وضع العمود نستغني عن الخط الأفقي */
    }
    .stage-dot {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    .stage-label {
        margin-top: 0;
        margin-right: 12px;
        text-align: right;
    }
}