/* ═══════════════════════════════════════════════════════════════
   Marsal Group — Frontend CSS (Phase C + D)
   Tracking Page + Blog + Article
   ═══════════════════════════════════════════════════════════════ */

/* ---- Variables ---- */
:root {
    --marsal-primary: #e63946;
    --marsal-primary-dark: #c62828;
    --marsal-dark: #1a1a2e;
    --marsal-navy: #16213e;
    --marsal-accent: #0f3460;
    --marsal-gold: #e2b44f;
    --marsal-success: #10b981;
    --marsal-info: #3b82f6;
    --marsal-warning: #f59e0b;
    --marsal-danger: #ef4444;
    --marsal-bg: #f0f4f8;
    --marsal-card: #ffffff;
    --marsal-text: #334155;
    --marsal-muted: #94a3b8;
    --marsal-border: #e2e8f0;
    --marsal-radius: 16px;
    --marsal-shadow: 0 4px 24px rgba(0,0,0,0.06);
    --marsal-shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
}

/* ---- Tracking Page ---- */
.marsal-tracking {
    direction: rtl;
    font-family: 'Cairo', 'Segoe UI', sans-serif;
    max-width: 960px;
    margin: 0 auto;
    padding: 0;
    color: var(--marsal-text);
}

/* Hero / Search */
.track-hero {
    position: relative;
    border-radius: var(--marsal-radius);
    overflow: hidden;
    margin-bottom: 32px;
    background: linear-gradient(135deg, var(--marsal-dark) 0%, var(--marsal-navy) 50%, var(--marsal-accent) 100%);
    padding: 60px 40px;
    text-align: center;
}

.track-hero-bg {
    position: absolute;
    inset: 0;
    opacity: 0.06;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.track-hero-content {
    position: relative;
    z-index: 1;
}

.track-logo {
    font-size: 3.5rem;
    margin-bottom: 12px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.track-hero h1 {
    color: #fff;
    font-size: 2rem;
    font-weight: 800;
    margin: 0 0 8px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.track-hero p {
    color: rgba(255,255,255,0.7);
    font-size: 1rem;
    margin: 0 0 28px;
}

.track-search-box {
    display: flex;
    gap: 12px;
    max-width: 560px;
    margin: 0 auto;
}

.track-input-wrap {
    flex: 1;
    position: relative;
}

.track-input-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
    opacity: 0.5;
}

.track-input-wrap input {
    width: 100%;
    padding: 16px 48px 16px 20px;
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 14px;
    font-size: 1.05rem;
    font-family: inherit;
    background: rgba(255,255,255,0.1);
    color: #fff;
    backdrop-filter: blur(10px);
    transition: all 0.3s;
    box-sizing: border-box;
}

.track-input-wrap input::placeholder {
    color: rgba(255,255,255,0.4);
}

.track-input-wrap input:focus {
    outline: none;
    border-color: var(--marsal-gold);
    background: rgba(255,255,255,0.15);
    box-shadow: 0 0 0 4px rgba(226,180,79,0.2);
}

#marsal-track-btn {
    padding: 16px 36px;
    background: var(--marsal-primary);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

#marsal-track-btn:hover {
    background: var(--marsal-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(230,57,70,0.4);
}

#marsal-track-btn:disabled {
    opacity: 0.7;
    cursor: wait;
}

.track-hints {
    margin-top: 16px;
    color: rgba(255,255,255,0.4);
    font-size: 0.82rem;
}

/* Shake animation */
@keyframes shake {
    0%,100% { transform: translateX(0); }
    20%,60% { transform: translateX(-6px); }
    40%,80% { transform: translateX(6px); }
}
.shake { animation: shake 0.4s ease; }

/* Error */
.track-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--marsal-radius);
    padding: 24px;
    text-align: center;
    margin-bottom: 24px;
    animation: slideUp 0.3s ease;
}

.track-error-icon { font-size: 2rem; margin-bottom: 8px; }
.track-error p { color: var(--marsal-danger); font-weight: 600; margin: 0; }

/* Results */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.track-results {
    animation: slideUp 0.5s ease;
}

/* Result Header */
.track-result-header {
    background: var(--marsal-card);
    border-radius: var(--marsal-radius);
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: var(--marsal-shadow);
    border: 1px solid var(--marsal-border);
}

.track-result-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 12px;
}

.track-result-title h2 {
    font-size: 1.3rem;
    color: var(--marsal-dark);
    margin: 0;
}

.track-status-badge {
    padding: 8px 20px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 700;
}

