﻿/* Order Tracking & Receipt Styles 

   Used in: _OrderStatusModal.cshtml

   complements: combo.css (modal structure)

*/

/* --- 1. Modal Extras (Not in combo.css) --- */

/* Close Button Position */

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    line-height: 1;
    transition: color 0.2s;
}

    .close-btn:hover {
        color: #000;
    }

/* Form Layout */

#status-lookup-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

    #status-lookup-form input {
        text-align: center; /* Center text for ID input */
    }

/* Missing Status Colors (combo.css has confirmed/delivered/cancelled) */

.status-pending {
    background-color: #ffeeba;
    color: #856404;
}

.status-shipped {
    background-color: #cce5ff;
    color: #004085;
}

.status-returned {
    background-color: #e2e3e5;
    color: #383d41;
}


/* --- 2. RECEIPT STYLES (Required for JS output) --- */

.receipt-container {
    border: 2px dashed #ddd;
    background-color: #fffbf0; /* Light yellow receipt feel */

    padding: 20px;
    border-radius: 12px;
    font-family: 'Courier New', Courier, monospace;
    color: #333;
    text-align: left;
    margin-top: 20px;
}

.receipt-title {
    text-align: center;
    font-weight: 800;
    text-transform: uppercase;
    border-bottom: 2px dashed #ccc;
    padding-bottom: 10px;
    margin-bottom: 15px;
    font-size: 1.1rem;
    letter-spacing: 1px;
}

.receipt-header-details p {
    margin: 6px 0;
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Table Styles inside Receipt */

.receipt-summary-table {
    width: 100%;
    margin-top: 15px;
    border-top: 2px dashed #ccc;
    border-collapse: collapse;
}

    .receipt-summary-table td, .receipt-summary-table th {
        padding: 8px 0;
        font-size: 0.9rem;
        text-align: right;
    }

    .receipt-summary-table th {
        text-align: left;
        color: #555;
        font-weight: 600;
    }

/* Line items (injected by JS loop) */

.receipt-container tr td {
    font-size: 0.9rem;
    padding: 4px 0;
}

    .receipt-container tr td.qty {
        text-align: center;
    }

    .receipt-container tr td.price, .receipt-container tr td.total {
        text-align: right;
    }

.discount-amount {
    color: #dc3545;
}

.grand-total-row th, .grand-total-row td {
    border-top: 2px dashed #333;
    border-bottom: 2px dashed #333;
    font-weight: 900;
    font-size: 1.1rem;
    padding: 10px 0;
    color: #000;
}

.thank-you-message {
    text-align: center;
    margin-top: 20px;
    font-size: 0.85rem;
    color: #777;
}

/* --- 3. Loading Spinner --- */

.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 10px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2563eb; /* Matches --primary in combo.css */

    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {

    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* =========================================

   MOBILE RESPONSIVENESS (Add to bottom)

   ========================================= */

@media screen and (max-width: 600px) {

    /* 1. Make Modal Wider on Mobile */

    #order-status-modal .modal-content {
        width: 90%; /* Take up most of the screen width */

        margin: 10% auto; /* Center vertically with safe margin */

        padding: 15px; /* Reduce internal padding */
    }

    /* 2. Adjust Receipt Container */

    .receipt-container {
        padding: 15px; /* Save space */

        font-size: 0.85rem; /* Slightly smaller text for fit */
    }

    .receipt-header-details p {
        flex-direction: column; /* Stack Label and Value */

        align-items: flex-start;
        border-bottom: 1px dotted #e0e0e0;
        padding-bottom: 4px;
    }

    /* 3. Transform Line Items Table (The Complex Part) */

    /* We turn the table rows into "Cards" for better readability */

    .line-items-table {
        display: block;
        width: 100%;
    }

        .line-items-table tbody,
        .line-items-table tr,
        .line-items-table td {
            display: block; /* Make cells behave like div blocks */

            width: 100%;
            text-align: left !important; /* Force left align */

            padding: 2px 0;
            border: none;
        }

        .line-items-table tr {
            margin-bottom: 15px;
            border-bottom: 1px dashed #aaa;
            padding-bottom: 10px;
            position: relative;
        }

        /* Product Name: Bold and on top */

        .line-items-table td:first-child {
            font-weight: bold;
            font-size: 1rem;
            color: #000;
            padding-bottom: 5px;
        }

        /* Helper labels for Qty/Price/Total on mobile */

        .line-items-table td.qty::before {
            content: "Qty: ";
            color: #777;
        }

        .line-items-table td.price::before {
            content: "Price: ";
            color: #777;
        }

        .line-items-table td.total::before {
            content: "Total: ";
            font-weight: bold;
        }

        /* Make the Total stand out at the bottom of the card */

        .line-items-table td.total {
            margin-top: 5px;
            font-weight: bold;
            color: #333;
            background-color: #eee;
            padding: 5px;
            border-radius: 4px;
        }

    /* 4. Adjust Summary Table */

    .receipt-summary-table th,
    .receipt-summary-table td {
        font-size: 0.8rem;
    }
}
