/* --- New Stepper Styles --- */
.upload-stepper {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    padding: 0 10px;
}
.step-indicator {
    padding: 10px 20px;
    margin: 0 5px;
    border: 2px solid #ccc;
    border-radius: 20px;
    font-weight: 600;
    color: #888;
    background-color: #f0f0f0;
    transition: all 0.3s ease;
    cursor: default;
}
.step-indicator.active {
    border-color: #007bdb;
    color: #fff;
    background-color: #007bdb;
    box-shadow: 0 2px 5px rgba(0, 123, 219, 0.4);
}
.step-navigation {
    display: flex;
    justify-content: flex-end; /* Align buttons to the right */
    padding: 20px 0 0 0;
}
.step-navigation .prev-step-btn {
    margin-right: auto;
    background: #545454;
    color: #fff;
}
.step-content {
    min-height: 400px; /* Ensure visual stability when switching steps */
}

/* --- Instructions Card Styles (for Step 1) --- */
.instruction-card {
    font-family: Arial, sans-serif;
    max-width: 600px;
    margin: 20px auto;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    text-align: left;
}
.instruction-card h3 {
    color: #17a2b8;
    border-bottom: 2px solid #17a2b8;
    padding-bottom: 5px;
    margin-top: 15px;
    font-size: 1.25rem;
}
.instruction-card ul {
    list-style-type: disc;
    padding-left: 20px;
}
.instruction-card ul li {
    margin-bottom: 10px;
    line-height: 1.5;
    font-size: 0.95rem;
}
.instruction-card code {
    background-color: #eee;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: bold;
}
.instruction-card .note {
    padding: 10px;
    background-color: #fff0f0;
    border: 1px dashed #dc3545;
    border-radius: 4px;
    color: #dc3545;
    margin-top: 15px;
    text-align: center;
}
.instruction-card .note p {
    margin: 0;
}
/* Ensure the original form wrapper is centered */
.smart-bulk-upload-wrapper {
    max-width: 100%; /* Max width for consistency */
    margin: 0 auto;
}

.smart-bulk-upload-wrapper #step-1 {
    max-width: 650px; /* Max width for consistency */
    margin: 0 auto;
}




/* Existing CSS styles */
@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

#processing-status .status-icon, #voice-processing-status .status-icon {
    display: inline-block;
    animation: pulse 1.5s infinite;
}
/* All other existing CSS styles... (omitted for brevity, assume they are included) */

