/* ==========================================================================
   0. CSS Variables
   ========================================================================== */
:root {
    --lebasino-primary-color: #C83B3B;
    --lebasino-secondary-color: #3878D7;
    --lebasino-success-color: #09AE87;
    --lebasino-text-primary: #242B3D;
    --lebasino-text-secondary: rgba(36, 43, 61, 0.5);
    --lebasino-border-color: rgba(36, 43, 61, 0.2);
    --lebasino-shadow: 0 8px 32px 0 rgba(36, 43, 61, 0.10);
    --lebasino-border-radius: 24px;
    --lebasino-mobile-breakpoint: 767px;
}

/* ==========================================================================
   1. Main Layout & Structure
   ========================================================================== */
.lebasino-order-tracking-widget-wrapper {
    direction: rtl;
    display: flex;
    gap: 30px;
    align-items: flex-start;
}
.lebasino-tracking-form-column {
    flex: 0 0 25%;
}
.lebasino-tracking-result-column {
    flex: 1 1 auto;
    min-width: 0;
}

/* ==========================================================================
   2. Form Styles
   ========================================================================== */
.tracking-form-container {
    padding: 30px;
    border-radius: 24px;
    background: #FFF;
    box-shadow: 0 8px 32px 0 rgba(36, 43, 61, 0.10);
}
.tracking-form-container h2 {
    color: #242B3D;
    font-size: 24px;
    font-weight: 700;
}
.tracking-form-container p {
    font-size: 14px;
    color: rgba(36, 43, 61, 0.5);
    margin-bottom: 15px;
}
.form-group {
    margin-bottom: 15px;
}
.form-group label{
    color: rgba(36, 43, 61, 0.50);
font-size: 11px;
font-style: normal;
font-weight: 500;
line-height: normal;
}
.form-group input {
    width: 100%;
    color: #242B3D;
font-size: 16px;
font-weight: 700;
    padding: 10px 5px;
    border: none;
    border-bottom: 1px solid rgba(36, 43, 61, 0.2);
    border-radius: 0;
    font-size: 14px;
    transition: border-color 0.3s;
}
.form-group input:focus {
    outline: none;
    border-color: #C83B3B;
}
.submit-group {
    display: flex;
    align-items: center;
    flex-direction:row-reverse;
    margin-bottom:0 !important;
}
.lebasino-submit-btn {
    background-color: #C83B3B;
    color: #fff;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
    gap: 10px;
    display: flex;
    align-items: center;
}
.lebasino-submit-btn:hover {
    background-color: #a73030;
}
.lebasino-loading-indicator {
    display: flex;
    align-items: center;
    margin-left: 15px;
    color: #555;
    gap:8px;
    
}
.lebasino-loading-indicator span {
  color:rgba(200, 59, 59, 1);
  font-size: 14px;
font-style: normal;
font-weight: 500;
}

.lebasino-tracking-message.error {
    margin-top: 15px;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #f5c6cb;
    background-color: #f8d7da;
    color: #721c24;
    font-size: 14px;
}

/* ==========================================================================
   3. Result Card Styles
   ========================================================================== */
.result-placeholder,
.lebasino-tracking-result-card {
    padding: 25px;
    border-radius: 24px;
    background-color: #fff;
    box-shadow: 0 8px 32px 0 rgba(36, 43, 61, 0.10);
}
.result-placeholder {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 350px;
    color: #999;
    text-align: center;
}
.lebasino-tracking-result-card {
    animation: fadeIn 0.5s ease-in-out;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.lebasino-order-tracking-widget-wrapper .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(36, 43, 61, 0.2) ;
    padding-bottom: 10px;
}
.order-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid;
    background: #fff;
    font-size: 14px;
    font-weight: bold;
}
.order-status-badge .fal {
    font-size: 16px;
}

/* ==========================================================================
   4. Order Info & Tooltip
   ========================================================================== */
.order-info {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
}
.order-info-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    padding-left: 17px;
}
.order-info-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 20px;
    background: rgba(36, 43, 61, 0.20);
}
.order-info .label {
    color: rgba(36, 43, 61, 0.5);
}
.order-info .value {
    color: rgba(36, 43, 61, 0.75);
    font-weight: 500;
}
.order-info-item.shipping .value,
a.order-id-link .value {
    color: #C83B3B;
}
a.order-id-link {
    text-decoration: none;
    position: relative;
}
a.order-id-link .value {
    font-weight: bold;
    font-size: 16px;
}
.order-info [data-tooltip] {
    position: relative;
    cursor: pointer;
}
.order-info [data-tooltip]:hover::before {
    opacity: 1;
    visibility: visible;
}
.order-info [data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-5px);
    padding: 5px 10px;
    border-radius: 4px;
    background-color: #242B3D;
    color: #fff;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 10;
}

