/* Custom Tracking Frontend Styles (Cleaned + 7-Stage Flow) */

.ct-tracking-container{
    max-width: 800px;
    margin: 0 auto;
    padding: 30px 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
}

.ct-tracking-form-wrapper{
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin-bottom: 30px;
}

.ct-tracking-title{
    margin: 0 0 15px 0;
    color: #333;
    font-size: 28px;
    text-align: center;
}

.ct-tracking-description{
    color: #666;
    margin: 0 0 25px 0;
    font-size: 16px;
    line-height: 1.6;
    text-align: center;
}

.ct-tracking-form{
    max-width: 800px;
    margin: 0 auto;
}

.ct-form-row{
    display: flex;
    justify-content:center;
    gap: 15px;
    align-items: center;
}

.ct-form-group{
    margin-bottom: 0;
    width: 100%;
}

.ct-form-group label{
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.ct-form-input,
.ct-form-select{
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.ct-form-input:focus,
.ct-form-select:focus{
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0,124,186,0.1);
}

.ct-submit-button{
    background: #007cba;
    color: #fff;
    border: none;
    padding: 14px 30px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    float: right;
}

.ct-submit-button:hover{
    background: #005a87;
}

.ct-submit-button:disabled{
    background: #ccc;
    cursor: not-allowed;
}

/* Results wrapper */
.ct-tracking-results{
    margin-top: 40px;
}

/* --- Results Cards --- */

.ct-results-section{
    margin-top: 10px;
}

.ct-summary-card{
    background: #fff;
    border-radius: 10px;
    border: 1px solid #eaeaea;
    padding: 25px;
    margin-bottom: 25px;
}

.ct-summary-header{
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 25px;
}

.ct-tracking-number{
    margin: 0 0 10px 0;
    font-size: 24px;
    color: #333;
}

.ct-courier-badge{
    background: #e1f5fe;
    color: #0277bd;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    display: inline-block;
    margin-right: 12px;
}

.ct-external-link{
    color: #007cba;
    text-decoration: none;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.ct-external-link:hover{
    text-decoration: underline;
}

/* Status badge */
.ct-status-badge{
    display: inline-block;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.ct-status-subtext{
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.4;
    color: #666;
    opacity: 0.95;
}

.ct-last-updated{
    font-size: 13px;
    color: #888;
    margin-top: 10px;
}

/* --- New 7-stage status styles --- */
.ct-status-badge.ct-status-order-processing, 
.ct-status-badge.ct-status-in-transit-export, 
.ct-status-badge.ct-status-customs-processing-export, 
.ct-status-badge.ct-status-customs-processing-import, 
.ct-status-badge.ct-status-in-transit-local,
.ct-status-badge.ct-status-out-for-delivery,
.ct-status-badge.ct-status-delivered{ 
    /* If your theme already styles .ct-status-badge, you can remove these */ 
    background: #e8f5e8; 
    color: #2e7d32; 
} 

.ct-status-badge.ct-status-exception-contact-support{ 
    /* leave your existing warning/orange styles if already present */ 
    background: #fff3e0; 
    color: #ef6c00; 
}



/* --- Progress Bar --- */
.ct-progress-container{
    margin-top: 30px;
}

.ct-progress-bar{
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.ct-progress-fill{
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.ct-progress-labels{
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

/* 7-stage labels wrapping */
.ct-progress-labels.ct-progress-7{
    flex-wrap: wrap;
    gap: 6px;
}

/* --- Latest Update Card --- */
.ct-latest-update-card{
    background: #fff;
    border-radius: 10px;
    border: 1px solid #eaeaea;
    padding: 25px;
    margin-bottom: 25px;
}

.ct-latest-update-card h3{
    margin: 0 0 20px 0;
    color: #333;
    font-size: 20px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

.ct-event-card{
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    border-left: 4px solid #007cba;
}

.ct-event-date,
.ct-event-status,
.ct-event-location{
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 15px;
    line-height: 1.5;
}

.ct-event-date strong,
.ct-event-status strong,
.ct-event-location strong{
    color: #333;
    min-width: 70px;
    font-weight: 600;
}

/* --- No Results --- */
.ct-no-results{
    padding: 60px 30px;
    text-align: center;
}

.ct-error-message{
    max-width: 500px;
    margin: 0 auto;
}

.ct-error-message .dashicons{
    font-size: 48px;
    color: #ff9800;
    margin-bottom: 20px;
}

.ct-error-message h3{
    margin: 0 0 15px 0;
    color: #333;
}

.ct-error-message p{
    color: #666;
    line-height: 1.6;
}

/* --- Loading --- */
.ct-loading{
    text-align: center;
    padding: 60px 20px;
}

/* Keep BOTH class names in case JS uses either */
.ct-spinner,
.ct-loading-spinner{
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    animation: ct-spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes ct-spin{
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Misc table spacing (keep: used in some order/detail tables) */
.tracking_details{
    padding: 16px 30px 3px 30px;
}

.tracking_details tr:first-child th,
.tracking_details tr:first-child td{
    border-top: 0 !important;
}

/* --- Responsive --- */
@media (max-width: 768px){
    .ct-form-row{
        grid-template-columns: 1fr;
    }

    .ct-summary-header{
        flex-direction: column;
        align-items: flex-start;
    }

    .ct-progress-labels{
        font-size: 11px;
    }
}

body:has(.ct-status-badge.ct-status-exception-contact-support) 
.ct-latest-update-card {
    display: none !important;
}

