/* Delhivery Tracking Page Styles */

.delhivery-tracking-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 30px 20px;
    font-family: inherit;
}

.tracking-title {
    text-align: center;
    margin-bottom: 30px;
    font-size: 28px;
    font-weight: bold;
    color: var(--wp--preset--color--heading, inherit);
}

/* Form Styling */
.tracking-form-container {
    margin-bottom: 30px;
}

.tracking-input-wrapper {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

@media (max-width: 576px) {
    .tracking-input-wrapper {
        flex-direction: column;
    }
}

.tracking-input {
    flex: 1;
    padding: 14px 16px;
    border: 2px solid var(--wp--preset--color--border, rgba(0, 0, 0, 0.1));
    border-radius: 6px;
    font-size: 16px;
    color: var(--wp--preset--color--text, inherit);
    background: var(--wp--preset--color--background, inherit);
    min-height: 50px;
}

.tracking-input:focus {
    outline: none;
    border-color: var(--wp--preset--color--primary, currentColor);
}

.tracking-btn {
    background-color: #FFD700; /* Yellow color seen in the image */
    color: #000;
    border: none;
    border-radius: 6px;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 180px;
    text-transform: uppercase;
}

.tracking-btn:hover {
    background-color: #F3CC00;
    transform: translateY(-1px);
}

/* Loader */
.tracking-loader {
    text-align: center;
    padding: 30px;
}

.loading-spinner {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #FFD700;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error Display */
.tracking-error {
    display: flex;
    align-items: flex-start;
    background-color: var(--wp--preset--color--error-bg, #FFF2F2);
    border-left: 4px solid var(--wp--preset--color--error, #DC3232);
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 30px;
}

.error-icon {
    margin-right: 15px;
    color: var(--wp--preset--color--error, #DC3232);
    flex-shrink: 0;
}

.error-title {
    margin-top: 0;
    margin-bottom: 8px;
    color: var(--wp--preset--color--error, #DC3232);
}

.error-message {
    margin: 0;
    color: var(--wp--preset--color--text, inherit);
}

/* Tracking Result */
.tracking-status-container {
    margin-bottom: 30px;
    text-align: center;
}

.tracking-status {
    font-size: 24px;
    font-weight: 600;
    margin-top: 10px;
}

.status-badge {
    background-color: var(--status-color, #FFD700);
    color: #000;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 18px;
    display: inline-block;
}

/* Timeline */
.tracking-timeline-container {
    margin-bottom: 50px;
    padding: 15px 10px;
    background-color: var(--wp--preset--color--background-alt, #f9f9f9);
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.tracking-timeline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 auto;
    max-width: 700px;
    padding: 10px 0;
}

.timeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
    padding: 0 5px;
    flex: 1;
}

.timeline-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #E0E0E0;
    border: 2px solid #CCCCCC;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

.timeline-icon .checkmark {
    opacity: 0;
    fill: #ffffff;
    transform: scale(0);
    transition: all 0.3s ease;
}

.timeline-step.active .timeline-icon {
    background-color: #FFD700;
    border-color: #F3CC00;
    box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.2);
}

.timeline-step.active .timeline-icon .checkmark {
    opacity: 1;
    transform: scale(1);
    fill: #000000;
}

.timeline-step.completed .timeline-icon {
    background-color: #4CAF50;
    border-color: #3E8E41;
    box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.2);
}

.timeline-step.completed .timeline-icon .checkmark {
    opacity: 1;
    transform: scale(1);
}

.timeline-label {
    font-size: 14px;
    text-align: center;
    max-width: 120px;
    font-weight: 500;
    margin-top: 5px;
    color: #666;
    transition: all 0.3s ease;
}

.timeline-step.active .timeline-label {
    color: #000;
    font-weight: 600;
}

.timeline-step.completed .timeline-label {
    color: #4CAF50;
    font-weight: 600;
}

@media (max-width: 576px) {
    .timeline-label {
        font-size: 12px;
        max-width: 80px;
    }
    
    .tracking-timeline {
        padding: 5px 0;
    }
}

.timeline-progress {
    flex-grow: 1;
    height: 4px;
    background-color: #E0E0E0;
    position: relative;
    z-index: 1;
    transition: all 0.5s ease;
}

.timeline-progress.completed {
    background-color: #4CAF50;
    box-shadow: 0 1px 2px rgba(76, 175, 80, 0.3);
}

/* Add a transition effect for the progress line */
.timeline-progress::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: transparent;
    transition: all 0.5s ease;
}

/* Order Information */
.order-info-container {
    margin-bottom: 30px;
    background-color: var(--wp--preset--color--background-alt, #f0f8ff);
    border: 1px solid var(--wp--preset--color--primary, #007cba);
    border-radius: 8px;
    padding: 20px;
}

.order-info-container h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--wp--preset--color--primary, #007cba);
    font-size: 18px;
}

.order-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.order-info-card {
    background-color: var(--wp--preset--color--background, #ffffff);
    border: 1px solid var(--wp--preset--color--border, rgba(0, 0, 0, 0.1));
    border-radius: 6px;
    padding: 15px;
}

.order-info-card h4 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--wp--preset--color--text-light, #666);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.order-info-card p {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    color: var(--wp--preset--color--text, inherit);
}

/* Order Stages */
.order-stage-container {
    margin-bottom: 30px;
    background-color: var(--wp--preset--color--background-alt, #f8f9fa);
    border: 1px solid var(--wp--preset--color--border, rgba(0, 0, 0, 0.1));
    border-radius: 8px;
    padding: 25px;
}

.order-stage-container h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--wp--preset--color--primary, #007cba);
    font-size: 20px;
}

.order-stage-timeline {
    position: relative;
    margin-bottom: 20px;
}

.stage-progress-bar {
    height: 4px;
    background-color: var(--wp--preset--color--border, #e0e0e0);
    border-radius: 2px;
    margin-bottom: 15px;
    overflow: hidden;
}

.stage-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--wp--preset--color--primary, #007cba), #00a0d2);
    border-radius: 2px;
    transition: width 0.8s ease;
    width: 0%;
}

.stage-steps {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
}

.stage-step {
    flex: 1;
    min-width: 100px;
    text-align: center;
    transition: all 0.3s ease;
}

.stage-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--wp--preset--color--background, #ffffff);
    border: 2px solid var(--wp--preset--color--border, #e0e0e0);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    position: relative;
    transition: all 0.3s ease;
}

.stage-step.active .stage-circle {
    background-color: var(--wp--preset--color--primary, #007cba);
    border-color: var(--wp--preset--color--primary, #007cba);
    color: white;
}

.stage-step.current .stage-circle {
    animation: pulse 2s infinite;
    box-shadow: 0 0 0 4px rgba(0, 123, 186, 0.2);
}

.stage-number {
    font-size: 14px;
    font-weight: bold;
    line-height: 1;
}

.stage-step.active .stage-number {
    display: none;
}

.stage-check {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.stage-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--wp--preset--color--text, inherit);
    margin-bottom: 4px;
}

.stage-step.active .stage-label {
    color: var(--wp--preset--color--primary, #007cba);
    font-weight: 600;
}

.stage-time {
    font-size: 12px;
    color: var(--wp--preset--color--text-light, #666);
}

.current-stage-info {
    background-color: var(--wp--preset--color--background, #ffffff);
    border: 1px solid var(--wp--preset--color--primary, #007cba);
    border-radius: 6px;
    padding: 15px;
    text-align: center;
}

.current-stage-info p {
    margin: 0 0 8px 0;
    font-size: 16px;
}

.current-stage-info p:last-child {
    margin-bottom: 0;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 123, 186, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(0, 123, 186, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 123, 186, 0);
    }
}

@media (max-width: 576px) {
    .stage-steps {
        flex-direction: column;
        align-items: center;
    }
    
    .stage-step {
        min-width: auto;
        width: 200px;
    }
    
    .order-stage-container {
        padding: 20px 15px;
    }
}

/* Details Grid */
.tracking-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.tracking-detail-card {
    background-color: var(--wp--preset--color--background-alt, #f9f9f9);
    border: 1px solid var(--wp--preset--color--border, rgba(0, 0, 0, 0.1));
    border-radius: 8px;
    padding: 20px;
}

.tracking-detail-card h4 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 16px;
    color: var(--wp--preset--color--text-light, rgba(0, 0, 0, 0.6));
}

.tracking-detail-card p {
    margin: 0;
    font-size: 16px;
    color: var(--wp--preset--color--heading, #000);
    font-weight: 500;
}

/* History Table */
.tracking-history-container {
    margin-bottom: 30px;
}

.tracking-history-container h3 {
    margin-bottom: 20px;
}

.tracking-history-table {
    width: 100%;
    border-collapse: collapse;
}

.tracking-history-table th,
.tracking-history-table td {
    border: 1px solid var(--wp--preset--color--border, #ddd);
    padding: 12px;
    text-align: left;
}

.tracking-history-table th {
    background-color: var(--wp--preset--color--background-alt, #f9f9f9);
    font-weight: 600;
}

.tracking-history-table tr:nth-child(even) {
    background-color: var(--wp--preset--color--background-alt, #f9f9f9);
}

/* Spinner */
.btn-spinner {
    display: none;
}

.tracking-btn:disabled .btn-spinner {
    display: inline-block;
}

.tracking-btn:disabled .btn-text {
    display: none;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    border-top-color: #000;
    animation: spin 1s linear infinite;
}

/* Shipping Method Display */
.shipping-method-info small {
    color: #666;
    font-size: 0.9em;
    font-weight: normal;
}

.shipping-method-info {
    line-height: 1.4;
}
