/* Font and general styles */
body {
    font-family: 'Noto Sans Bengali', sans-serif;
    background-color: #e9eff5;
    margin: 0;
    padding: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

/* Modern style for the main header */
.main-header {
    width: 100%;
    max-width: 1000px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 30px;
    background-color: #ffffff;
    border-radius: 12px;
    margin-bottom: 0px;
    position: relative;
    z-index: 10;
    border-bottom: 8px solid #F8637E;
}

.back-icon-container {
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    background-color: #f1f5f9;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.back-icon-container:hover {
    background-color: #e2e8f0;
    transform: scale(1.05);
}

.back-icon {
    width: 24px;
    height: 24px;
    color: #4a5568;
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
}

.logo-name-container {
    display: flex;
    align-items: center;
}

.company-logo {
    width: 30px;
    height: 30px;
    margin-right: 10px;
    transition: transform 0.3s ease;
}

.company-name {
    font-weight: 700;
    font-size: 1.4em;
    color: #F8637E;
}

.tracking-title {
    font-size: 1.1em;
    color: #7f8c8d;
    margin-top: 5px;
    font-weight: 400;
}

/* Updated container styling for a modern frame look */
.container {
    width: 100%;
    max-width: 1000px;
    background-color: #ffffff;
    padding: 30px;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    margin-top: 0px;
    flex-grow: 1;
    transition: all 0.5s ease;
}

h1 {
    color: #2c3e50;
    text-align: center;
    font-weight: 700;
    margin-bottom: 10px;
    font-size: 2.5rem;
}

.item-id-info {
    color: #34495e;
    text-align: left;
    font-weight: 600;
    margin-bottom: 15px;
}

/* Modified search-container style */
.search-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 30px;
    gap: 15px;
    position: relative;
}

.clear-input-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    margin-left: 8px;
	display: none; /* Hidden by default */
}

.clear-input-icon:hover {
    color: #e74c3c;
}

/* Updated search input styling for a smaller size */
#searchInput {
    width: 100%;
    max-width: 250px;
    padding: 8px 18px;
    border: 2px solid #ddd;
    border-radius: 25px;
    font-size: 1.4rem;
    font-weight: 700;
    color: #FF0000;
    flex-grow: 1;
    padding-right: 40px;
    transition: all 0.3s ease;
}

#searchInput:focus {
    outline: none;
    border-color: #3b5998;
    box-shadow: 0 0 10px rgba(59, 89, 152, 0.2);
}

#searchInput.valid {
    color: #3498db;
}

#searchInput.invalid {
    color: #e74c3c;
}

/* Updated search button styling for a smaller size */
.search-button {
    padding: 8px 25px;
    background-color: #3b5998;
    color: #fff;
    border: none;
    border-radius: 25px;
    font-size: 1.4em;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    text-align: center;
}

.search-button:hover {
    background-color: #2e4369;
    transform: translateY(-2px);
}

.search-button:active {
    transform: translateY(0);
}

.item-card {
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 1px 10px 10px 10px;
    margin-bottom: 7px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    position: relative;
}

/* New summary-box style */
.summary-box {
    border-left: 5px solid;
    padding: 15px 15px 15px 15px;
    margin-bottom: 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1em;
    animation: fadeIn 0.5s ease-in-out;
    position: relative;
}

.summary-box::after {
    content: 'Summary';
    position: absolute;
    right: 15px;
    top: 5px;
    color: #999;
    font-weight: 700;
    font-size: 0.9em;
}

/* Updated summary box border and background colors */
.summary-box.status-complete {
    border-color: #1a9062;
}

.summary-box.status-pending {
    border-color: #3b5998;
}

.summary-box.status-return {
    border-color: #d84315;
}

.summary-box.status-deleted {
    border-color: #616e7a;
}

.summary-box.status-rollback {
    border-color: #e6b22c;
}

.summary-icon {
    width: 28px;
    height: 28px;
    fill: currentColor;
}

.summary-text {
    flex-grow: 1;
}

.summary-status-label {
    font-weight: 700;
}

/* Status colors */
.status-color-item_booked,
.status-color-receive_item,
.status-color-booked,
.status-color-pending {
    color: #007bff;
    font-weight: bold;
}

.status-color-forwarded {
    color: #20c997;
    font-weight: bold;
}

.status-color-nondeliver {
    color: #e74c3c;
    font-weight: bold;
}

.status-color-item_rollback,
.status-color-rollback {
    color: #ffc107;
    font-weight: bold;
}

.status-color-return_to_sender,
.status-color-return {
    color: #c0392b;
    font-weight: bold;
}

