/* Import theme colors */
@import url('theme-color.css');

/* ============================================
   ORDER TRACKING PAGE - Professional Design
   ============================================ */

.order-tracking-page {
    background: var(--gradient-primary);
    min-height: 100vh;
} 

/* Loading Spinner */
.tracking-loading-spinner {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto;
}

.tracking-loading-spinner .spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 4px solid transparent;
    border-top: 4px solid var(--accent-blue);
    border-radius: 50%;
    animation: spin 1.2s linear infinite;
}

.tracking-loading-spinner .spinner-ring:nth-child(1) {
    animation-delay: 0s;
}

.tracking-loading-spinner .spinner-ring:nth-child(2) {
    animation-delay: 0.2s;
    opacity: 0.7;
}

.tracking-loading-spinner .spinner-ring:nth-child(3) {
    animation-delay: 0.4s;
    opacity: 0.4;
}

/* Error Card */
.tracking-error-card {
    text-align: center;
    padding: 2rem 1.5rem;
}

.tracking-error-card .error-icon {
    font-size: 3rem;
    color: var(--accent-orange);
    margin-bottom: 1.5rem;
}

.tracking-error-card h4 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.tracking-error-card p {
    color: var(--text-medium);
    margin-bottom: 2rem;
}

.tracking-error-card .error-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Search Card */
.tracking-search-card {
    margin-bottom: 2rem;
}

.tracking-search-card .card-header-section {
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-light);
    margin-bottom: 1rem;
}

.tracking-search-card .card-header-section h3 {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.tracking-search-card .card-header-section h3 i {
    color: var(--accent-blue);
    margin-right: 0.5rem;
}

.tracking-search-card .tracking-search-form .form-label {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.tracking-search-card .tracking-search-form .form-label i {
    color: var(--accent-blue);
    margin-right: 0.5rem;
}

/* Order Header Card */
.tracking-header-card {
    margin-bottom: 2rem;
    background: var(--gradient-card);
    border: 2px solid var(--border-light);
}

.tracking-header-card .order-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.tracking-header-card .order-info-left h2 {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.tracking-header-card .order-info-left h2 i {
    color: var(--accent-blue);
    margin-right: 0.5rem;
}

.tracking-header-card .order-date {
    color: var(--text-medium);
    margin: 0;
    font-size: 0.9375rem;
}

.tracking-header-card .order-date i {
    margin-right: 0.5rem;
    color: var(--accent-blue);
}

.tracking-header-card .order-info-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1rem;
}

/* Status Badge */
.order-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.8125rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.order-status-badge.status-finish {
    background: linear-gradient(135deg, var(--accent-green) 0%, var(--accent-green) 100%);
    color: white;
}

.order-status-badge.status-paid {
    background: var(--gradient-accent);
    color: white;
}

.order-status-badge.status-confirm,
.order-status-badge.status-processing {
    background: linear-gradient(135deg, var(--accent-orange) 0%, var(--accent-orange) 100%);
    color: white;
}

.order-status-badge.status-shipping {
    background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-purple) 100%);
    color: white;
}

.order-status-badge.status-canceled {
    background: linear-gradient(135deg, var(--accent-orange) 0%, var(--accent-orange) 100%);
    color: white;
}

.order-status-badge.status-pending_payment {
    background: linear-gradient(135deg, var(--accent-orange) 0%, var(--accent-orange) 100%);
    color: white;
}

.order-status-badge.status-unknown {
    background: var(--tertiary-light);
    color: var(--text-medium);
}

/* Timeline Card */
.tracking-timeline-card {
    margin-bottom: 2rem;
}

.tracking-timeline-card .card-header-section {
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-light);
    margin-bottom: 1rem;
}

.tracking-timeline-card .card-header-section h4 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.tracking-timeline-card .card-header-section h4 i {
    color: var(--accent-blue);
    margin-right: 0.5rem;
}

