/* 預訂單查詢表單樣式 */
.pre-order-query-form {
    max-width: 500px;
    margin: 0 auto;
    padding: 30px;
    background: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.pre-order-query-form h3 {
    text-align: center;
    margin-bottom: 25px;
    color: #333;
    font-size: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    border-color: #007cba;
    outline: none;
}

#check_order_status {
    width: 100%;
    padding: 15px;
    background: #007cba;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

#check_order_status:hover {
    background: #005a87;
}

#check_order_status:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* 訂單狀態結果樣式 */
.order-status-card {
    background: white;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-left: 5px solid #007cba;
}

.status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.order-number {
    font-size: 18px;
    color: #666;
}

.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
}

.status-pending { background: #fff3cd; color: #856404; }
.status-ordered { background: #cce7ff; color: #004085; }
.status-shipped { background: #d1ecf1; color: #0c5460; }
.status-arrived { background: #d4edda; color: #155724; }
.status-ready { background: #d1e7dd; color: #0f5132; }
.status-completed { background: #d4edda; color: #155724; }
.status-cancelled { background: #f8d7da; color: #721c24; }

.status-description {
    font-size: 16px;
    color: #333;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
}

.order-details {
    margin-bottom: 20px;
}

.detail-row {
    display: flex;
    margin-bottom: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.detail-label {
    flex: 0 0 120px;
    font-weight: bold;
    color: #666;
}

.detail-value {
    flex: 1;
    color: #333;
}

/* 追蹤記錄樣式 */
.tracking-history {
    margin: 25px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.tracking-history h4 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    font-size: 16px;
    border-bottom: 2px solid #007cba;
    padding-bottom: 10px;
}

.tracking-timeline {
    position: relative;
    padding-left: 30px;
}

.tracking-timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #007cba;
}

.tracking-item {
    position: relative;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px dashed #dee2e6;
}

.tracking-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.tracking-item::before {
    content: '';
    position: absolute;
    left: -25px;
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #007cba;
    border: 2px solid white;
    box-shadow: 0 0 0 2px #007cba;
}

.tracking-date {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
    font-weight: bold;
}

.tracking-status {
    font-weight: 500;
    color: #333;
    margin-bottom: 3px;
}

.tracking-location {
    font-size: 11px;
    color: #007cba;
    margin-bottom: 3px;
}

.tracking-notes {
    font-size: 11px;
    color: #666;
    font-style: italic;
    line-height: 1.4;
}

.last-updated {
    text-align: center;
    color: #888;
    font-size: 14px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

/* 錯誤消息樣式 */
.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 4px;
    margin-top: 15px;
    text-align: center;
}

/* 加載動畫 */
.loading-spinner {
    text-align: center;
    padding: 20px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 2s linear infinite;
    margin: 0 auto;
}

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

/* 二維碼顯示樣式 */
.pre-order-qr-code {
    text-align: center;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: inline-block;
}

/* 庫存狀態 */
.in-stock {
    color: #28a745;
    font-weight: bold;
}

.out-of-stock {
    color: #dc3545;
    font-weight: bold;
}

/* 管理頁面篩選器 */
#order_status_filter,
#staff_filter,
#date_from,
#date_to,
#created_from,
#created_to {
    margin-right: 10px;
    margin-bottom: 10px;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .pre-order-query-form {
        margin: 20px;
        padding: 20px;
    }

    .status-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .order-number {
        margin-bottom: 10px;
    }

    .detail-row {
        flex-direction: column;
    }

    .detail-label {
        margin-bottom: 5px;
    }

    .tracking-timeline {
        padding-left: 20px;
    }

    .tracking-item::before {
        left: -15px;
    }

    #order_status_filter,
    #staff_filter,
    #date_from,
    #date_to,
    #created_from,
    #created_to {
        width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
    }
}