.status-color-item_deleted,
.status-color-deleted {
    color: #6c757d;
    font-weight: bold;
}

.status-color-delivered_to_receipent,
.status-color-delivered_to_customer,
.status-color-complete {
    color: #28a745;
    font-weight: bold;
}

.status-color-failed {
    color: #e74c3c;
    font-weight: bold;
}

.status-color-received {
    color: #5F50CE;
    font-weight: bold;
}

.pair-header {
    display: flex;
    align-items: center;
    padding: 10px;
    border-radius: 8px;
    transition: background-color 0.3s;
}

.pair-header.clickable:hover {
    background-color: #f1f1f1;
    cursor: pointer;
}

.pair-header-text {
    font-weight: 700;
    margin-left: 10px;
    flex-grow: 1;
}

.pair-content {
    margin-top: 10px;
    animation: fadeIn 0.5s ease-in-out;
}

.pair-details {
    margin-top: 15px;
}

/* Table rounding styles */
/* ================= Table Styles ================= */
.pair-details table {
    width: 100%;
    border-collapse: separate;  /* প্রতিটি row আলাদা দেখানোর জন্য */
    border-spacing: 0 8px;      /* row এর মধ্যে gap */
    table-layout: auto;          /* auto-fit columns */
}

.pair-details th {
    background-color: #e9ecef;
    color: #495057;
    font-weight: 600;
    text-align: left;
    padding: 12px 15px;
    border-radius: 8px 8px 0 0;  /* top round */
}

.pair-details tbody tr {
    background-color: #f8f7ff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    border-radius: 8px;          /* row rounded */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pair-details tbody tr:hover {
    background-color: #e6e4ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.pair-details td {
    padding: 12px 15px;
    border-bottom: none;
    vertical-align: middle;
    word-wrap: break-word;
}

.pair-details td:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.pair-details td:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* Optional: Add subtle cell borders */
.pair-details td {
    border-right: 1px solid #e0e0e0;
}

.pair-details td:last-child {
    border-right: none;
}

/* ================= Small Screens ================= */
@media (max-width: 600px) {
    .pair-details th, .pair-details td {
        padding: 8px 10px;
        font-size: 0.85em;
    }
}

@media (max-width: 400px) {
    .pair-details th, .pair-details td {
        padding: 6px 8px;
        font-size: 0.8em;
    }
}

/* When the mouse is hovered */
.pair-details tbody tr:hover {
    background-color: #e6e4ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.pair-details td {
    text-align: left;
    padding: 12px 15px;
    border: none;
    font-size: 0.9em;
    vertical-align: middle;
}

/* Rounded corners for the first and last cells of each row */
.pair-details td:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.pair-details td:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

.pair-details th,
.pair-details td {
    text-align: left;
    padding: 12px 15px;
    border-bottom: none;
    font-size: 0.9em;
}

.footer {
    margin-top: 20px;
    text-align: center;
    color: #888;
}

.hidden-pair {
    display: none;
}

.image-box-container {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.image-box {
    width: 90px;
    height: 90px;
    border: 2px dashed #ccc;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-direction: column;
    text-align: center;
    font-size: 0.7em;
    color: #555;
    background-color: #f8f9fa;
}

.image-box:hover {
    transform: scale(1.05);
    border-color: #3b5998;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.image-box.no-image {
    transform: none;
    cursor: default;
    border-color: #ccc;
    box-shadow: none;
}

.image-box-label {
    font-size: 0.7em;
    margin-top: 5px;
    color: #555;
    word-break: break-word;
    padding: 0 5px;
    font-weight: 600;
}

.pair-details th:first-child,
.pair-details td:first-child {
    width: 50px;
}

/* 600px এর চেয়ে ছোট স্ক্রিনের জন্য প্রস্থ কমানো */
@media (max-width: 600px) {
    .pair-details th:first-child,
    .pair-details td:first-child {
        width: 0px;
    }
}

/* 400px এর চেয়ে ছোট স্ক্রিনের জন্য আরও প্রস্থ কমানো */
@media (max-width: 400px) {
    .pair-details th:first-child,
    .pair-details td:first-child {
        width: 30px;
    }
}

@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 15px;
    }

    .item-card {
        padding: 15px;
    }

    .pair-details th,
    .pair-details td {
        font-size: 0.8em;
        padding: 8px;
    }

    .pair-details table {
        table-layout: fixed;
    }

    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .pair-details table {
        min-width: 600px;
    }

    .main-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 10px 15px;
    }

    .header-content {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        text-align: right;
    }

    .back-icon {
        width: 20px;
        height: 20px;
    }

    .company-logo {
        width: 25px;
        height: 25px;
    }

    .company-name {
        font-size: 1.1em;
    }

    .tracking-title {
        font-size: 0.7em;
        margin-top: 5px;
    }

    .search-container {
        justify-content: center;
        align-items: center;
        gap: 10px;
        position: relative;
    }

    #searchInput {
        width: 100%;
        max-width: 200px;
        padding: 8px 15px;
        font-size: 1.2rem;
    }

    .search-button {
        width: auto;
        padding: 8px 15px;
        font-size: 1.2em;
    }

   

    .summary-box::after {
        font-size: 0.7em;
        right: 5px;
    }
}