/* Professional Timeline */
.professional-timeline {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
    padding: 1.5rem 0;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.timeline-step {
    flex: 1;
    min-width: 120px;
    position: relative;
    text-align: center;
}

.timeline-step-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.timeline-icon-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.timeline-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--tertiary-light);
    color: var(--text-light);
    font-size: 1.25rem;
    border: 3px solid var(--border-light);
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.timeline-step.active .timeline-icon {
    background: var(--gradient-accent);
    color: white;
    border-color: var(--accent-blue);
    box-shadow: 0 4px 15px rgba(77, 106, 146, 0.3);
    transform: scale(1.1);
}

.timeline-connector {
    position: absolute;
    top: 30px;
    left: 50%;
    width: 100%;
    height: 3px;
    background: var(--border-light);
    z-index: 1;
    transition: all 0.3s ease;
}

.timeline-step:last-child .timeline-connector {
    display: none;
}

.timeline-step.active .timeline-connector {
    background: var(--gradient-accent);
}

.timeline-label {
    margin-top: 1rem;
}

.timeline-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-light);
    transition: all 0.3s ease;
}

.timeline-step.active .timeline-title {
    color: var(--accent-blue);
    font-weight: 700;
}

/* Notes Card */
.tracking-notes-card {
    margin-bottom: 2rem;
}

.tracking-notes-card .card-header-section {
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-light);
    margin-bottom: 1rem;
}

.tracking-notes-card .card-header-section h4 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.tracking-notes-card .card-header-section h4 i {
    color: var(--accent-blue);
    margin-right: 0.5rem;
}

.note-item {
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 0.75rem;
    border-left: 4px solid;
    transition: all 0.3s ease;
}

.note-item.admin-note {
    background: var(--secondary-light);
    border-left-color: var(--accent-blue);
}

.note-item.staff-note {
    background: var(--secondary-light);
    border-left-color: var(--accent-orange);
}

.note-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.note-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-dark);
}

.note-header i {
    font-size: 1rem;
}

.note-content {
    color: var(--text-medium);
    line-height: 1.6;
    font-size: 0.9375rem;
}

/* Shipment Card */
.tracking-shipment-card {
    margin-bottom: 2rem;
}

.tracking-shipment-card .card-header-section {
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-light);
    margin-bottom: 1rem;
}

.tracking-shipment-card .card-header-section h4 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.tracking-shipment-card .card-header-section h4 i {
    color: var(--accent-blue);
    margin-right: 0.5rem;
}

.shipment-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.shipment-info-item {
    padding: 1rem;
    background: var(--secondary-light);
    border-radius: 12px;
    border: 1px solid var(--border-light);
}

.info-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-medium);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-label i {
    margin-right: 0.5rem;
    color: var(--accent-blue);
}

.info-value {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-dark);
}

.shipment-status {
    background: var(--gradient-accent);
    color: white;
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 600;
}

/* Order Items Card */
.tracking-items-card {
    margin-bottom: 2rem;
}

.tracking-items-card .card-header-section {
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-light);
    margin-bottom: 1rem;
}

.tracking-items-card .card-header-section h4 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.tracking-items-card .card-header-section h4 i {
    color: var(--accent-blue);
    margin-right: 0.5rem;
}

.order-items-list {
    margin-bottom: 2rem;
}

.order-item-row {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-light);
    gap: 1rem;
    transition: all 0.3s ease;
}

.order-item-row:last-child {
    border-bottom: none;
}

.order-item-row:hover {
    background: var(--secondary-light);
    border-radius: 8px;
    transform: translateX(5px);
}

.item-info {
    flex: 1;
}

.item-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.item-variant {
    display: block;
    font-size: 0.8125rem;
    color: var(--text-medium);
    margin-top: 0.25rem;
    font-weight: 400;
}

.item-sku {
    font-size: 0.8125rem;
    color: var(--text-light);
}

