/**
 * PCK_HT001 ピッキングリスト選択画面 スタイルシート
 * HT（ハンディターミナル）向けモバイルファースト設計
 */

/* ===========================
   リセットとベーススタイル
   =========================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #333;
    background-color: #f5f5f5;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

/* ===========================
   コンテナ
   =========================== */
.ht-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    background-color: #fff;
}

/* ===========================
   ヘッダー
   =========================== */
.ht-header {
    flex-shrink: 0;
    padding: 12px 16px;
    background-color: #006f5e;
    color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ht-title {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 4px;
}

.ht-user-info {
    font-size: 12px;
    opacity: 0.9;
    display: flex;
    gap: 12px;
}

.user-name::before {
    content: "▸ ";
}

.warehouse-name::before {
    content: "■ ";
}

/* ===========================
   メインコンテンツ
   =========================== */
.ht-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    gap: 16px;
}

/* ===========================
   プロンプトエリア
   =========================== */
.prompt-area {
    flex-shrink: 0;
}

.prompt-label {
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

/* ===========================
   リストコンテナ
   =========================== */
.list-container {
    display: flex;
    flex-direction: column;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #fff;
    min-height: 150px;
}

.list-header {
    display: grid;
    grid-template-columns: 2fr 1.5fr 1fr 1.5fr;
    gap: 8px;
    padding: 12px;
    background-color: #f0f0f0;
    border-bottom: 2px solid #ddd;
    font-weight: bold;
    font-size: 14px;
    color: #555;
}

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

.list-area {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* ===========================
   リストアイテム
   =========================== */
.list-item {
    display: grid;
    grid-template-columns: 2fr 1.5fr 1fr 1.5fr;
    gap: 8px;
    padding: 16px 12px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s;
    min-height: 56px;
    align-items: center;
}

.list-item:hover {
    background-color: #f9f9f9;
}

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

.list-item.selected {
    background-color: #e3f2fd;
    border-left: 4px solid #006f5e;
}

.list-item-cell {
    text-align: center;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.list-item-cell.list-number {
    font-weight: 600;
    color: #006f5e;
    text-align: left;
}

.list-item-cell.status {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
}

.list-item-cell.status.assigned {
    background-color: #fef3c7;
    color: #92400e;
}

.list-item-cell.status.in-progress {
    background-color: #dbeafe;
    color: #1e40af;
}

.list-item-cell.status.completed {
    background-color: #dcfce7;
    color: #166534;
}

/* ===========================
   メッセージエリア
   =========================== */
.error-message,
.success-message,
.info-message {
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 16px;
}

.error-message {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.success-message {
    background-color: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.info-message {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ===========================
   ローディング表示
   =========================== */
.loading-indicator {
    text-align: center;
    padding: 32px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #006f5e;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-indicator p {
    font-size: 16px;
    color: #666;
}

/* ===========================
   フッター
   =========================== */
.ht-footer {
    flex-shrink: 0;
    display: flex;
    gap: 12px;
    padding: 16px;
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

/* ===========================
   ボタン
   =========================== */
.ht-button {
    flex: 1;
    min-height: 56px;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.ht-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ht-button-primary {
    background-color: #006f5e;
    color: #fff;
}

.ht-button-primary:hover:not(:disabled) {
    background-color: #005a4b;
}

.ht-button-primary:active:not(:disabled) {
    background-color: #004a3e;
}

.ht-button-secondary {
    background-color: #6c757d;
    color: #fff;
}

.ht-button-secondary:hover:not(:disabled) {
    background-color: #5a6268;
}

.ht-button-secondary:active:not(:disabled) {
    background-color: #545b62;
}

.ht-button-tertiary {
    background-color: #fff;
    color: #333;
    border: 1px solid #ddd;
}

.ht-button-tertiary:hover {
    background-color: #f8f9fa;
}

.ht-button-tertiary:active {
    background-color: #e9ecef;
}

/* ===========================
   空状態表示
   =========================== */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: #666;
}

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

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

/* ===========================
   レスポンシブデザイン
   =========================== */
@media (max-width: 480px) {
    .list-header,
    .list-item {
        grid-template-columns: 2fr 1fr 0.8fr 1.2fr;
        gap: 4px;
        font-size: 13px;
    }

    .list-header-item,
    .list-item-cell {
        font-size: 12px;
    }

    .prompt-label {
        font-size: 16px;
    }
}

@media (min-width: 768px) {
    .ht-main {
        padding: 24px;
    }

    .list-header,
    .list-item {
        padding: 16px;
    }
}
