/**
 * 前端樣式
 */

/* 追蹤查詢表單 */
.insig-hct-tracking-form {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px;
    margin: 20px 0;
}

.insig-hct-tracking-form h3 {
    margin-top: 0;
    color: #333;
}

.insig-hct-form-group {
    margin-bottom: 15px;
}

.insig-hct-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.insig-hct-form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

.insig-hct-form-group input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 5px rgba(0, 124, 186, 0.3);
}

.insig-hct-submit-btn {
    background: #007cba;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
}

.insig-hct-submit-btn:hover {
    background: #005a87;
}

.insig-hct-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* 追蹤結果 */
.insig-hct-tracking-result {
    margin-top: 20px;
    padding: 20px;
    border-radius: 4px;
}

.insig-hct-tracking-result.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.insig-hct-tracking-result.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.insig-hct-tracking-result h4 {
    margin-top: 0;
}

/* 狀態時間軸 */
.insig-hct-timeline {
    margin-top: 20px;
}

.insig-hct-timeline-item {
    position: relative;
    padding-left: 30px;
    margin-bottom: 20px;
}

.insig-hct-timeline-item::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 5px;
    width: 10px;
    height: 10px;
    background: #007cba;
    border-radius: 50%;
}

.insig-hct-timeline-item::after {
    content: '';
    position: absolute;
    left: 14px;
    top: 15px;
    width: 2px;
    height: calc(100% + 5px);
    background: #ddd;
}

.insig-hct-timeline-item:last-child::after {
    display: none;
}

.insig-hct-timeline-item.current::before {
    background: #28a745;
}

.insig-hct-timeline-item.completed::before {
    background: #6c757d;
}

.insig-hct-timeline-date {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.insig-hct-timeline-status {
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.insig-hct-timeline-description {
    color: #666;
    font-size: 14px;
}

/* 載入動畫 */
.insig-hct-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 124, 186, 0.3);
    border-radius: 50%;
    border-top-color: #007cba;
    animation: insig-hct-spin 1s ease-in-out infinite;
    margin-right: 10px;
}

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

/* 響應式設計 */
@media (max-width: 768px) {
    .insig-hct-tracking-form {
        padding: 15px;
        margin: 10px 0;
    }
    
    .insig-hct-form-group input {
        font-size: 16px; /* 防止 iOS 縮放 */
    }
    
    .insig-hct-timeline-item {
        padding-left: 25px;
    }
}

/* 工具提示 */
.insig-hct-tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

.insig-hct-tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 4px;
    padding: 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
}

.insig-hct-tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* 狀態標籤 */
.insig-hct-status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    color: white;
}

.insig-hct-status-badge.pending {
    background-color: #ffc107;
    color: #333;
}

.insig-hct-status-badge.processing {
    background-color: #007bff;
}

.insig-hct-status-badge.shipped {
    background-color: #17a2b8;
}

.insig-hct-status-badge.delivered {
    background-color: #28a745;
}

.insig-hct-status-badge.failed {
    background-color: #dc3545;
}

.insig-hct-status-badge.cancelled {
    background-color: #6c757d;
}