.item-sku i {
    margin-right: 0.25rem;
}

.item-quantity {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
}

.quantity-label {
    font-size: 0.75rem;
    color: var(--text-light);
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.quantity-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
}

.item-price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    min-width: 120px;
}

.price-value {
    font-size: 0.9375rem;
    color: var(--text-medium);
    margin-bottom: 0.25rem;
}

.price-total {
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent-blue);
}

/* Order Summary */
.order-summary {
    padding: 1rem;
    background: var(--secondary-light);
    border-radius: 12px;
    border: 1px solid var(--border-light);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.625rem 0;
    font-size: 0.875rem;
}

.summary-row:not(:last-child) {
    border-bottom: 1px solid var(--border-light);
}

.summary-label {
    color: var(--text-medium);
    font-weight: 600;
}

.summary-label i {
    margin-right: 0.5rem;
    color: var(--accent-blue);
}

.summary-value {
    font-weight: 700;
    color: var(--text-dark);
}

.summary-row.discount-row .summary-value {
    color: var(--accent-green);
}

.summary-row.total-row {
    border-top: 2px solid var(--border-light);
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    font-size: 1rem;
}

.summary-row.total-row .summary-label,
.summary-row.total-row .summary-value {
    font-size: 1rem;
    font-weight: 800;
    color: var(--accent-blue);
}

/* Activity Card */
.tracking-activity-card {
    margin-bottom: 2rem;
}

.tracking-activity-card .card-header-section {
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-light);
    margin-bottom: 1rem;
}

.tracking-activity-card .card-header-section h4 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.tracking-activity-card .card-header-section h4 i {
    color: var(--accent-blue);
    margin-right: 0.5rem;
}

.activity-timeline {
    position: relative;
    padding-left: 2rem;
}

.activity-timeline::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-light);
}

.activity-item {
    position: relative;
    padding-bottom: 1.5rem;
    padding-left: 2rem;
}

.activity-item:last-child {
    padding-bottom: 0;
}

.activity-icon {
    position: absolute;
    left: -1.75rem;
    top: 0.25rem;
    width: 12px;
    height: 12px;
    background: var(--accent-blue);
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 0 2px var(--accent-blue);
}

.activity-content {
    background: var(--secondary-light);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
}

.activity-item:hover .activity-content {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.activity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.activity-staff {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-dark);
}

.activity-time {
    font-size: 0.8125rem;
    color: var(--text-medium);
}

.time-ago {
    color: var(--text-light);
    font-style: italic;
}

.activity-description {
    font-size: 0.9375rem;
    color: var(--text-medium);
    line-height: 1.6;
}

/* Address Card */
.tracking-address-card {
    margin-bottom: 2rem;
}

.tracking-address-card .card-header-section {
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-light);
    margin-bottom: 1rem;
}

.tracking-address-card .card-header-section h4 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.tracking-address-card .card-header-section h4 i {
    color: var(--accent-blue);
    margin-right: 0.5rem;
}

.address-content address {
    font-style: normal;
    line-height: 1.8;
    color: var(--text-medium);
}

.address-content address strong {
    color: var(--text-dark);
    font-size: 0.9375rem;
    display: block;
    margin-bottom: 0.5rem;
}

.address-content address i {
    margin-right: 0.5rem;
    color: var(--accent-blue);
}

/* Actions */
.tracking-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

.tracking-actions .btn {
    min-width: 160px;
    padding: 0.5625rem 1.125rem;
    font-weight: 600;
    font-size: 0.8125rem;
}

/* Card Sections */
.card-header-section {
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-light);
    margin-bottom: 1.5rem;
}

.card-body-section {
    padding: 0;
}

