/* Track Your Order - Frontend Styles */

/* Main container */
.tyo-tracking-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    position: relative;
}

/* Tracking form */
.tyo-tracking-form-wrapper {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 40px;
    margin-bottom: 30px;
    border: 1px solid #e5e7eb;
    margin-top: 50px; /* Space for Help button */
}

.tyo-tracking-title {
    color: #333333;
    font-size: 24px;
    font-weight: 500;
    margin-bottom: 2rem;
    text-align: center;
    letter-spacing: 0.5px;
}

.tyo-tracking-form {
    display: grid;
    gap: 25px;
}

.tyo-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 768px) {
    .tyo-form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

.tyo-form-group {
    display: flex;
    flex-direction: column;
}

.tyo-form-group label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    font-size: 14px;
}

.tyo-form-group input {
    padding: 15px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #fff;
    font-weight: 500;
}

.tyo-form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.tyo-form-group input:valid {
    border-color: #10b981;
}

.tyo-form-group input::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

/* Button styles */
.tyo-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    min-height: 48px;
}

.tyo-btn-primary {
    background: #000000;
    color: #ffffff;
    border: 2px solid #000000;
    font-size: 18px;
    font-weight: 700;
    padding: 15px 40px;
    width: 100%;
    margin-top: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.tyo-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);
    background: #333333;
    border-color: #333333;
}

.tyo-btn-secondary {
    background: #f8fafc;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.tyo-btn-secondary:hover {
    background: #e2e8f0;
    color: #334155;
}

.tyo-btn-outline {
    background: transparent;
    color: #3b82f6;
    border: 2px solid #3b82f6;
}

.tyo-btn-outline:hover {
    background: #3b82f6;
    color: #fff;
}

.tyo-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Loading spinner */
.tyo-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: tyo-spin 1s linear infinite;
    margin-right: 8px;
}

@keyframes tyo-spin {
    to {
        transform: rotate(360deg);
    }
}

.tyo-btn-loading {
    display: none;
}

.tyo-btn.loading .tyo-btn-text {
    display: none;
}

.tyo-btn.loading .tyo-btn-loading {
    display: flex;
    align-items: center;
}

/* Tracking results */
.tyo-tracking-results {
    margin-top: 30px;
}

.tyo-tracking-result {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Order header */
.tyo-order-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 25px;
    background: #ffffff;
    color: #000000;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border: 1px solid #e5e7eb;
}

.tyo-order-info-complete {
    flex: 1;
    margin-right: 20px;
}

.tyo-order-title {
    margin: 0 0 20px 0;
    font-size: 1.5rem;
    font-weight: 800;
    text-align: center;
    border-bottom: 2px solid #d1d5db;
    padding-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #111827;
}

/* Order Details Grid */
.tyo-order-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 15px;
}