/* 400px থেকে 649px স্ক্রিনের জন্য স্টাইল */
@media (min-width: 400px) and (max-width: 649px) {
    .search-container {
        position: relative;
    }

    
}

/* 300px থেকে 600px এর মধ্যে স্ক্রিন সাইজের জন্য সংশোধিত স্টাইল */
@media (min-width: 300px) and (max-width: 600px) {
    .summary-box {
        flex-direction: row;
        align-items: flex-start; /* আইকন এবং টেক্সট একই লাইনে থাকবে, কিন্তু টেক্সট বক্স উপরে থাকবে */
        padding: 10px;
        font-size: 0.9em;
        gap: 10px;
    }

    .summary-box::after {
        font-size: 0.7em;
        right: 10px;
    }

    .summary-icon {
        width: 24px;
        height: 24px;
        margin-right: 0;
        margin-top: 5px;
    }

    .summary-text {
        flex-grow: 1;
        display: flex;
        flex-direction: column; /* টেক্সটগুলো কলাম হিসেবে নিচে নিচে আসবে */
        flex-wrap: nowrap;
        gap: 5px;
    }

    .process-status-line {
        display: flex;
        align-items: center;
        flex-wrap: nowrap;
        gap: 5px;
    }

    .summary-status-label {
        font-size: 0.8em;
        font-weight: 700;
        margin-right: 5px;
    }

    .progress-container {
        width: auto; /* কন্টেইনারের প্রস্থ স্বয়ংক্রিয়ভাবে সেট হবে */
        margin-left: 0;
        justify-content: flex-start;
        margin-top: 0;
        flex-grow: 1;
    }

    .progress-info {
        display: none;
    }

    .process-status-line {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 5px;
        flex-wrap: nowrap;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .progress-bar-shell {
        height: 8px;
    }
}


.results-container {
    margin-top: 20px;
}

.loading-spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: #3b5998;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
    display: none;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

#toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 280px;
    max-width: 90%;
    background: rgba(255, 0, 0, 0.9);
    color: #fff;
    padding: 20px 25px;
    border-radius: 16px;
    font-size: .8em;
    font-weight: 300;
    text-align: center;
    z-index: 100;
    backdrop-filter: blur(6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease, transform 0.5s ease;
    animation: none;
}


#toast.show {
    opacity: 1;
    pointer-events: auto;
    animation: toastPop 0.5s ease-out;
}

@keyframes toastPop {
    0% {
        transform: translate(-50%, -60%) scale(0.9);
        opacity: 0;
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

.table-icon {
    width: 16px;
    height: 16px;
    vertical-align: middle;
}

.direction-cell {
    position: relative;
    padding-left: 20px !important;
    min-width: 50px;
}

.pair-details tbody tr:last-child .direction-cell::before {
    height: 50%;
}

.pair-details tbody tr:only-child .direction-cell::before {
    display: none;
}

.direction-cell::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10px;
    width: 2px;
    background-color: #ddd;
    height: 100%;
}

.direction-cell:first-child::before {
    top: 50%;
}

.direction-cell:last-child::before {
    height: 50%;
}

.direction-cell .icon-and-line {
    display: flex;
    align-items: center;
    position: relative;
    font-weight: 700;
}

.direction-cell .icon-and-line.starting-arrow {
    display: flex;
    align-items: center;
    font-weight: bold;
}

.direction-cell .icon-and-line:not(.starting-arrow)::before {
    content: '';
    position: absolute;
    left: -10px;
    width: 20px;
    height: 2px;
    background-color: currentColor;
}

.image-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    overflow: auto;
}

.image-popup img {
    width: auto;
    height: auto;
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}

.image-popup .close-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    padding: 0 15px;
    line-height: 1;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Progress Bar Styles */
.progress-container {
    display: flex;
    align-items: center;
    width: 150px;
    margin-left: 10px;
    position: relative;
    gap: 5px;
}