/* Responsive Design */
@media (max-width: 991.98px) {
    .professional-timeline {
        flex-direction: column;
        align-items: flex-start;
    }

    .timeline-step {
        width: 100%;
        display: flex;
        align-items: center;
        text-align: left;
    }

    .timeline-step-content {
        flex-direction: row;
        width: 100%;
        align-items: center;
    }

    .timeline-icon-wrapper {
        flex-direction: row;
        width: auto;
        margin-right: 1.5rem;
    }

    .timeline-connector {
        top: auto;
        left: 30px;
        width: 3px;
        height: 100%;
    }

    .timeline-step:last-child .timeline-connector {
        display: none;
    }

    .timeline-label {
        margin-top: 0;
        flex: 1;
    }

    .order-header-top {
        flex-direction: column;
    }

    .order-info-right {
        align-items: flex-start;
        width: 100%;
    }

    .shipment-info-grid {
        grid-template-columns: 1fr;
    }

    .order-item-row {
        flex-wrap: wrap;
    }

    .item-quantity,
    .item-price {
        min-width: auto;
        flex: 1;
    }
}

@media (max-width: 767.98px) {
    .tracking-header-card .order-info-left h2 {
        font-size: 1.25rem;
    }

    .order-status-badge {
        font-size: 0.75rem;
        padding: 0.4375rem 0.875rem;
    }

    .timeline-icon {
        width: 45px;
        height: 45px;
        font-size: 1.125rem;
    }

    .order-item-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .item-quantity,
    .item-price {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
    }

    .activity-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .tracking-actions {
        flex-direction: column;
    }

    .tracking-actions .btn {
        width: 100%;
    }
}

@media (max-width: 575.98px) {
    .order-tracking-page .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .tracking-search-card .card-header-section h3,
    .tracking-header-card .order-info-left h2 {
        font-size: 1.125rem;
    }

    .timeline-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .timeline-title {
        font-size: 0.8125rem;
    }

    .note-item {
        padding: 1rem;
    }

    .shipment-info-item {
        padding: 1rem;
    }

    .order-item-row {
        padding: 1rem;
    }

    .order-summary {
        padding: 1rem;
    }
}

/* ============================================
   COMPACT LAYOUT STYLES
   ============================================ */

/* Shipment Header Bar */
.shipment-header-bar {
    background: var(--text-dark);
    color: white;
    padding: 0.75rem 0;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.shipment-header-status {
    font-size: 0.8125rem;
    opacity: 0.9;
}

/* Compact Timeline */
.compact-timeline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    gap: 0.5rem;
}

.compact-timeline-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    text-align: center;
}

.compact-timeline-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--tertiary-light);
    color: var(--text-light);
    font-size: 1rem;
    border: 2px solid var(--border-light);
    transition: all 0.3s ease;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 2;
}

.compact-timeline-step.active .compact-timeline-icon {
    background: var(--gradient-accent);
    color: white;
    border-color: var(--accent-blue);
    box-shadow: 0 2px 8px rgba(77, 106, 146, 0.3);
}

.compact-timeline-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-light);
    transition: all 0.3s ease;
    line-height: 1.2;
}

.compact-timeline-step.active .compact-timeline-label {
    color: var(--accent-blue);
    font-weight: 700;
}

.compact-timeline-line {
    position: absolute;
    top: 20px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: var(--border-light);
    z-index: 1;
    transition: all 0.3s ease;
}

.compact-timeline-step:last-child .compact-timeline-line {
    display: none;
}

.compact-timeline-step.active .compact-timeline-line {
    background: var(--gradient-accent);
}

/* Shipment Details */
.shipment-detail-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.8125rem;
}

.shipment-detail-item:last-child {
    border-bottom: none;
}

.shipment-detail-item strong {
    font-size: 0.9375rem;
    color: var(--text-dark);
    display: block;
    margin-bottom: 0.5rem;
}

.detail-label {
    font-size: 0.75rem;
    color: var(--text-medium);
    font-weight: 600;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    font-size: 0.8125rem;
    color: var(--text-dark);
    line-height: 1.5;
}