.tyo-detail-row {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    padding: 14px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.tyo-detail-row:hover {
    background: #f9fafb;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.tyo-detail-label {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Icons for Order Details - now dark colored */
.tyo-icon-white {
    font-size: 16px;
    color: #374151;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tyo-detail-value {
    font-size: 14px;
    font-weight: 700;
    word-break: break-word;
    color: #111827;
}

.tyo-tracking-highlight {
    background: #f3f4f6;
    padding: 6px 10px;
    border-radius: 6px;
    font-family: monospace;
    letter-spacing: 1px;
    font-weight: 800;
    border: 1px solid #d1d5db;
    color: #111827;
}

/* Status Container */
.tyo-current-status {
    flex-shrink: 0;
    min-width: 180px;
}

.tyo-status-container {
    text-align: center;
    background: #ffffff;
    padding: 18px;
    border-radius: 12px;
    border: 2px solid #e5e7eb;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.tyo-status-label {
    font-size: 13px;
    font-weight: 700;
    color: #6b7280;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

/* Status badges */
.tyo-status-badge {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 25px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 2px solid #e5e7eb;
    background: #000000;
    color: #ffffff;
}

.tyo-status-placed,
.tyo-status-order-placed {
    background: #000000;
    color: #ffffff;
    border-color: #000000;
}

.tyo-status-received,
.tyo-status-order-received {
    background: #000000;
    color: #ffffff;
    border-color: #000000;
}

.tyo-status-in-production {
    background: #000000;
    color: #ffffff;
    border-color: #000000;
}

.tyo-status-shipped {
    background: #000000;
    color: #ffffff;
    border-color: #000000;
}

.tyo-status-in-transit {
    background: #000000;
    color: #ffffff;
    border-color: #000000;
}

.tyo-status-out-for-delivery {
    background: #000000;
    color: #ffffff;
    border-color: #000000;
}

.tyo-status-delivered {
    background: #000000;
    color: #ffffff;
    border-color: #000000;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    }
}

/* Timeline */
.tyo-timeline {
    padding: 24px;
    background: #f8f9fa;
}

.tyo-timeline-title {
    margin: 0 0 24px 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #000000;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid #000000;
    padding-bottom: 10px;
}

.tyo-timeline-container {
    position: relative;
}

.tyo-timeline-container::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #000000;
    z-index: 1;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
}

.tyo-timeline-item {
    position: relative;
    padding-left: 60px;
    margin-bottom: 32px;
}

.tyo-timeline-item:last-child {
    margin-bottom: 0;
}

.tyo-timeline-marker {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 2;
}

.tyo-timeline-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    background: #000000;
    color: #ffffff;
}

/* Timeline Status Colors */
.tyo-timeline-item.completed .tyo-timeline-icon {
    background: #000000;
    color: #ffffff;
    border-color: #000000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}

.tyo-timeline-item.completed .tyo-icon-white {
    color: #ffffff;
}

.tyo-timeline-item.current .tyo-timeline-icon {
    background: #000000;
    color: #ffffff;
    border-color: #000000;
    animation: tyo-pulse 2s infinite;
    box-shadow: 0 4px 20px rgba(0,0,0,0.6);
}

.tyo-timeline-item.current .tyo-icon-white {
    color: #ffffff;
}

.tyo-timeline-item.pending .tyo-timeline-icon {
    background: #cccccc;
    color: #ffffff;
    border-color: #cccccc;
}

.tyo-timeline-item.pending .tyo-icon-white {
    color: #ffffff;
}

@keyframes tyo-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(0, 0, 0, 0);
    }
}

.tyo-timeline-content h5 {
    margin: 0 0 6px 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #000000;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tyo-timeline-date {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #374151;
    font-weight: 500;
}

.tyo-time {
    margin-left: 8px;
    color: #9ca3af;
}

.tyo-estimated {
    color: #000000;
    font-weight: 600;
    background: rgba(0,0,0,0.1);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 13px;
}

.tyo-timeline-description {
    margin: 0;
    font-size: 14px;
    color: #6b7280;
}

/* Compact timeline for modal */
.tyo-timeline-compact .tyo-timeline-item {
    margin-bottom: 16px;
    padding-left: 50px;
}

.tyo-timeline-compact .tyo-timeline-icon {
    width: 32px;
    height: 32px;
    font-size: 14px;
}

.tyo-timeline-compact .tyo-timeline-container::before {
    left: 16px;
}

/* Shipping info */
.tyo-shipping-info {
    padding: 24px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

.tyo-shipping-info h4 {
    margin: 0 0 16px 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1a202c;
}

.tyo-address {
    padding: 16px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    line-height: 1.6;
    color: #374151;
}

/* Error messages */
.tyo-error-message {
    display: flex;
    align-items: center;
    padding: 24px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #991b1b;
    margin: 20px 0;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.tyo-error-message-big {
    display: block;
    padding: 20px;
    background: #fee;
    border: 2px solid #f00;
    border-radius: 10px;
    color: #d00;
    font-weight: bold;
    text-align: center;
    margin: 20px 0;
    font-size: 16px;
    line-height: 1.5;
}

.tyo-validation-error {
    background: #ffe6e6;
    border: 1px solid #ff9999;
    color: #cc0000;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    font-weight: 600;
}

.tyo-error-icon {
    font-size: 24px;
    margin-right: 16px;
    flex-shrink: 0;
}

.tyo-error-content h4 {
    margin: 0 0 8px 0;
    font-size: 1.125rem;
    font-weight: 600;
}

.tyo-error-content p {
    margin: 0 0 8px 0;
    line-height: 1.5;
}

/* Modal */
.tyo-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.tyo-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.tyo-modal-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
}

.tyo-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.tyo-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a202c;
}