.badge-pending { background: #fef3c7; color: #92400e; }
.badge-booked { background: #dbeafe; color: #1e40af; }
.badge-in_transit { background: #cffafe; color: #155e75; }
.badge-at_port { background: #e0e7ff; color: #3730a3; }
.badge-customs_clearance { background: #fce7f3; color: #9d174d; }
.badge-customs_cleared { background: #d1fae5; color: #065f46; }
.badge-out_for_delivery { background: #fef9c3; color: #854d0e; }
.badge-delivered { background: #d1fae5; color: #065f46; border: 2px solid #10b981; }
.badge-on_hold { background: #f1f5f9; color: #475569; }
.badge-cancelled { background: #fee2e2; color: #991b1b; }

/* Route Visualization */
.track-route {
    display: flex;
    align-items: center;
    gap: 0;
}

.track-route-point {
    text-align: center;
    flex-shrink: 0;
    min-width: 120px;
}

.route-icon { font-size: 1.5rem; display: block; margin-bottom: 4px; }
.route-label { font-size: 0.75rem; color: var(--marsal-muted); display: block; }
.track-route-point strong { font-size: 0.95rem; color: var(--marsal-dark); }

.track-route-line {
    flex: 1;
    position: relative;
    height: 6px;
    margin: 0 16px;
}

.route-progress-bar {
    width: 100%;
    height: 6px;
    background: var(--marsal-border);
    border-radius: 3px;
    overflow: hidden;
}

.route-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--marsal-success), var(--marsal-info));
    border-radius: 3px;
    transition: width 1s ease;
}

.route-ship-icon {
    position: absolute;
    top: -14px;
    font-size: 1.4rem;
    transition: left 1s ease;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

/* Progress Steps */
.track-progress {
    background: var(--marsal-card);
    border-radius: var(--marsal-radius);
    padding: 28px 32px;
    margin-bottom: 24px;
    box-shadow: var(--marsal-shadow);
    border: 1px solid var(--marsal-border);
}

.track-progress h3 {
    font-size: 1.1rem;
    color: var(--marsal-dark);
    margin: 0 0 24px;
}

.track-steps {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    overflow-x: auto;
    gap: 0;
    padding-bottom: 8px;
}

.track-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex-shrink: 0;
    min-width: 80px;
}

.step-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--marsal-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
    transition: all 0.3s;
    border: 3px solid transparent;
}

.track-step.done .step-dot {
    background: var(--marsal-success);
    border-color: #a7f3d0;
}

.track-step.active .step-dot {
    background: var(--marsal-primary);
    border-color: #fecdd3;
    transform: scale(1.15);
    box-shadow: 0 0 0 6px rgba(230,57,70,0.15);
}

.step-label {
    font-size: 0.7rem;
    color: var(--marsal-muted);
    font-weight: 600;
    max-width: 80px;
    line-height: 1.3;
}

.track-step.done .step-label,
.track-step.active .step-label {
    color: var(--marsal-dark);
}

.step-connector {
    flex: 1;
    height: 3px;
    background: var(--marsal-border);
    margin-top: 16px;
    min-width: 12px;
}

/* Details Grid */
.track-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.track-detail-card {
    background: var(--marsal-card);
    border-radius: var(--marsal-radius);
    padding: 24px;
    box-shadow: var(--marsal-shadow);
    border: 1px solid var(--marsal-border);
}

.track-detail-card h4 {
    font-size: 1rem;
    color: var(--marsal-dark);
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--marsal-bg);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--marsal-bg);
}

.detail-row:last-child { border-bottom: none; }
.detail-row span { color: var(--marsal-muted); font-size: 0.85rem; }
.detail-row strong { color: var(--marsal-dark); font-size: 0.9rem; }

/* Timeline */
.track-timeline-section {
    background: var(--marsal-card);
    border-radius: var(--marsal-radius);
    padding: 28px 32px;
    margin-bottom: 24px;
    box-shadow: var(--marsal-shadow);
    border: 1px solid var(--marsal-border);
}

.track-timeline-section h3 {
    font-size: 1.1rem;
    color: var(--marsal-dark);
    margin: 0 0 24px;
}

.track-timeline {
    position: relative;
    padding-right: 28px;
}

.track-timeline::before {
    content: '';
    position: absolute;
    right: 8px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, var(--marsal-primary), var(--marsal-border));
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    padding: 0 24px 28px 0;
    animation: slideUp 0.4s ease both;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
    position: absolute;
    right: -24px;
    top: 4px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--marsal-border);
    border: 3px solid var(--marsal-card);
    box-shadow: 0 0 0 2px var(--marsal-border);
}

.timeline-item.latest .timeline-dot {
    background: var(--marsal-primary);
    box-shadow: 0 0 0 2px var(--marsal-primary), 0 0 0 6px rgba(230,57,70,0.2);
}

.timeline-content {
    background: var(--marsal-bg);
    border-radius: 12px;
    padding: 16px;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 8px;
}

.timeline-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}

.timeline-time {
    font-size: 0.78rem;
    color: var(--marsal-muted);
}

.timeline-location {
    font-size: 0.82rem;
    color: var(--marsal-accent);
    margin-bottom: 4px;
}

.timeline-desc {
    font-size: 0.85rem;
    color: var(--marsal-text);
    margin: 0;
    line-height: 1.6;
}

.track-no-updates {
    text-align: center;
    padding: 32px;
    color: var(--marsal-muted);
}

.track-no-updates span { font-size: 2.5rem; display: block; margin-bottom: 8px; }
.track-no-updates p { margin: 0; }

/* CTA */
.track-cta {
    background: linear-gradient(135deg, var(--marsal-dark), var(--marsal-navy));
    border-radius: var(--marsal-radius);
    padding: 32px;
    text-align: center;
    margin-bottom: 24px;
}

.track-cta p {
    color: rgba(255,255,255,0.8);
    margin: 0 0 16px;
    font-size: 1rem;
}

.track-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    margin: 0 6px;
    transition: all 0.3s;
    font-family: inherit;
}