.smart-bulk-upload-container {
    max-width: 85%;
    margin: 40px auto;
    padding: 30px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    text-align: center;
}
.smart-bulk-upload-container .smart-bulk-upload-form {
    max-width: 600px;
    margin: 50px auto;
}
.form-title {
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 25px;
}
.upload-input-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
    max-width: 400px;
    margin: 10px auto;
}
.upload-input-wrapper input[type="file"] {
    position: absolute;
    left: 0; top: 0;
    width: 100%; height: 100%;
    opacity: 0;
    cursor: pointer;
}
.custom-file-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    background: #f8f8f8;
    border: 2px dashed #ccc;
    border-radius: 8px;
    color: #555;
    font-weight: 500;
    transition: all 0.25s ease;
    cursor: pointer;
}
.custom-file-label:hover {
    border-color: #007bdb;
    color: #007bdb;
    background: #eef6ff;
}
.icon {
    font-size: 1.2rem;
}
.file-preview {
    margin-top: 10px;
    text-align: center;
}
.file-name {
    display: block;
    font-size: 0.95rem;
    color: #444;
    margin-bottom: 6px;
}
#file-thumbnail {
    max-width: 180px;
    max-height: 180px;
    border-radius: 8px;
    border: 1px solid #ddd;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.progress-bar {
    width: 100%;
    background: #eee;
    border-radius: 6px;
    overflow: hidden;
    height: 10px;
    margin-top: 20px;
}
.progress-fill {
    height: 10px;
    width: 0;
    background: linear-gradient(90deg, #007bdb, #33c3f0);
    transition: width 0.3s ease;
}
.progress-text {
    display: block;
    font-size: 0.9rem;
    margin-top: 5px;
    color: #555;
}
.upload-btn {
    margin-top: 25px;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: 600;
    transition: background 0.3s ease, transform 0.2s ease;
}
.upload-btn:hover {
    background: #0062a8 !important;
    transform: translateY(-2px);
}
.upload-message {
    margin-top: 25px;
    text-align: left;
}
.upload-message .message {
    margin-bottom: 8px;
    padding: 10px 12px;
    border-radius: 5px;
    font-size: 0.95rem;
}
.message-success { background: #e6f9ec; color: #2d7a33; border: 1px solid #a7e3b1; }
.message-warning { background: #fff8e5; color: #856404; border: 1px solid #ffeeba; }
.message-error   { background: #fdecea; color: #b71c1c; border: 1px solid #f5c6cb; }
#invoice-review-container table.data-grid, #voice-review-container table.data-grid {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    border-radius: 8px;
    overflow: hidden;
    font-size: 0.95rem;
}
#invoice-review-container table.data-grid th,
#voice-review-container table.data-grid th,
#invoice-review-container table.data-grid td.
#voice-review-container table.data-grid td{
    padding: 12px 10px;
    border-bottom: 1px solid #e6e6e6;
    text-align: center;
}
#invoice-review-container table.data-grid th,
#voice-review-container table.data-grid th{
    background: #f4f7fb;
    font-weight: 600;
}
#invoice-review-container table.data-grid tr:hover,
#voice-review-container table.data-grid tr:hover{
    background: #f9fcff;
}
.low-confidence {
    background: #ffe5e5 !important;
}
#invoice-review-container .high-confidence,
#voice-review-container .high-confidence{
    background: #e9f9ee !important;
}
#confirm-cart-form button,
#voice-confirm-cart-form button{
    /*margin-top: 25px;*/
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 1rem;
}
.review-products-table select {
    -webkit-appearance: auto !important;
    -moz-appearance: auto !important;
    appearance: auto !important;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 6px 8px;
    background-color: #fff;
    width: 100%;
    cursor: pointer;
}
#export-matched-csv, #voice-export-matched-csv, #export-unmatched-csv, #voice-export-unmatched-csv{
    background: #606060;
    color: #fff5f5;
}
.remove-row-btn {
    background: none;
    border: none;
    color: #c0392b;
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.2s ease, transform 0.2s ease;
}

.remove-row-btn:hover {
    color: #e74c3c;
    transform: scale(1.2);
}

/* 🔍 Search box container */
#manual-add-container,
#voice-manual-add-container{
    position: relative;
    width: 100%;
    max-width: 700px;
    margin: 20px 0;
}

/* Label */
#manual-add-container .search-label,
#voice-manual-add-container .search-label{
    font-weight: 600;
    color: #333;
    font-size: 15px;
    display: inline-block;
    margin-bottom: 6px;
}

/* Input box styling */
#manual-search, #voice-manual-search {
    width: 100%;
    padding: 10px 40px 10px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    outline: none;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23999' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.415l-3.85-3.85zm-5.242.656a5 5 0 1 1 0-10 5 5 0 0 1 0 10z'/%3E%3C/svg%3E") no-repeat 12px center;
    background-size: 16px;
}

#manual-search:focus, #voice-manual-search:focus {
    border-color: #2684ff;
    box-shadow: 0 0 0 3px rgba(38,132,255,0.2);
}

/* Dropdown box for suggestions */
#manual-suggestions, #voice-manual-suggestions {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    z-index: 9999;
    border: 1px solid #ddd;
    border-radius: 6px;
    background-color: #fff;
    margin-top: 4px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    max-height: 280px;
    overflow-y: auto;
}

/* Each suggestion row */
#manual-suggestions .suggestion, #voice-manual-suggestions .suggestion {
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background-color 0.2s ease;
}

/* Highlight hover */
#manual-suggestions .suggestion:hover, #voice-manual-suggestions .suggestion:hover {
    background-color: #f4f8ff;
}

/* Product name */
#manual-suggestions .suggestion span.name, #voice-manual-suggestions .suggestion span.name {
    font-weight: 500;
    color: #222;
}

