/* my-php-website/assets/css/tracking.css (সম্পূর্ণ এবং চূড়ান্ত কোড) */

.tracking-page-container {
    max-width: 1200px;
    margin: 40px auto;
    font-family: 'Inter', sans-serif;
    color: #333;
}

/* === Wrapper for Generated Cards === */
.tracking-results-wrapper {
    display: none;
    display: flex;
    flex-direction: column;
    gap: 20px; /* ৪টি কার্ডের মাঝের গ্যাপ */
}

/* === Common Card Style === */
.tracking-search-card,
.track-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

/* === Card 1: Top Search Card Specifics === */
.tracking-search-card {
    margin-bottom: 20px;
}

.tracking-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.tracking-header i { font-size: 1.4rem; }
.tracking-header h2 { margin: 0; font-size: 1.5rem; font-weight: 600; }
.tracking-subtitle { color: #64748b; font-size: 0.95rem; margin-bottom: 25px; }

.tracking-form-group {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.tracking-input-wrapper { position: relative; flex-grow: 1; }
.tracking-input-wrapper i { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: #94a3b8; }
.tracking-input-wrapper input {
    width: 100%; padding: 12px 15px 12px 40px; border: 1px solid #cbd5e1;
    border-radius: 6px; font-size: 1rem; box-sizing: border-box; outline: none; transition: border-color 0.3s;
}
.tracking-input-wrapper input:focus { border-color: #0f172a; }

.btn-track-submit {
    background-color: #0f172a; color: white; border: none; padding: 12px 25px;
    border-radius: 6px; font-weight: 600; font-size: 0.95rem; cursor: pointer;
    transition: background-color 0.3s; white-space: nowrap;
}
.btn-track-submit:hover { background-color: #1e293b; }

.recent-tracking-section h5 { margin: 0 0 10px 0; color: #64748b; font-size: 0.85rem; font-weight: 500; }
.recent-tracking-tags { display: flex; flex-wrap: wrap; gap: 10px; }
.recent-tag {
    background: #fff; border: 1px solid #e2e8f0; padding: 6px 15px;
    border-radius: 20px; font-size: 0.85rem; color: #334155; cursor: pointer; transition: all 0.2s;
}
.recent-tag:hover { background: #f8fafc; border-color: #cbd5e1; }

/* === Card 2: Main Tracking Info Specifics === */
.result-header-row { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 30px; }
.result-title-section h3 { margin: 0 0 5px 0; font-size: 1.4rem; font-weight: 600; }
.result-subtitle { color: #64748b; font-size: 0.85rem; display: flex; align-items: center; gap: 6px; }
.result-actions { display: flex; gap: 10px; }

.action-btn-outline {
    background: #fff; border: 1px solid #e2e8f0; padding: 8px 15px; border-radius: 6px;
    color: #334155; font-size: 0.85rem; font-weight: 500; cursor: pointer; display: flex;
    align-items: center; gap: 6px; transition: all 0.2s;
}
.action-btn-outline:hover { background: #f8fafc; }

.tracking-info-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 40px; }
.info-box span.info-label { display: block; color: #64748b; font-size: 0.85rem; margin-bottom: 8px; }
.info-box .info-value { font-size: 0.95rem; font-weight: 500; color: #1e293b; display: flex; align-items: center; gap: 6px; }

/* Status Badge Colors */
.status-badge { padding: 5px 15px; border-radius: 20px; font-size: 0.85rem; font-weight: 600; display: inline-block; border: 1px solid #e2e8f0; background-color: #f8fafc; color: #334155; }
.status-badge.status-shipped { background-color: #dcfce7; color: #166534; border-color: #86efac; }
.status-badge.status-in-transit { background-color: #ffedd5; color: #9a3412; border-color: #fed7aa; }
.status-badge.status-delivered { background-color: #dbeafe; color: #1e40af; border-color: #bfdbfe; }
.status-badge.status-order-placed, .status-badge.status-order-confirmed { background-color: #f1f5f9; color: #334155; border-color: #e2e8f0; }
.status-badge.status-handed-over-to-courier { background-color: #ecfeff; color: #155e75; border-color: #a5f3fc; }
.status-badge.status-cancelled { background-color: #fee2e2; color: #991b1b; border-color: #fecaca; }
.status-badge.status-pending-payment { background-color: #fef9c3; color: #854d0e; border-color: #fde047; }
.status-badge.status-shipment-created { background-color: #e0e7ff; color: #3730a3; border-color: #c7d2fe; }
.status-badge.status-out-for-delivery { background-color: #fef08a; color: #854d0e; border-color: #fde047; }
.status-badge.status-hold { background-color: #fef3c7; color: #92400e; border-color: #fde68a; }
.status-badge.status-returning-to-origin, .status-badge.status-return-requested, .status-badge.status-return-accepted { background-color: #fee2e2; color: #991b1b; border-color: #fecaca; }
.status-badge.status-unknown-status { background-color: #fff7ed; color: #c2410c; border-color: #fed7aa; }

.progress-section { margin-bottom: 40px; }
.progress-header { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 0.85rem; font-weight: 600; color: #0f172a; }
.progress-header .percentage { color: #64748b; font-weight: 500; }
.progress-bar-container { width: 100%; height: 8px; background-color: #f1f5f9; border-radius: 4px; overflow: hidden; margin-bottom: 15px; }
.progress-bar-fill { height: 100%; background-color: #0f172a; border-radius: 4px; transition: width 0.8s ease-in-out; }
.progress-milestones { display: flex; justify-content: space-between; font-size: 0.8rem; color: #64748b; }
.milestone { display: flex; align-items: center; gap: 5px; }

.locations-container { display: flex; gap: 20px; }
.location-box { flex: 1; border: 1px solid #e2e8f0; border-radius: 6px; padding: 20px; position: relative; }
.location-box .loc-badge { position: absolute; top: -10px; right: 20px; background: #fff; padding: 0 10px; font-size: 0.8rem; color: #0f172a; font-weight: 600; border: 1px solid #e2e8f0; border-radius: 12px; }
.location-box h4 { margin: 0 0 5px 0; font-size: 1rem; font-weight: 600; color: #0f172a; }
.location-box p { margin: 0; font-size: 0.85rem; color: #64748b; }

/* === Card 3: Tabs Card Specifics (হুবহু ছবির মতো) === */
.track-card.track-card-tabs {
    background-color: #f4f6f8; /* ছবির মতো হালকা গ্রে/নীলচে ব্যাকগ্রাউন্ড */
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    display: flex;
    align-items: center;
}

.timeline-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    width: 100%;
    align-items: center;
}

.timeline-tabs::-webkit-scrollbar { display: none; }

.tab-btn {
    background: transparent;
    border: none;
    padding: 8px 18px;
    font-size: 0.95rem;
    font-weight: 500;
    color: #5c728a; /* ছবির মতো নীলচে গ্রে টেক্সট */
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    white-space: nowrap;
}

.tab-btn.active {
    background: #ffffff; /* Active ট্যাবটি সাদা হবে */
    color: #111827; /* গাঢ় কালো টেক্সট */
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); /* হালকা শ্যাডো */
    border: 1px solid #e5e7eb; /* হালকা বর্ডার */
}

.tab-btn:not(.active):hover {
    color: #111827;
    background: rgba(255, 255, 255, 0.5);
}

/* === Card 4: Timeline Body Specifics === */
.timeline-body {
    padding: 10px 0;
}

.timeline-title { margin: 0 0 5px 0; font-size: 1.4rem; font-weight: 600; color: #0f172a; }
.timeline-subtitle { margin: 0 0 30px 0; color: #64748b; font-size: 0.9rem; }
.timeline-list { display: flex; flex-direction: column; }
.timeline-item { display: flex; gap: 0; }

.timeline-visual { display: flex; flex-direction: column; align-items: center; width: 30px; margin-right: 15px; }

/* Modern Timeline Dot */
.timeline-dot {
    width: 28px; height: 28px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: 0.8rem;
    font-weight: 600; z-index: 2; flex-shrink: 0; position: relative;
    transition: all 0.3s ease;
}

/* Past Steps */
.timeline-dot.completed { 
    background: linear-gradient(135deg, #10b981, #059669); /* Vibrant Emerald Green */
    color: #fff; border: none;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.25);
}

/* Current Step */
.timeline-dot.current { 
    background: linear-gradient(135deg, #3b82f6, #4f46e5); /* Vibrant Blue-Indigo */
    color: #fff; border: none;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

/* Pulse animation for current step */
.pulse-ring {
    position: absolute; top: -5px; left: -5px; right: -5px; bottom: -5px;
    border-radius: 50%; border: 2px solid #3b82f6;
    animation: pulse-ring 2s cubic-bezier(0.24, 0, 0.38, 1) infinite;
    z-index: 1; pointer-events: none;
}

@keyframes pulse-ring {
    0% { transform: scale(0.8); opacity: 0.8; }
    100% { transform: scale(1.6); opacity: 0; }
}

.timeline-item:hover .timeline-dot {
    transform: scale(1.1);
}

.timeline-line {
    width: 2px; background-color: #e2e8f0; flex-grow: 1; margin: 6px 0; min-height: 40px; border-radius: 2px;
}

.timeline-content { padding-bottom: 30px; margin-top: 3px; width: 100%; }
.timeline-item:last-child .timeline-content { padding-bottom: 0; }
.timeline-content h4 { margin: 0 0 4px 0; font-size: 0.95rem; font-weight: 600; color: #0f172a; }
.timeline-time { display: inline-flex; align-items: center; gap: 6px; color: #64748b; font-size: 0.8rem; margin-bottom: 5px; }

/* Sub-status Design */
.timeline-sub-list {
    margin-top: 10px;
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
}

.timeline-sub-list::before {
    content: '';
    position: absolute;
    left: 2px;
    top: 6px;
    bottom: 10px;
    width: 2px;
    background: #e2e8f0;
    border-radius: 2px;
}

.timeline-sub-item {
    position: relative;
    padding-left: 20px;
}

.timeline-sub-item::before {
    content: '';
    position: absolute;
    left: -18px;
    top: 9px;
    width: 14px;
    height: 2px;
    background: #e2e8f0;
}

.timeline-sub-item::after {
    content: '';
    position: absolute;
    left: -6px;
    top: 6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #cbd5e1;
    transition: all 0.2s ease;
}

.timeline-sub-item:hover::after {
    border-color: #0f172a;
}

.sub-message {
    color: #475569;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 2px;
    line-height: 1.4;
}

.sub-time {
    color: #94a3b8;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* === Responsive Design === */
@media (max-width: 768px) {
    .tracking-info-grid { grid-template-columns: repeat(2, 1fr); }
    .locations-container { flex-direction: column; }
    .tracking-form-group { flex-direction: column; }
    .result-header-row { flex-direction: column; gap: 15px; }
}
@media (max-width: 480px) {
    .tracking-info-grid { grid-template-columns: 1fr; }
}

/* === Map Tracking Styles === */
.custom-map-marker, .custom-map-marker-pulse {
    display: flex; align-items: center; justify-content: center;
}
.pulse-map-ring {
    position: absolute;
    top: -8px; left: -8px; width: 31px; height: 31px;
    border-radius: 50%; border: 3px solid #ef4444;
    animation: pulse-ring 2s cubic-bezier(0.24, 0, 0.38, 1) infinite;
    z-index: 1; pointer-events: none;
}
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.leaflet-popup-content {
    font-family: 'Inter', sans-serif;
    margin: 10px 15px;
    line-height: 1.4;
}

/* === Card 6: Need Assistance Card === */
.contact-support-card {
    padding: 0;
}

.contact-card-header {
    padding: 25px 30px;
    border-bottom: 1px solid #e2e8f0;
}

.contact-card-header h3 {
    margin: 0 0 4px 0;
    font-size: 1.3rem;
    font-weight: 700;
    color: #0f172a;
}

.contact-card-header p {
    margin: 0;
    font-size: 0.88rem;
    color: #64748b;
}

.contact-card-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.contact-col {
    padding: 25px 30px;
    display: flex;
    flex-direction: column;
}

.carrier-col {
    border-right: 1px solid #e2e8f0;
}

.contact-col-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
}

.contact-col-title > i {
    font-size: 1.3rem;
    color: #0f172a;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border-radius: 50%;
    flex-shrink: 0;
}

.contact-col-title h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
}

.contact-col-title span {
    font-size: 0.82rem;
    color: #64748b;
}

/* Carrier Info Rows */
.carrier-info-rows {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 22px;
    flex: 1;
}

.carrier-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}

.carrier-info-row:last-child {
    border-bottom: none;
}

.carrier-info-label {
    font-size: 0.88rem;
    color: #64748b;
    font-weight: 400;
}

.carrier-info-value {
    font-size: 0.92rem;
    font-weight: 600;
    color: #0f172a;
}

.btn-contact-carrier {
    display: block;
    text-align: center;
    padding: 12px 20px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #0f172a;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: auto;
}

.btn-contact-carrier:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* Report Issue Column */
.report-intro {
    margin: 0 0 10px 0;
    font-size: 0.88rem;
    color: #64748b;
}

.report-issues-list {
    margin: 0 0 22px 0;
    padding-left: 18px;
    flex: 1;
}

.report-issues-list li {
    font-size: 0.85rem;
    color: #475569;
    margin-bottom: 6px;
    line-height: 1.5;
}

.report-issues-list li::marker {
    color: #94a3b8;
}

.btn-report-issue {
    display: block;
    text-align: center;
    padding: 12px 20px;
    border-radius: 8px;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    background: #0f172a;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: auto;
    border: none;
}

.btn-report-issue:hover {
    background: #1e293b;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
}

@media (max-width: 768px) {
    .contact-card-body {
        grid-template-columns: 1fr;
    }
    .carrier-col {
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
    }
}

/* === Card 5b: Details Tab Styles === */
.details-body {
    padding: 10px 0;
}

.details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.details-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 12px 0;
}

.details-info-box {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.details-info-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-bottom: 1px solid #f1f5f9;
}

.details-info-row:last-child {
    border-bottom: none;
}

.details-info-row-full {
    grid-template-columns: 1fr;
}

.details-field {
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.details-label {
    font-size: 0.82rem;
    color: #64748b;
    font-weight: 400;
    line-height: 1.4;
}

.details-value {
    font-size: 0.92rem;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.4;
}

.details-value-bold {
    font-size: 1rem;
    font-weight: 700;
}

.details-instructions-box {
    padding: 18px;
    min-height: 80px;
}

.details-instructions-text {
    margin: 0;
    font-size: 0.9rem;
    color: #475569;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .details-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .details-info-row {
        grid-template-columns: 1fr;
    }
}

/* === Card 5c: Documents Tab Styles === */
.documents-body {
    padding: 10px 0;
}

.documents-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

.document-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    transition: all 0.2s ease;
}

.document-row:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.document-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border-radius: 8px;
    flex-shrink: 0;
}

.document-icon i {
    font-size: 1.2rem;
    color: #64748b;
}

.document-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.document-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #0f172a;
}

.document-meta {
    font-size: 0.8rem;
    color: #94a3b8;
    font-weight: 400;
}

.document-download-btn {
    padding: 8px 20px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
    color: #0f172a;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.document-download-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

@media (max-width: 480px) {
    .document-row {
        flex-wrap: wrap;
    }
    .document-download-btn {
        width: 100%;
        text-align: center;
    }
}