/* ==========================================================================
   5. Timeline
   ========================================================================== */
.horizontal-timeline-container {
    display: flex;
    text-align: center;
    margin: 20px 0 40px 0;
}

/* ==========================================================================
   5.1 Vertical Timeline for Mobile
   ========================================================================== */
.vertical-timeline-container {
    display: none; /* Hidden by default */
}

@media (max-width: 767px) {
    /* Hide horizontal timeline on mobile */
    .horizontal-timeline-container {
        display: none !important;
    }
    
    /* Show vertical timeline on mobile */
    .vertical-timeline-container {
        display: block !important;
        margin: 20px 0;
        padding: 0;
    }
}

.vertical-timeline-container .timeline-step {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
    position: relative;
    gap: 16px;
}

.vertical-timeline-container .timeline-step:last-child {
    margin-bottom: 0;
}

/* Vertical connecting line */
.vertical-timeline-container .timeline-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 40px;
    right: 12px;
    width: 2px;
    height: calc(100% + 12px);
    background-color: #e0e0e0;
    z-index: 1;
    border-radius: 2px;
}

.vertical-timeline-container .timeline-step.completed:not(:last-child)::after {
    background-color: #3878D7;
}

.vertical-timeline-container .timeline-step.completed.last-step:not(:last-child)::after {
    background-color: #09AE87;
}

.vertical-timeline-container .timeline-step.status-cancelled:not(:last-child)::after,
.vertical-timeline-container .timeline-step.status-failed:not(:last-child)::after {
    background-color: #dc3545;
}

.vertical-timeline-container .timeline-step.status-refunded:not(:last-child)::after {
    background-color: #6c757d;
}

/* Timeline icon circle */
.vertical-timeline-container .timeline-middle {
    order: 1;
    position: relative;
    z-index: 3;
    flex-shrink: 0;
}

.vertical-timeline-container .timeline-icon {
    position: static;
    transform: none;
    width: 24px;
    height: 24px;
    border: 2px solid #fff;
    border-radius: 50%;
    background-color: #3878D7;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.4s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Timeline content card */
.vertical-timeline-container .timeline-content {
    flex: 1;
    order: 2;
    position: relative;
}

.vertical-timeline-container .timeline-content-card {
    position: relative;
    max-width: 280px;
}

/* Polygon arrow pointing to the icon */
.vertical-timeline-container .timeline-content-card::before {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: -8px;
    width: 0;
    height: 0;
    border-left: 8px solid rgba(56, 120, 215, 0.10);
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    z-index: 2;
}

/* Main card content */
.vertical-timeline-container .timeline-content-inner {
    background: rgba(56, 120, 215, 0.10);
    border-radius: 8px;
    padding: 12px 16px;
    position: relative;
}

.vertical-timeline-container .timeline-status {
    font-size: 14px;
    font-weight: 600;
    color: #3878D7;
    margin: 0 0 6px 0;
    line-height: 1.4;
}

.vertical-timeline-container .timeline-date {
    font-size: 12px;
    color: rgba(36, 43, 61, 0.6);
    margin: 0;
    line-height: 1.3;
}

/* Different colors for different states */
.vertical-timeline-container .timeline-step.completed .timeline-content-inner {
    background: rgba(56, 120, 215, 0.10);
    border-color: rgba(56, 120, 215, 0.15);
}

.vertical-timeline-container .timeline-step.completed .timeline-content-card::before {
    border-left-color: rgba(56, 120, 215, 0.10);
}

.vertical-timeline-container .timeline-step.completed .timeline-status {
    color: #3878D7;
}

.vertical-timeline-container .timeline-step.completed.last-step .timeline-content-inner {
    background: rgba(9, 174, 135, 0.10);
    border-color: rgba(9, 174, 135, 0.15);
}

.vertical-timeline-container .timeline-step.completed.last-step .timeline-content-card::before {
    border-left-color: rgba(9, 174, 135, 0.10);
}

.vertical-timeline-container .timeline-step.completed.last-step .timeline-status {
    color: #09AE87;
}

.vertical-timeline-container .timeline-step.completed.last-step .timeline-icon {
    background-color: #09AE87;
}

/* Negative status styles */
.vertical-timeline-container .timeline-step.status-cancelled .timeline-content-inner,
.vertical-timeline-container .timeline-step.status-failed .timeline-content-inner {
    background: rgba(220, 53, 69, 0.10);
    border-color: rgba(220, 53, 69, 0.15);
}

.vertical-timeline-container .timeline-step.status-cancelled .timeline-content-card::before,
.vertical-timeline-container .timeline-step.status-failed .timeline-content-card::before {
    border-left-color: rgba(220, 53, 69, 0.10);
}

.vertical-timeline-container .timeline-step.status-cancelled .timeline-status,
.vertical-timeline-container .timeline-step.status-failed .timeline-status {
    color: #dc3545;
}

.vertical-timeline-container .timeline-step.status-cancelled .timeline-icon,
.vertical-timeline-container .timeline-step.status-failed .timeline-icon {
    background-color: #dc3545;
}

.vertical-timeline-container .timeline-step.status-refunded .timeline-content-inner {
    background: rgba(108, 117, 125, 0.10);
    border-color: rgba(108, 117, 125, 0.15);
}

.vertical-timeline-container .timeline-step.status-refunded .timeline-content-card::before {
    border-left-color: rgba(108, 117, 125, 0.10);
}

.vertical-timeline-container .timeline-step.status-refunded .timeline-status {
    color: #6c757d;
}

.vertical-timeline-container .timeline-step.status-refunded .timeline-icon {
    background-color: #6c757d;
}

/* ==========================================================================
   5.2 Horizontal Timeline (Desktop)
   ========================================================================== */
.timeline-step {
    flex: 1;
    position: relative;
    color: #999;
}
.timeline-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 47px;
    right: 0;
    transform: translateX(-50%);
    width: 100%;
    height: 4px;
    background-color: #e0e0e0;
    z-index: 1;
    transition: background-color 0.4s ease;
}
.timeline-status {
    height: 20px;
    margin-bottom: 15px;
    font-size: 14px;
    font-weight: bold;
    line-height: 20px;
}
.timeline-middle {
    height: 24px;
    margin-bottom: 10px;
    position: relative;
}
.timeline-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid #fff;
    border-radius: 50%;
    background-color: #09AE87;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.4s ease;
}
.timeline-date {
margin-top: 50px;
    color: rgba(36, 43, 61, 0.4);
    font-size: 13px;
    display: flex
;
    align-items: flex-end;
    justify-content: center;
}