.invoice-link-text {
    color: var(--accent-blue);
    font-weight: 600;
}

/* Address Sections */
.address-section {
    margin-bottom: 1rem;
}

.address-section:last-child {
    margin-bottom: 0;
}

.address-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.address-content {
    font-size: 0.8125rem;
    color: var(--text-medium);
    line-height: 1.6;
}

.address-content strong {
    color: var(--text-dark);
    font-size: 0.875rem;
    display: block;
    margin-bottom: 0.25rem;
}

.address-content i {
    margin-right: 0.25rem;
    color: var(--accent-blue);
}

/* Compact Activity Timeline */
.compact-activity-timeline {
    flex: 1;
    overflow-y: auto;
    padding-right: 0.5rem;
    min-height: 200px;
}

.compact-activity-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.8125rem;
}

.compact-activity-item:last-child {
    border-bottom: none;
}

.compact-activity-item .activity-time {
    font-size: 0.75rem;
    color: var(--text-medium);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.compact-activity-item .activity-description {
    color: var(--text-dark);
    line-height: 1.5;
}

/* Compact Order Items Table */
.compact-order-items-table {
    overflow-x: auto;
}

.compact-order-items-table .table {
    font-size: 0.8125rem;
    margin-bottom: 0;
}

.compact-order-items-table .table thead th {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.75rem 0.5rem;
    border-bottom: 2px solid var(--border-light);
    background: var(--secondary-light);
}

.compact-order-items-table .table tbody td {
    padding: 0.75rem 0.5rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-light);
}

.compact-order-items-table .table tbody tr:last-child td {
    border-bottom: none;
}

.product-name-compact {
    font-size: 0.8125rem;
    line-height: 1.4;
}

.product-name-compact strong {
    color: var(--text-dark);
    font-weight: 600;
    display: block;
    margin-bottom: 0.25rem;
}

.product-name-compact small {
    font-size: 0.75rem;
    display: block;
    margin-top: 0.25rem;
}

/* Tracking Summary Card */
.tracking-summary-card {
    margin-bottom: 0;
}

.tracking-summary-card .card-header-section {
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-light);
    margin-bottom: 1rem;
}

.tracking-summary-card .card-header-section h4 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.tracking-summary-card .card-header-section h4 i {
    color: var(--accent-blue);
    margin-right: 0.5rem;
}

/* Equal Height Cards */
.equal-height-cards {
    display: flex;
    flex-wrap: wrap;
}

.equal-height-cards > [class*="col-"] {
    display: flex;
    flex-direction: column;
}