.process-status-line {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.process-status-line>* {
    margin-right: 5px;
}

.process-status-info {
    display: flex;
    align-items: center;
}

.progress-bar-shell {
    width: 100%;
    height: 10px;
    background-color: #e9ecef;
    border-radius: 5px;
    overflow: hidden;
    display: flex;
}

.progress-segment {
    height: 100%;
    transition: background-color 0.3s ease-in-out;
}

/* Progress Segment Colors (Matching status text colors) */
.progress-segment-booked {
    background-color: #007bff;
}

.progress-segment-received {
    background-color: #5F50CE;
}

.progress-segment-forwarded {
    background-color: #20c997;
}

.progress-segment-delivered-to-customer {
    background-color: #28a745;
}

.progress-segment-return {
    background-color: #c0392b;
}

.progress-segment-deleted {
    background-color: #6c757d;
}

.progress-segment-nondeliver {
    background-color: #e74c3c;
}

.progress-info {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8em;
    font-weight: 700;
    color: #495057;
}

.progress-icon {
    width: 16px;
    height: 16px;
}

/* Adjustments for responsiveness */
@media (max-width: 600px) {
    .summary-box {
        flex-direction: column;
        align-items: flex-start;
    }

    .summary-box .progress-container {
        width: 100%;
        margin-left: 0;
        margin-top: 15px;
        justify-content: flex-start;
    }

    .process-status-line {
        flex-direction: row;
        align-items: center;
        flex-wrap: nowrap;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* ✅ 300px থেকে 600px স্ক্রিনে summary-box এ progress bar এবং status icon উপরে দেখানোর জন্য */
@media (min-width: 300px) and (max-width: 600px) {
    .summary-box {
        flex-direction: column-reverse !important; /* নিচের এলিমেন্ট উপরে আসবে */
        align-items: flex-start;
    }

    .summary-text {
        display: flex;
        flex-direction: column;
        gap: 5px;
        width: 100%;
    }

    .progress-container {
        order: -1; /* উপরে আনার জন্য */
        width: 100%;
        margin: 0 0 5px 0;
        justify-content: flex-start;
    }

    .process-status-line {
        order: -1; /* উপরে আনার জন্য */
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
        gap: 5px;
    }

    .progress-text {
        font-size: 0.7em;
    }

    .progress-bar-shell {
        height: 8px;
    }

    .summary-status-label {
        font-size: 0.8em;
        font-weight: 700;
    }

    .summary-icon {
        width: 24px;
        height: 24px;
        margin-bottom: 8px;
    }
}

@media (min-width: 300px) and (max-width: 600px) {
    .search-container {
        display: flex;
        flex-direction: row;
        align-items: center;         /* Vertically center */
        justify-content: center;
        gap: 6px;
        padding: 10px;
        flex-wrap: nowrap;
    }

    #searchInput {
        width: 13ch;
        padding: 8px 12px;
        font-size: 1rem;
        border: 2px solid #ddd;
        border-radius: 20px;
        font-weight: 700;
        color: #FF0000;
        flex-shrink: 0;
    }

    .search-button {
        padding: 8px 14px;
        font-size: 1rem;
        background-color: #3b5998;
        color: #fff;
        border: none;
        border-radius: 20px;
        cursor: pointer;
        flex-shrink: 0;
        display: flex;
        align-items: center;
    }

    .clear-input-icon {
        align-items: center;
        justify-content: center;
        font-size: 20px;
        color: #999;
        cursor: pointer;
        flex-shrink: 0;
        height: 100%;
        position: static !important;
        margin-left: 4px;
        margin-top: 0 !important;          /* ✅ নিশ্চিত করে উপরে যাবে না */
        transform: none !important;        /* ✅ আগের transform সরিয়ে দিন */
    }

    .clear-input-icon:hover {
        color: #e74c3c;
    }
}

.receipt-button-container {
    margin-top: 15px; /* ২ স্পেস নিচে আনার জন্য */
    display: flex; /* বাটন দুটি পাশাপাশি আনার জন্য */
    gap: 10px; /* বাটন দুটির মধ্যে ১০ পিক্সেল ফাঁকা রাখার জন্য */
    justify-content: center; /* বাটনগুলোকে কেন্দ্রে আনার জন্য */
}

/* দুটি বাটনের জন্য সাধারণ স্টাইল */
.receipt-button {
    padding: 8px 15px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: bold;
    /* অন্যান্য স্টাইল... */
}

/* Generate বাটনের জন্য আলাদা স্টাইল */
.generate-btn {
    background-color: #007bff; /* নীল বা আপনার পছন্দের রং */
    color: white;
}

/* View বাটনের জন্য আলাদা স্টাইল */
.view-btn {
    background-color: #28a745; /* সবুজ বা অন্য কোনো রং */
    color: white;
}