/* Timeline Step States */
.timeline-step.completed .timeline-icon{
    background: #3878D7;
}
.timeline-step.completed:not(:last-child)::after {
    background-color: #3878D7;
}
.timeline-step.completed,
.timeline-step.completed .timeline-status {
    color: #3878D7;
}.timeline-step.completed.last-step,
.timeline-step.completed.last-step .timeline-status {
    color: #09AE87;
}
.timeline-step.last-step .timeline-icon {
    background-color: #09AE87;
}


/* Timeline Negative Step States */
.timeline-step.status-cancelled .timeline-icon,
.timeline-step.status-failed .timeline-icon {
    background-color: #dc3545;
}
.timeline-step.status-refunded .timeline-icon {
    background-color: #6c757d;
}
.timeline-step.status-cancelled:not(:last-child)::after,
.timeline-step.status-failed:not(:last-child)::after {
    background-color: #dc3545;
}
.timeline-step.status-refunded:not(:last-child)::after {
    background-color: #6c757d;
}
.timeline-step .timeline-icon i {
    font-size: 18px;
    line-height: 1;
    color: white;
}
.timeline-step.negative-status .timeline-icon {
    background-color: #dc3545;
}
.timeline-step.negative-status:not(.completed) .timeline-status {
color: #dc3545;
}
.timeline-step.status-completed.last-step .timeline-status {
        color: #09AE87;
}

.timeline-step.status-completed.last-step .timeline-icon {
    background: #09AE87;
}

/* ==========================================================================
   6. Delivery Details
   ========================================================================== */
.delivery-details {
    margin-top: 40px;
    padding-bottom: 10px;
}
.delivery-details h4 {
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(36, 43, 61, 0.2);
    font-size: 16px;
    font-weight: 700;
    color: #242B3D;
    line-height: 1.5;
}
.details-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    padding-top: 10px;
}
.detail-item {
    display: flex;
    gap: 5px;
}
.detail-item.address {
    flex: 3;
}
.detail-item.contact {
    flex: 2;
    text-align: left;
}
.detail-item .label {
    color: rgba(36, 43, 61, 0.5);
    font-size: 14px;
}
.detail-item .value {
    color: rgba(36, 43, 61, 0.75);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.6;
}
    .order-info-wrapper{
        display: flex
;
    justify-content: space-between;
    gap: 5px;
    align-items: center;
    }
/* ==========================================================================
   7. Responsive
   ========================================================================== */
@media (max-width: 1100px) {
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    .order-info {
        flex-wrap: wrap;
    }
}

@media (max-width: 991px) {
    .lebasino-order-tracking-widget-wrapper {
        flex-direction: column;
    }
    .lebasino-tracking-form-column {
        flex-basis: auto;
    }
}