.equal-height-cards .hero-card {
    height: 100%;
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

.equal-height-cards .card-header-section {
    flex-shrink: 0;
}

.equal-height-cards .card-body-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Ensure consistent card styling */
.tracking-shipment-card,
.tracking-address-card,
.tracking-activity-card {
    min-height: 400px;
}

.tracking-shipment-card .card-body-section,
.tracking-address-card .card-body-section,
.tracking-activity-card .card-body-section {
    padding: 1rem;
}

/* Compact Notes */
.note-item-compact {
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    background: var(--secondary-light);
    border-radius: 8px;
    border-left: 3px solid;
}

.note-item-compact.admin-note {
    border-left-color: var(--accent-blue);
}

.note-item-compact.staff-note {
    border-left-color: var(--accent-orange);
}

.note-header-compact {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.note-header-compact i {
    font-size: 0.8125rem;
}

.note-content-compact {
    font-size: 0.75rem;
    color: var(--text-medium);
    line-height: 1.5;
}

/* Responsive adjustments for compact layout */
@media (max-width: 991.98px) {
    .compact-timeline {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .compact-timeline-step {
        min-width: 100px;
    }

    .compact-timeline-icon {
        width: 35px;
        height: 35px;
        font-size: 0.875rem;
    }

    .compact-timeline-label {
        font-size: 0.6875rem;
    }

    .shipment-header-bar {
        font-size: 0.8125rem;
        padding: 0.625rem 0;
    }

    .shipment-header-status {
        font-size: 0.75rem;
        margin-top: 0.5rem;
        display: block;
    }
}

@media (max-width: 767.98px) {
    .compact-timeline {
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem 0;
    }

    .compact-timeline-step {
        width: 100%;
        flex-direction: row;
        align-items: center;
        text-align: left;
        padding-left: 1rem;
    }

    .compact-timeline-icon {
        margin-right: 1rem;
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .compact-timeline-line {
        display: none;
    }

    .compact-timeline-label {
        flex: 1;
    }

    .compact-order-items-table .table {
        font-size: 0.75rem;
    }

    .compact-order-items-table .table thead th {
        font-size: 0.6875rem;
        padding: 0.5rem 0.25rem;
    }

    .compact-order-items-table .table tbody td {
        padding: 0.5rem 0.25rem;
    }

    .equal-height-cards .hero-card {
        min-height: auto;
    }

    .tracking-shipment-card,
    .tracking-address-card,
    .tracking-activity-card {
        min-height: auto;
    }
}


/* Modern Tracking Page Styles */
.tracking-page-container {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.modern-card {
    background: var(--primary-light);
    border-radius: 10px;
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-light);
    margin-bottom: 20px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.modern-card:hover {
    box-shadow: 0 10px 15px -3px var(--shadow-light);
}

.card-header-modern {
    background: var(--secondary-light);
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-light);
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-dark);
    display: flex;
    align-items: center;
}

.card-header-modern i {
    margin-right: 10px;
    color: var(--accent-blue);
}

.card-body-modern {
    padding: 20px;
}

/* Status Stepper */
.stepper-wrapper {
    display: flex;
    justify-content: space-between;
    margin: 15px 0 30px;
    position: relative;
}

.stepper-wrapper::before {
    content: '';
    position: absolute;
    top: 14px;
    left: 5%;
    width: 90%;
    height: 2px;
    background: var(--border-light);
    z-index: 0;
}

.stepper-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    z-index: 1;
}

.step-counter {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-light);
    border: 2px solid var(--border-light);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 8px;
    transition: all 0.3s;
    font-size: 12px;
}

.stepper-item.completed .step-counter,
.stepper-item.active .step-counter {
    border-color: var(--accent-green);
    background: var(--accent-green);
    color: var(--primary-light);
}

.step-name {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-medium);
    text-align: center;
}

.stepper-item.active .step-name, .stepper-item.completed .step-name {
    color: var(--text-dark);
    font-weight: 700;
}

/* Item List */
.order-item-row {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}

.order-item-row:last-child {
    border-bottom: none;
}

.item-image-placeholder {
    width: 50px;
    height: 50px;
    background: var(--secondary-light);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    color: var(--text-light);
}

.item-details {
    flex: 1;
}

.item-title {
    font-weight: 600;
    margin-bottom: 2px;
    display: block;
    font-size: 0.95rem;
}

/* Summary & Addresses */
.info-group {
    margin-bottom: 15px;
}
.info-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 4px;
    display: block;
}
.info-value {
    font-weight: 500;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9rem;
}
.summary-total {
    border-top: 2px solid var(--border-light);
    padding-top: 12px;
    margin-top: 12px;
    font-weight: 700;
    font-size: 1rem;
}

/* Search Form Refined */
.search-container-center {
    max-width: 450px;
    margin: 0 auto;
}

.big-status-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent-green);
    margin-bottom: 0.25rem;
}

.delivery-estimate {
    font-size: 0.95rem;
    color: var(--text-dark);
}


/* Invoice Page Styles */
.invoice-container {
    max-width: 1200px;
    margin: 40px auto;
    background: var(--primary-light);
    padding: 40px;
    box-shadow: 0 0 20px var(--shadow-light);
    font-family: 'Inter', sans-serif;
    color: var(--text-dark);
    margin-top: 110px !important;
}


.invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 2px solid var(--border-light);
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.company-info h2 {
    color: var(--accent-blue);
    margin: 0 0 5px 0;
}

.invoice-details {
    text-align: right;
}

.invoice-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.invoice-meta {
    margin-top: 10px;
    font-size: 0.95rem;
    color: var(--text-medium);
}

.invoice-meta strong {
    color: var(--text-dark);
}

.addresses-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
}

.address-box h5 {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--text-medium);
    font-weight: 600;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.address-box p {
    margin: 0;
    line-height: 1.5;
    font-size: 0.95rem;
}

.invoice-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
}

.invoice-table th {
    background: var(--secondary-light);
    padding: 12px 15px;
    text-align: left;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-medium);
    font-weight: 600;
    border-bottom: 1px solid var(--border-light);
}

.invoice-table td {
    padding: 15px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: top;
}

.text-end { text-align: right; }
.text-center { text-align: center; }

.totals-section {
    display: flex;
    justify-content: flex-end;
}

.totals-box {
    width: 300px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 0.95rem;
}

.total-row.final {
    border-top: 2px solid var(--border-light);
    margin-top: 10px;
    padding-top: 10px;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-dark);
}

.print-actions {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
}

@media print {
    body { background: var(--primary-light); }
    .invoice-container { box-shadow: none; margin: 0; max-width: 100%; padding: 20px; }
    .print-actions { display: none; }
    header, footer { display: none !important; }
}


@media print {
    .invoice-page-wrapper {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
}


/* Invoice Responsiveness & Size Adjustments */
.invoice-container {
    padding: 30px;
}

.invoice-title {
    font-size: 1.5rem;
}

.company-info p, .address-box p, .invoice-meta {
    font-size: 0.85rem;
}

.invoice-table th, .invoice-table td {
    padding: 10px;
    font-size: 0.85rem;
}

.total-row {
    font-size: 0.9rem;
    padding: 5px 0;
}

.total-row.final {
    font-size: 1rem;
}

/* Mobile Responsiveness Improvements */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px;
    width: 100%;
}

@media (max-width: 768px) {
    .invoice-container {
        padding: 20px;
        margin: 20px auto;
        margin-top: 80px !important; /* Reduced top margin for mobile */
    }

    .invoice-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .company-logo {
        margin-bottom: 15px;
    }

    .invoice-details {
        text-align: left;
        margin-top: 20px;
        width: 100%;
    }
    
    .addresses-row {
        flex-direction: column;
        gap: 20px;
    }
    
    .totals-section {
        justify-content: flex-start;
    }
    
    .totals-box {
        width: 100%;
    }

    .print-actions {
        flex-direction: column;
        gap: 10px !important;
    }
    
    .print-actions .btn {
        width: 100%;
        margin: 0 !important;
    }

    /* Mobile Stepper (Vertical Timeline) */
    .stepper-wrapper {
        flex-direction: column;
        align-items: flex-start;
        margin-left: 10px;
        margin-top: 20px;
        margin-bottom: 20px;
    }

    .stepper-wrapper::before {
        width: 2px;
        height: 100%;
        left: 14px; /* Align with center of 28px counter */
        top: 0;
        background: var(--border-light);
    }

    .stepper-item {
        flex-direction: row;
        align-items: center;
        width: 100%;
        margin-bottom: 20px;
        text-align: left;
        flex: 0 0 auto; /* Don't grow/shrink like flex row */
    }

    .stepper-item:last-child {
        margin-bottom: 0;
    }

    .step-counter {
        margin-bottom: 0;
        margin-right: 15px;
        z-index: 2; /* Sit on top of line */
        background: var(--primary-light); /* Cover the line */
    }

    .step-name {
        text-align: left;
        font-size: 0.9rem; /* Increase readability */
    }
}