.track-cta-btn.whatsapp {
    background: #25d366;
    color: #fff;
}

.track-cta-btn.whatsapp:hover {
    background: #1da851;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37,211,102,0.4);
}

.track-cta-btn.email {
    background: rgba(255,255,255,0.1);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
}

.track-cta-btn.email:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

/* ═══════════════════════════════════════════════════════════════
   Blog Page
   ═══════════════════════════════════════════════════════════════ */

.marsal-blog {
    direction: rtl;
    font-family: 'Cairo', 'Segoe UI', sans-serif;
    max-width: 960px;
    margin: 0 auto;
    padding: 20px 0;
    color: var(--marsal-text);
}

.blog-header {
    text-align: center;
    margin-bottom: 40px;
}

.blog-header h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--marsal-dark);
    margin: 0 0 8px;
}

.blog-header p {
    color: var(--marsal-muted);
    font-size: 1rem;
    margin: 0;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.blog-card {
    background: var(--marsal-card);
    border-radius: var(--marsal-radius);
    overflow: hidden;
    box-shadow: var(--marsal-shadow);
    border: 1px solid var(--marsal-border);
    transition: all 0.3s;
    text-decoration: none;
    color: inherit;
    display: block;
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--marsal-shadow-lg);
}

.blog-card-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: linear-gradient(135deg, var(--marsal-dark), var(--marsal-accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: rgba(255,255,255,0.3);
}

.blog-card-body {
    padding: 20px;
}

.blog-card-body h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--marsal-dark);
    margin: 0 0 8px;
    line-height: 1.5;
}

.blog-card-body .blog-excerpt {
    color: var(--marsal-muted);
    font-size: 0.85rem;
    line-height: 1.7;
    margin: 0 0 12px;
}

.blog-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    color: var(--marsal-muted);
    padding-top: 12px;
    border-top: 1px solid var(--marsal-bg);
}

.blog-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--marsal-muted);
}

.blog-empty span { font-size: 3rem; display: block; margin-bottom: 12px; }

/* Article Single */
.article-single {
    direction: rtl;
    font-family: 'Cairo', 'Segoe UI', sans-serif;
    max-width: 760px;
    margin: 0 auto;
    padding: 20px 0;
}

.article-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--marsal-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 24px;
    transition: all 0.2s;
}

.article-back:hover { color: var(--marsal-primary-dark); }

.article-header {
    margin-bottom: 32px;
}

.article-header h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--marsal-dark);
    line-height: 1.5;
    margin: 0 0 16px;
}

.article-meta {
    display: flex;
    gap: 16px;
    color: var(--marsal-muted);
    font-size: 0.85rem;
    flex-wrap: wrap;
}

.article-featured-img {
    width: 100%;
    border-radius: var(--marsal-radius);
    margin-bottom: 32px;
    box-shadow: var(--marsal-shadow);
}

.article-content {
    font-size: 1.05rem;
    line-height: 2;
    color: var(--marsal-text);
}

.article-content h2 { font-size: 1.5rem; color: var(--marsal-dark); margin: 32px 0 16px; }
.article-content h3 { font-size: 1.2rem; color: var(--marsal-dark); margin: 24px 0 12px; }
.article-content p { margin-bottom: 16px; }
.article-content img { max-width: 100%; border-radius: 12px; margin: 16px 0; }
.article-content blockquote {
    border-right: 4px solid var(--marsal-primary);
    padding: 16px 24px;
    margin: 24px 0;
    background: var(--marsal-bg);
    border-radius: 0 12px 12px 0;
    font-style: italic;
    color: var(--marsal-accent);
}

/* ═══════════════════════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .track-hero { padding: 40px 20px; }
    .track-hero h1 { font-size: 1.5rem; }
    .track-search-box { flex-direction: column; }
    .track-details-grid { grid-template-columns: 1fr; }
    .track-route { flex-direction: column; gap: 12px; }
    .track-route-line { width: 4px; height: 40px; margin: 0; }
    .track-steps { flex-wrap: wrap; justify-content: center; gap: 8px; }
    .step-connector { display: none; }
    .track-result-title { flex-direction: column; align-items: flex-start; }
    .blog-grid { grid-template-columns: 1fr; }
    .article-single { padding: 16px; }
    .track-cta-btn { display: block; margin: 8px auto; width: 80%; text-align: center; }
}