/* SKU text */
#manual-suggestions .suggestion small.sku, #voice-manual-suggestions .suggestion small.sku {
    color: #777;
    font-size: 12px;
    margin-left: 8px;
}

/* Optional confidence badge */
#manual-suggestions .confidence, #voice-manual-suggestions .confidence {
    background: #e3f2fd;
    color: #1976d2;
    font-size: 11px;
    font-weight: 600;
    border-radius: 10px;
    padding: 2px 8px;
    margin-left: 10px;
}

#pdf-preview {
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}
#pdf-preview:hover {
    transform: scale(1.01);
}
.voice-recorder {
    display: block;         /* Make it a block element */
    margin: 20px auto;      /* Center horizontally and add vertical spacing */
    width: 250px;           /* Set same width for all buttons */
    padding: 10px 0;        /* Vertical padding */
    text-align: center;     /* Center text */
    background: linear-gradient(to bottom, #4a90e2, #145c9e); /* Blue gradient */
    color: white;
    font-size: 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}
.voice-recorder-progress-bar {
    display: block;         /* Make it a block element */
    margin: 20px auto;      /* Center horizontally and add vertical spacing */
    width: 250px;           /* Set same width for all buttons */
    /* Vertical padding */
    text-align: center;     /* Center text */

    color: white;
    font-size: 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}
.voice-recorder-progress-text {
    display: block;         /* Make it a block element */
    margin: 20px auto;      /* Center horizontally and add vertical spacing */
    width: 250px;           /* Set same width for all buttons */
    /* Vertical padding */
    text-align: center;     /* Center text */

    border: none;
    border-radius: 8px;
    cursor: pointer;
}
.voice-recorder-progress-player{
    display: block;         /* Make it a block element */
    margin: 20px auto;      /* Center horizontally and add vertical spacing */


}
.rtl .instruction-card {
    font-family: Arial, sans-serif;
    max-width: 600px;
    margin: 20px auto;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    text-align: right;
}

.drop-area {
    width: 100%;
    padding: 25px;
    border: 2px dashed #999;
    border-radius: 10px;
    text-align: center;
    color: #666;
    transition: 0.3s;
    margin-bottom: 15px;
    background:#fafafa;
    max-width: 400px;
    display: inline-block;
}
.drop-area.dragover {
    border-color: #28a745;
    background: #e8ffe8;
    color: #28a745;
}
.smart_bulk_upload-text-index .page-title-wrapper, .smart_bulk_upload-invoice-index .page-title-wrapper, .smart_bulk_upload-audio-index .page-title-wrapper{
    text-align: center;
    padding-top: 20px;
    font-family: 'DM Sans 18pt', 'fontello', monospace;
}
.smart_bulk_upload-text-index .page-title-wrapper span, .smart_bulk_upload-invoice-index .page-title-wrapper span, .smart_bulk_upload-audio-index .page-title-wrapper span{
    font-family: 'DM Sans 18pt', 'fontello', monospace;
}

.freetext-search {
    width: 100%; /* تأكد من أنه يملأ الـ div */
    min-height: 100px; /* لجعله مرئياً أكثر */
    padding: 10px;
    border: 1px solid #ccc;
    box-sizing: border-box; /* لضمان أن العرض يشمل الحشو والحدود */
    font-size: 16px;
}

.freetext-search::placeholder {
    color: #999;
    font-style: italic;
    opacity: 1;
}
.freetext-search::-webkit-input-placeholder {
    color: #999;
    font-style: italic;
}
.freetext-search:-moz-placeholder {
    color: #999;
    font-style: italic;
    opacity: 1;
}
.freetext-search:-ms-input-placeholder {
    color: #999;
    font-style: italic;
}
.step-navigation{
    margin-top:30px;    
}
.step-navigation a{
    padding: 12px 20px;
    border-radius: 6px;
    width: 100%;
    font-size: 18px;
    font-weight: 600;
}
.smart_bulk_upload-audio-index .step-navigation{
    max-width: 250px;
    margin: auto;
}