/* ==============================
   Barcode Scanner Modal Styles
   ============================== */

/* ---- Batch Mode Badge ---- */
.batch-mode-badge {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 10px;
    background-color: #ccc;
    color: #333;
    vertical-align: middle;
    margin-left: 6px;
}
.batch-mode-badge.active {
    background-color: #5cb85c;
    color: #fff;
}

/* ---- Toggle Switch (Batch Mode) ---- */
.switch-container {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}
.switch-container input[type="checkbox"] {
    display: none;
}
.switch-slider {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    background-color: #ccc;
    border-radius: 12px;
    transition: background-color 0.2s;
    flex-shrink: 0;
}
.switch-slider::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.switch-container input:checked ~ .switch-slider {
    background-color: #5cb85c;
}
.switch-container input:checked ~ .switch-slider::after {
    transform: translateX(20px);
}
.switch-label {
    font-weight: normal;
    margin: 0;
}

/* ---- Batch Header & Actions ---- */
.batch-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e0e0e0;
}
.batch-header h5 {
    margin: 0;
    font-size: 14px;
}
.batch-actions {
    display: flex;
    gap: 5px;
}

/* ---- Batch Items List ---- */
.batch-items-list {
    list-style: none;
    padding: 0;
    margin: 0 0 10px 0;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}
.batch-items-list li {
    padding: 6px 10px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.batch-items-list li:last-child {
    border-bottom: none;
}

/* ---- Barcode History Panel ---- */
.barcode-history-panel {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 10px;
    height: 100%;
}
.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e0e0e0;
}
.history-header h5 {
    margin: 0;
    font-size: 14px;
}
.history-actions {
    display: flex;
    gap: 4px;
}
.history-search {
    margin-bottom: 8px;
}

/* ---- History List ---- */
.history-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 320px;
    overflow-y: auto;
}
.history-list li {
    padding: 5px 8px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.15s;
}
.history-list li:hover {
    background-color: #f8f9fa;
}
.history-list li:last-child {
    border-bottom: none;
}

/* ---- Empty State ---- */
.empty-state {
    text-align: center;
    color: #999;
    padding: 20px 10px !important;
    font-style: italic;
    cursor: default !important;
}
.empty-state:hover {
    background-color: transparent !important;
}

/* ---- Reader Area ---- */
#reader {
    border: 2px dashed #ccc;
    border-radius: 6px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
#reader video {
    width: 100% !important;
    border-radius: 4px;
}

/* ---- Camera Error ---- */
#camera_error {
    margin-top: 6px;
    font-size: 13px;
}
