/* PDA专用样式 - 使用Bootstrap原生样式 */

/* 确保body和html没有边距和内边距 */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* 确保app容器占满整个屏幕 */
#app {
    width: 100vw;
    height: 100vh;
}

/* PDA页面特殊样式 - 完全铺满屏幕 */
body.pda-page #app {
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

body.pda-page {
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* 基础容器样式 - 使用Bootstrap原生类 */
.pda-container {
    padding: 8px;
    background-color: var(--bs-light);
    font-size: 14px;
    overflow: hidden;
}

/* 顶部标题栏 - 使用Bootstrap flex utilities */
.pda-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
    padding: 3px 0;
    border-bottom: 1px solid var(--bs-border-color);
}

.pda-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--bs-dark);
    flex-grow: 1;
    text-align: center;
}

/* 返回按钮使用Bootstrap btn-sm类 */
.pda-back-btn {
    font-size: 10px;
    padding: 1px 4px;
    white-space: nowrap;
    min-height: auto;
    line-height: 1.2;
}

/* 扫码输入区域 - 使用Bootstrap form-control */
.pda-scan-section {
    margin-bottom: 8px;
}

.pda-scan-input {
    font-size: 16px; /* 防止iOS缩放 */
}

/* 信息显示区域 - 使用Bootstrap alert和text-monospace */
.pda-info-section {
    margin-bottom: 8px;
}

.pda-scanned-code {
    font-family: var(--bs-font-monospace);
    font-size: 11px;
    word-break: break-all;
    line-height: 1.2;
    margin: 0;
    padding: 2px 4px;
}

/* 标签列表 - 使用Bootstrap list-group */
.pda-label-list {
    max-height: 150px;
    overflow-y: auto;
}

.pda-label-item {
    padding: 6px 8px;
    border-bottom: 1px solid var(--bs-border-color);
}

.pda-label-item:last-child {
    border-bottom: none;
}

.pda-label-item .pda-scanned-code {
    background-color: transparent;
    border: none;
    padding: 0;
    flex-grow: 1;
    margin-right: 10px;
}

/* 操作按钮区域 - 使用Bootstrap按钮类 */
.pda-action-section {
    margin-top: 10px;
}

/* 菜单列表样式 - 使用Bootstrap list-group */
.pda-menu-list .list-group-item {
    padding: 8px 10px;
    margin-bottom: 6px;
    border-radius: var(--bs-border-radius);
    border: 1px solid var(--bs-border-color);
    background-color: var(--bs-white);
    transition: all 0.2s ease;
}

/* PDA信息列表样式 - 更紧凑的布局 */
.pda-info-section .list-group-item {
    padding: 6px 8px;
    margin-bottom: 4px;
    border-radius: var(--bs-border-radius);
    border: 1px solid var(--bs-border-color);
    background-color: var(--bs-white);
    transition: all 0.2s ease;
}