.tyo-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s ease;
}

.tyo-modal-close:hover {
    color: #374151;
}

.tyo-modal-body {
    padding: 24px;
    max-height: calc(90vh - 80px);
    overflow-y: auto;
}

/* Order details in modal */
.tyo-order-details {
    display: grid;
    gap: 24px;
}

.tyo-detail-section h4 {
    margin: 0 0 16px 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #1a202c;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}

.tyo-detail-grid {
    display: grid;
    gap: 12px;
}

.tyo-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.tyo-detail-item label {
    font-weight: 500;
    color: #6b7280;
    margin-right: 16px;
}

.tyo-detail-item span {
    color: #1a202c;
    text-align: right;
}

.tyo-address-box {
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    line-height: 1.6;
    color: #374151;
}

/* Responsive design */
@media (max-width: 768px) {
    .tyo-tracking-container {
        padding: 0;
        max-width: 100%;
        margin: 0;
    }
    
    .tyo-tracking-form-wrapper {
        padding: 20px;
        margin: 0;
        border-radius: 0;
        margin-top: 60px; /* Space for Help button */
    }
    
    .tyo-tracking-title {
        font-size: 1.5rem;
        text-align: center;
    }
    
    .tyo-order-header {
        flex-direction: column;
        gap: 20px;
        padding: 20px;
    }
    
    .tyo-order-info-complete {
        margin-right: 0;
    }
    
    .tyo-order-details-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .tyo-detail-row {
        padding: 10px;
    }
    
    .tyo-detail-label {
        font-size: 11px;
    }
    
    .tyo-detail-value {
        font-size: 13px;
    }
    
    .tyo-current-status {
        min-width: auto;
        width: 100%;
    }
    
    .tyo-status-container {
        padding: 12px;
    }
    
    .tyo-timeline {
        padding: 16px;
    }
    
    .tyo-timeline-item {
        padding-left: 50px;
    }
    
    .tyo-timeline-container::before {
        left: 16px;
    }
    
    .tyo-timeline-icon {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .tyo-shipping-info,
    .tyo-order-history {
        padding: 15px;
    }
    
    .tyo-modal {
        padding: 10px;
    }
    
    .tyo-modal-content {
        max-height: 95vh;
    }
    
    .tyo-modal-body {
        padding: 15px;
        max-height: calc(95vh - 60px);
        overflow-y: auto;
    }
}

@media (max-width: 480px) {
    .tyo-tracking-container {
        padding: 0;
        margin: 0;
    }
    
    .tyo-tracking-form-wrapper {
        padding: 15px;
        margin: 0;
        border-radius: 0;
        margin-top: 60px;
    }
    
    .tyo-tracking-title {
        font-size: 1.5rem;
    }
    
    .tyo-form-group input {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 12px 16px;
    }
    
    .tyo-btn-primary {
        font-size: 16px;
        padding: 12px 30px;
    }
    
    .tyo-timeline {
        padding: 10px;
    }
    
    .tyo-shipping-info,
    .tyo-order-history {
        padding: 15px;
    }
    
    .tyo-modal {
        padding: 10px;
    }
    
    .tyo-modal-content {
        max-height: 95vh;
    }
    
    .tyo-modal-body {
        padding: 15px;
        max-height: calc(95vh - 60px);
        overflow-y: auto;
    }
}
