/* File: ~/wms_project/modules/receiving/static/css/scanner_base.css */

/* ========================================
   RESET & BASE
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #2c3e50;
    background-color: #e8e8e8;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   UPPERCASE INPUT STYLING
   ======================================== */
.uppercase-input {
    text-transform: uppercase !important;
}

/* ========================================
   SCANNER WRAPPER - RESPONSIVE
   ======================================== */
.scanner-wrapper {
    max-width: 480px;
    min-height: 100vh;
    margin: 0 auto;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

/* Mobile: full width */
@media (max-width: 480px) {
    .scanner-wrapper {
        max-width: 100%;
        box-shadow: none;
    }
}

/* ========================================
   HEADER
   ======================================== */
.scanner-header {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    display: grid;
    grid-template-columns: 60px 1fr auto;
    align-items: center;
    background-color: #34495e;
    color: #ffffff;
    padding: 0 8px;
    height: 60px;
    border-bottom: 2px solid #2c3e50;
    z-index: 1000;
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-right: 0;
}

.header-center {
    text-align: center;
}

.header-center h1 {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: none;
    background-color: rgba(255, 255, 255, 0.15);
    background-image: url('/static/scanner/images/arrow-big-left-dash.svg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 24px 24px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    text-decoration: none;
    /* Filter to make SVG white */
    filter: brightness(0) invert(1);
}

.back-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.back-btn:active {
    background-color: rgba(255, 255, 255, 0.25);
}

.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border: none;
    background-color: rgba(255, 255, 255, 0.15);
    background-image: url('/static/scanner/images/power.svg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 24px 24px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    filter: brightness(0) invert(1);
}

.logout-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.logout-btn:active {
    background-color: rgba(255, 255, 255, 0.25);
}

.user-badge {
    font-size: 12px;
    padding: 4px 8px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ========================================
   MAIN CONTENT
   ======================================== */
.scanner-content {
    flex: 1;
    padding: 16px;
    padding-top: 76px;
    overflow-y: auto;
}

/* ========================================
   GRID LAYOUTS
   ======================================== */
.data-grid {
    display: grid;
    gap: 1px;
    background-color: #d0d0d0;
    border: 1px solid #d0d0d0;
    margin-bottom: 16px;
}

.grid-row {
    display: grid;
    grid-template-columns: 120px 1fr;
    background-color: #ffffff;
}

.grid-label {
    padding: 12px;
    background-color: #f5f5f5;
    font-weight: 600;
    font-size: 14px;
    color: #5a5a5a;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.grid-value {
    padding: 12px;
    background-color: #ffffff;
    font-size: 16px;
    color: #2c3e50;
}

.grid-value.highlight {
    background-color: #f8f9fa;
    font-weight: 600;
}

/* Full width row */
.grid-row.full {
    grid-template-columns: 1fr;
}

/* ========================================
   CARDS
   ======================================== */
.card {
    background-color: #ffffff;
    border: 1px solid #d0d0d0;
    margin-bottom: 16px;
}

.card-header {
    padding: 12px 16px;
    background-color: #f5f5f5;
    border-bottom: 1px solid #d0d0d0;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #5a5a5a;
}

.card-body {
    padding: 16px;
}

.card.clickable {
    cursor: pointer;
    transition: box-shadow 0.2s;
}

.card.clickable:active {
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ========================================
   FORMS
   ======================================== */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #5a5a5a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input,
.form-select {
    width: 100%;
    height: 60px;
    padding: 0 16px;
    font-size: 18px;
    border: 2px solid #d0d0d0;
    background-color: #ffffff;
    color: #2c3e50;
    border-radius: 4px;
    transition: border-color 0.2s;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: #34495e;
}

.form-input.error {
    border-color: #c0392b;
}

.form-input[type="number"] {
    font-size: 24px;
    font-weight: 600;
    text-align: center;
}

/* Barcode input styling */
.barcode-input {
    font-family: 'Courier New', monospace;
    font-size: 20px;
    text-align: center;
    letter-spacing: 2px;
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
    display: block;
    width: 100%;
    height: 60px;
    padding: 0 20px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 60px;
}

.btn-primary {
    background-color: #34495e;
    color: #ffffff;
}

.btn-primary:active {
    background-color: #2c3e50;
    transform: translateY(1px);
}

.btn-success {
    background-color: #27ae60;
    color: #ffffff;
}

.btn-success:active {
    background-color: #229954;
    transform: translateY(1px);
}

.btn-secondary {
    background-color: #95a5a6;
    color: #ffffff;
}

.btn-secondary:active {
    background-color: #7f8c8d;
    transform: translateY(1px);
}

.btn-danger {
    background-color: #c0392b;
    color: #ffffff;
}

.btn-danger:active {
    background-color: #a93226;
    transform: translateY(1px);
}

.btn-outline {
    background-color: #ffffff;
    color: #34495e;
    border: 2px solid #34495e;
}

.btn-outline:active {
    background-color: #f5f5f5;
}

.btn + .btn {
    margin-top: 12px;
}

.btn-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.btn-group .btn {
    margin: 0;
}

/* ========================================
   LISTS
   ======================================== */
.list-item {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    padding: 16px;
    background-color: #ffffff;
    border-bottom: 1px solid #e0e0e0;
}

.list-item:last-child {
    border-bottom: none;
}

.list-item.clickable {
    cursor: pointer;
    transition: background-color 0.2s;
}

.list-item.clickable:active {
    background-color: #f5f5f5;
}

.list-title {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 4px;
}

.list-subtitle {
    font-size: 14px;
    color: #7f8c8d;
}

.list-badge {
    padding: 6px 12px;
    background-color: #f5f5f5;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.list-badge.success {
    background-color: #d5f4e6;
    color: #27ae60;
}

.list-badge.warning {
    background-color: #fff3cd;
    color: #856404;
}

.list-badge.info {
    background-color: #d6eaf8;
    color: #2874a6;
}

/* ========================================
   PROGRESS BAR
   ======================================== */
.progress-container {
    margin: 16px 0;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
    color: #5a5a5a;
}

.progress-bar {
    height: 12px;
    background-color: #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: #34495e;
    transition: width 0.3s ease;
}

.progress-fill.complete {
    background-color: #27ae60;
}

/* ========================================
   STATUS BADGES
   ======================================== */
.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.in-progress {
    background-color: #fff3cd;
    color: #856404;
}

.status-badge.completed {
    background-color: #d5f4e6;
    color: #27ae60;
}

.status-badge.error {
    background-color: #f8d7da;
    color: #c0392b;
}

.status-badge.pending {
    background-color: #e8e8e8;
    color: #5a5a5a;
}

/* ========================================
   EMPTY STATE
   ======================================== */
.empty-state {
    padding: 60px 20px;
    text-align: center;
    color: #95a5a6;
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state-text {
    font-size: 16px;
}

/* ========================================
   TOAST NOTIFICATIONS
   ======================================== */
.error-toast,
.success-toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    max-width: 90%;
    padding: 16px 24px;
    border-radius: 4px;
    font-weight: 600;
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s ease;
}

.error-toast.show,
.success-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.error-toast {
    background-color: #c0392b;
    color: #ffffff;
}

.success-toast {
    background-color: #27ae60;
    color: #ffffff;
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-muted {
    color: #7f8c8d;
}

.text-bold {
    font-weight: 600;
}

.mb-8 {
    margin-bottom: 8px;
}

.mb-16 {
    margin-bottom: 16px;
}

.mb-24 {
    margin-bottom: 24px;
}

.mt-16 {
    margin-top: 16px;
}

.hidden {
    display: none;
}

/* ========================================
   LOADING SPINNER
   ======================================== */
.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #e8e8e8;
    border-top-color: #34495e;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

/* ── Notification Bell ─────────────────────────────────────── */
.notification-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-right: 0;
    color: inherit;
    text-decoration: none;
    opacity: 0.85;
}

.notification-btn:hover {
    opacity: 1;
}

.notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: #ef4444;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    pointer-events: none;
}