.pda-info-section .list-group-item:hover {
    background-color: var(--bs-light);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.pda-info-section .list-group-item small {
    font-size: 10px;
    margin-bottom: 2px;
}

.pda-menu-list .list-group-item:hover {
    background-color: var(--bs-light);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.pda-menu-icon {
    font-size: 20px;
    color: var(--bs-primary);
}

/* 订单信息样式 - 使用Bootstrap badge和text-monospace */
.pda-info-value {
    font-family: var(--bs-font-monospace);
    background-color: var(--bs-light);
    padding: 2px 6px;
    border-radius: var(--bs-border-radius-sm);
    font-size: 11px;
    word-break: break-all;
    margin-top: 1px;
}

/* Modal样式 - 使用Bootstrap modal类 */
.pda-container .modal-dialog {
    margin: 5px;
    max-width: calc(100vw - 10px);
}

.pda-container .modal-body {
    padding: 10px;
}

.pda-container .modal-footer {
    padding: 8px 10px;
}

/* 徽章样式 - 使用Bootstrap badge */
.pda-container .badge {
    font-size: 11px;
}

/* 状态指示器 - 使用Bootstrap颜色变量 */
.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 5px;
}

.status-indicator.success {
    background-color: var(--bs-success);
}

.status-indicator.warning {
    background-color: var(--bs-warning);
}

.status-indicator.primary {
    background-color: var(--bs-primary);
}

/* 加载状态 - 使用Bootstrap spinner */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* 响应式调整 - 使用Bootstrap响应式断点 */
@media (max-width: 320px) {
    .pda-container {
        padding: 5px;
    }
    
    .pda-title {
        font-size: 15px;
    }
    
    .pda-menu-icon {
        font-size: 18px;
    }
    
    .pda-scanned-code {
        font-size: 11px;
    }
}

/* 针对PDA设备的特殊样式 */
@media (max-width: 480px) and (max-height: 640px) {
    .pda-container {
        padding: 5px;
        font-size: 13px;
    }
    
    .pda-header {
        margin-bottom: 0;
        padding: 5px 0;
    }
    
    .pda-title {
        font-size: 14px;
    }
    
    .pda-scan-section {
        margin-bottom: 6px;
    }
    
    .pda-info-section {
        margin-bottom: 6px;
    }
    
    .pda-action-section {
        margin-top: 8px;
    }
    
    .pda-menu-list .list-group-item {
        padding: 6px 8px;
        margin-bottom: 4px;
    }
    
    .pda-info-section .list-group-item {
        padding: 4px 6px;
        margin-bottom: 3px;
    }
    
    .pda-info-section .list-group-item small {
        font-size: 9px;
        margin-bottom: 1px;
    }
    
    .pda-menu-icon {
        font-size: 18px;
    }
    
    .pda-scanned-code {
        font-size: 11px;
        padding: 6px;
    }
}

/* 滚动条样式 */
.pda-label-list::-webkit-scrollbar {
    width: 4px;
}

.pda-label-list::-webkit-scrollbar-track {
    background: var(--bs-gray-200);
}

.pda-label-list::-webkit-scrollbar-thumb {
    background: var(--bs-gray-400);
    border-radius: 2px;
}

.pda-label-list::-webkit-scrollbar-thumb:hover {
    background: var(--bs-gray-500);
}

/* 进度显示相关样式 */
.pda-progress-section {
    margin-bottom: 15px;
}

.pda-progress-bar {
    height: 20px;
    background-color: var(--bs-light);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.pda-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--bs-primary), var(--bs-success));
    transition: width 0.3s ease;
    border-radius: 10px;
}

.pda-progress-text {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--bs-dark);
    margin-bottom: 8px;
}

.pda-stats-container {
    display: flex;
    justify-content: space-around;
    margin-bottom: 10px;
}

.pda-stat-item {
    text-align: center;
    padding: 8px;
    border-radius: 8px;
    background-color: var(--bs-white);
    border: 1px solid var(--bs-border-color);
    min-width: 80px;
}

.pda-stat-number {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: var(--bs-primary);
    margin-bottom: 2px;
}

.pda-stat-label {
    display: block;
    font-size: 11px;
    color: var(--bs-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 托盘信息显示样式 */
.pda-pallet-info {
    background-color: var(--bs-light);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 15px;
}

.pda-pallet-info h6 {
    font-size: 14px;
    font-weight: 600;
    color: var(--bs-dark);
    margin-bottom: 8px;
}

.pda-pallet-detail {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 12px;
}

.pda-pallet-detail-label {
    font-weight: 600;
    color: var(--bs-secondary);
}

.pda-pallet-detail-value {
    font-family: var(--bs-font-monospace);
    color: var(--bs-dark);
}

/* 单件标签列表增强样式 */
.pda-single-labels {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--bs-border-color);
    border-radius: 8px;
    background-color: var(--bs-white);
}

.pda-single-label-item {
    padding: 8px 12px;
    border-bottom: 1px solid var(--bs-border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pda-single-label-item:last-child {
    border-bottom: none;
}

.pda-single-label-code {
    font-family: var(--bs-font-monospace);
    font-size: 12px;
    color: var(--bs-dark);
    flex-grow: 1;
    word-break: break-all;
}

.pda-single-label-remove {
    margin-left: 10px;
}

/* 状态指示器增强 */
.pda-status-indicator {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pda-status-indicator.success {
    background-color: var(--bs-success);
    color: white;
}

.pda-status-indicator.warning {
    background-color: var(--bs-warning);
    color: var(--bs-dark);
}

.pda-status-indicator.danger {
    background-color: var(--bs-danger);
    color: white;
}

.pda-status-indicator.info {
    background-color: var(--bs-info);
    color: white;
}

/* 动画效果 */
.pda-pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(var(--bs-primary-rgb), 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(var(--bs-primary-rgb), 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(var(--bs-primary-rgb), 0);
    }
}

/* 成功状态动画 */
.pda-success-flash {
    animation: successFlash 0.5s ease-in-out;
}

@keyframes successFlash {
    0% {
        background-color: var(--bs-white);
    }
    50% {
        background-color: var(--bs-success);
    }
    100% {
        background-color: var(--bs-white);
    }
}

/* 错误状态动画 */
.pda-error-shake {
    animation: errorShake 0.5s ease-in-out;
}

@keyframes errorShake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}