/**
 * HCT Frontend Styles
 * 前端追蹤功能樣式
 */

/* My Account 訂單列表中的追蹤按鈕 */
.woocommerce-orders-table .hct-track-button {
    background: #007cba;
    color: white !important;
    padding: 6px 12px;
    border-radius: 3px;
    text-decoration: none;
    font-size: 12px;
    display: inline-block;
    margin: 2px;
    transition: background-color 0.3s ease;
}

.woocommerce-orders-table .hct-track-button:hover {
    background: #005a87;
    color: white !important;
}

/* HCT 訂單資訊區塊 */
.hct-order-info {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
}

.hct-order-info h3 {
    margin-top: 0;
    color: #333;
    border-bottom: 2px solid #007cba;
    padding-bottom: 10px;
    font-size: 20px;
}

/* 追蹤按鈕樣式 */
.hct-track-shipment-btn {
    background: #007cba;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    margin-right: 10px;
    transition: background-color 0.3s ease;
}

.hct-track-shipment-btn:hover {
    background: #005a87;
}

.hct-track-shipment-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.hct-open-official-track {
    background: #6c757d;
    color: white;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 16px;
    display: inline-block;
    transition: background-color 0.3s ease;
}

.hct-open-official-track:hover {
    background: #5a6268;
    color: white;
    text-decoration: none;
}

/* 追蹤結果樣式 */
.hct-tracking-results {
    margin-top: 20px;
    padding: 20px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hct-tracking-results h4 {
    margin-top: 0;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.hct-tracking-results .latest-status {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.hct-tracking-results .tracking-timeline {
    border-left: 3px solid #007cba;
    padding-left: 20px;
    margin-left: 10px;
}

.hct-tracking-results .tracking-record {
    position: relative;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.hct-tracking-results .tracking-record:last-child {
    border-bottom: none;
}

.hct-tracking-results .tracking-record::before {
    content: "";
    position: absolute;
    left: -26px;
    top: 5px;
    width: 12px;
    height: 12px;
    background: #007cba;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 0 2px #007cba;
}

.hct-tracking-results .record-status {
    font-weight: bold;
    color: #333;
    font-size: 16px;
    margin-bottom: 5px;
}

.hct-tracking-results .record-time {
    color: #666;
    font-size: 14px;
    margin-bottom: 5px;
}

.hct-tracking-results .no-tracking-data {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 4px;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .hct-order-info {
        padding: 15px;
        margin-top: 20px;
    }

    .hct-tracking-actions {
        text-align: left !important;
    }

    .hct-track-shipment-btn,
    .hct-open-official-track {
        display: block;
        width: 100%;
        margin: 10px 0;
        text-align: center;
        box-sizing: border-box;
    }

    .hct-tracking-results {
        padding: 15px;
    }

    .hct-tracking-results .tracking-timeline {
        padding-left: 15px;
        margin-left: 5px;
    }
}

/* 載入動畫 */
.hct-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: hct-spin 1s linear infinite;
    margin-right: 8px;
}

@keyframes hct-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* 淡入動畫 */
.hct-fade-in {
    animation: hct-fadeIn 0.5s ease-in;
}

@keyframes hct-fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 成功/錯誤訊息樣式 */
.hct-message {
    padding: 12px 16px;
    border-radius: 4px;
    margin: 10px 0;
}

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

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

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