@media (max-width: 767px) {
    .lebasino-order-tracking-widget-wrapper .card-header{
        border-bottom:none;
    }
    .result-placeholder, .lebasino-tracking-result-card{
        padding:12px;
    }
        .lebasino-order-tracking-widget-wrapper{
            flex-direction: column;
    }
    .lebasino-tracking-form-column{
        flex:0 100%;
        width:100%;
    }
    
    /* Hide result column initially on mobile */
    .lebasino-tracking-result-column {
        display: none;
    }
    
    /* Show result column when it has results */
    .lebasino-tracking-result-column.has-results {
        display: block;
    }

    .order-info {
        font-size:12px;
        font-weight: 400;
    }
    .order-info a.order-id-link{
        flex:0 100%;
        width:100%;
    }
    .order-info a.order-id-link .label{
            color: #242B3D;
text-align: right;
font-family: Peyda;
font-size: 16px;
font-style: normal;
font-weight: 700;
line-height: normal;
}
  .order-info a.order-id-link .value{
   font-weight: bold;
    font-size: 16px;
    border-radius: 4px;
    background: rgba(200, 59, 59, 0.10);
    padding: 5px 8px;
    
  }
    .order-info a.order-id-link::after{
        content:none;
    }

    .order-info-item{
        padding-left:8px;
        gap:3px
    }
    .order-info-item .value{
        color: #242B3D;
font-size: 12px;
font-weight: 500;
    }
    .order-status-badge{
        display:none;
    }
    .delivery-details{
        border-radius: 8px;
border: 1px solid #09AE87;
background: #FFF;
padding:10px 12px;
    }
      .delivery-details h4 {
    color: #09AE87;
font-size: 16px;
border-bottom:none;
font-weight: 700;
padding:0;

}
.detail-item .label{
    color: #242B3D80;
    font-size: 12px;
}
.detail-item .value{
color: #242B3D;

font-size: 12px;

font-weight: 500;
line-height: 20px; /* 166.667% */
    
}
.detail-item:not(:last-child) {

    border-bottom: 1px solid rgba(36, 43, 61, 0.10);
    padding-bottom:10px;
}
    .details-content {
        flex-direction: column;
        gap: 10px;
    }
    .detail-item.contact {
        text-align: right;
    }
    
    /* Hide elements properly on mobile */
    .lebasino-tracking-result-column:not(.has-results) {
        display: none !important;
    }
    
    /* Ensure proper spacing */
    .lebasino-tracking-form-column {
        margin-bottom: 20px;
    }
    
    /* Accessibility improvements */
    .timeline-content-card:focus-within {
        outline: 2px solid var(--lebasino-secondary-color);
        outline-offset: 2px;
    }
    
    /* Improved touch targets for mobile */
    .lebasino-submit-btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Ensure text contrast */
    .timeline-date {
        color: #666; /* Better contrast than original */
    }
}

.status-processing { color: #007bff; border-color: #007bff; } 
.status-on-hold { color: #ffc107; border-color: #ffc107; }

.status-processing .timeline-icon {
  background-color: #007bff;
}

.status-completed .timeline-icon {
  background-color: #09AE87;
}

.status-on-hold .timeline-icon {
  background-color: #ffc107;
}

/* Status: Pending */
.status-pending {
  color: #ffc107; /* رنگ اصلی */
  border-color: #ffc107;
}
.status-pending .timeline-icon {
  background-color: #ffc107; /* رنگ پس‌زمینه آیکون */
}

/* Status: Processing */
.status-processing {
  color: #007bff;
  border-color: #007bff;
}
.status-processing .timeline-icon {
  background-color: #007bff;
}

/* Status: On-hold */
.status-on-hold {
  color: #6c757d;
  border-color: #6c757d;
}
.status-on-hold .timeline-icon {
  background-color: #6c757d;
}
/* Status: Completed */
.status-completed {
  color: #09AE87;
  border-color:  #09AE87;
}
.status-completed .timeline-icon {
  background-color: #09AE87;
}
.status-completed .timeline-status {
  color: #09AE87;
}

/* Status: Cancelled */
.status-cancelled {
  color: #dc3545;
  border-color: #dc3545;
}
.status-cancelled .timeline-icon {
  background-color: #dc3545;
}

/* Status: Refunded */
.status-refunded {
  color: #6610f2;
  border-color: #6610f2;
}
.status-refunded .timeline-icon {
  background-color: #6610f2;
}

/* Status: Failed */
.status-failed {
  color: #dc3545;
  border-color: #dc3545;
}
.status-failed .timeline-icon {
  background-color: #dc3545;
}