/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    padding: 10px;
    color: #333;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* RTL Support */
[dir="rtl"] {
    text-align: right;
}

[dir="rtl"] .header h1 i {
    margin-right: 0;
    margin-left: 15px;
}

[dir="rtl"] .form-group label i {
    margin-right: 0;
    margin-left: 8px;
}

[dir="rtl"] .btn i {
    margin-right: 0;
    margin-left: 8px;
}

[dir="rtl"] .order-date i {
    margin-right: 0;
    margin-left: 8px;
}

[dir="rtl"] .timeline-notes i {
    margin-right: 0;
    margin-left: 8px;
}

/* Prevent horizontal scroll on mobile */
html, body {
    overflow-x: hidden;
}

/* Ensure proper scrolling for iframe content */
html {
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

body {
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    /* box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1); */
    overflow: hidden;
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    text-align: center;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.header h1 i {
    margin-right: 15px;
    color: #ffd700;
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Form Styles */
.tracking-form {
    padding: 15px;
    background: #f8f9fa;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
    font-size: 1rem;
}

.form-group label i {
    margin-right: 8px;
    color: #667eea;
    width: 20px;
}

.form-group input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Button Styles */
.btn-primary, .btn-secondary {
    display: inline-flex;
    align-items: center;
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 5px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-primary i, .btn-secondary i {
    margin-right: 8px;
}

/* Error Message */
.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px 20px;
    border-radius: 10px;
    margin-top: 20px;
    border: 1px solid #f5c6cb;
}

.error-message i {
    margin-right: 8px;
}

/* Orders Section */
.orders-section {
    padding: 40px;
}

.orders-section h2 {
    margin-bottom: 30px;
    color: #333;
    font-size: 1.8rem;
}

.orders-section h2 i {
    margin-right: 10px;
    color: #667eea;
}

.orders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
}

/* Order Card Styles */
.order-card {
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 15px;
    padding: 25px;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.order-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f8f9fa;
}

.order-header h3 {
    color: #333;
    font-size: 1.3rem;
    font-weight: 700;
}

.order-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-processing {
    background: #cce5ff;
    color: #004085;
}

.status-shipped {
    background: #d1ecf1;
    color: #0c5460;
}

.status-delivered {
    background: #d4edda;
    color: #155724;
}

.status-cancelled {
    background: #f8d7da;
    color: #721c24;
}

.order-details {
    margin-bottom: 20px;
}

.detail-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    color: #666;
}

.detail-row i {
    margin-right: 10px;
    width: 20px;
    color: #667eea;
}

.order-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 0;
        font-size: 14px;
        margin: 0;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .container {
        border-radius: 0;
        margin: 0;
        max-width: 100%;
        box-shadow: none;
        min-height: 100vh;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .header {
        padding: 15px 20px;
        border-radius: 0;
    }
    
    .header h1 {
        font-size: 1.4rem;
        margin-bottom: 5px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .header h1 i {
        margin-right: 8px;
        font-size: 1.1rem;
    }
    
    .header p {
        font-size: 0.85rem;
        margin: 0;
    }
    
    .search-section, .orders-section {
        padding: 15px 20px;
    }
    
    .tracking-form {
        padding: 15px 20px;
        background: transparent;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-group label {
        font-size: 0.9rem;
        margin-bottom: 6px;
    }
    
    .form-group input {
        padding: 12px 15px;
        font-size: 16px; /* Prevents zoom on iOS */
        border-radius: 8px;
        border: 1px solid #ddd;
    }
    
    /* .btn-primary, .btn-secondary {
        padding: 12px 20px;
        font-size: 0.9rem;
        border-radius: 8px;
        width: 100%;
        margin: 8px 0;
        min-height: 44px; 
        display: flex;
        align-items: center;
        justify-content: center;
    } */
    
    .orders-list {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
        margin-top: 15px !important;
        overflow-x: hidden;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
    }
    
    .order-card {
        padding: 15px;
        border-radius: 8px;
        margin: 0;
        border: 1px solid #e0e0e0;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .order-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
        margin-bottom: 12px;
        padding-bottom: 8px;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .order-header h3 {
        font-size: 1.1rem;
        margin: 0;
        color: #333;
    }
    
    .order-date {
        margin-bottom: 12px;
        padding-bottom: 8px;
        font-size: 0.85rem;
        color: #666;
        display: flex;
        align-items: center;
    }
    
    .order-date i {
        margin-right: 6px;
        font-size: 0.8rem;
    }
    
    .order-items-section h4 {
        font-size: 0.95rem;
        margin-bottom: 8px;
        color: #333;
        font-weight: 600;
    }
    
    .order-item {
        flex-direction: row;
        gap: 12px;
        padding: 10px;
        border-radius: 6px;
        background: #f8f9fa;
        border-left: 3px solid #667eea;
    }
    
    .item-image {
        width: 60px;
        height: 60px;
        border-radius: 4px;
        flex-shrink: 0;
    }
    
    .item-details {
        flex: 1;
    }
    
    .item-name {
        font-size: 0.9rem;
        margin-bottom: 6px;
        font-weight: 600;
        color: #333;
        line-height: 1.3;
    }
    
    .item-info {
        gap: 2px;
    }
    
    .item-sku, .item-size, .item-status {
        font-size: 0.8rem;
        color: #666;
        line-height: 1.2;
    }
    
    .item-sku strong, .item-size strong, .item-status strong {
        color: #555;
        margin-right: 4px;
    }
    
    .order-actions {
        flex-direction: column;
        gap: 8px;
        margin-top: 12px;
    }
    
    .order-actions .btn-secondary,
    .order-actions .btn-primary {
        padding: 10px 15px;
        font-size: 0.85rem;
        min-width: auto;
        min-height: 44px; /* Minimum touch target size */
        border-radius: 6px;
    }
    
    /* Modal Responsive */
    .modal {
        padding: 20px 0;
        align-items: center;
        justify-content: center;
    }
    
    .modal-content {
        width: 95%;
        max-height: 90vh;
        margin: 0;
        border-radius: 8px;
        transform: none;
    }
    
    .modal-header {
        padding: 15px 20px;
        border-radius: 8px 8px 0 0;
    }
    
    .modal-header h2 {
        font-size: 1.2rem;
    }
    
    .modal-body {
        padding: 10px !important;
    }
    
    /* Invoice Responsive */
    .invoice-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .invoice-header h1 {
        font-size: 1.3rem;
    }
    
    .company-name {
        font-size: 1.3rem;
        margin: 0;
    }
    
    .invoice-info {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
        margin-bottom: 20px !important;
    }
    
    .items-table {
        margin: 15px 0 !important;
    }
    
    .items-table table {
        min-width: 500px;
    }
    
    .info-section h3 {
        font-size: 1rem !important;
    }
    
    .items-table th,
    .items-table td {
        padding: 8px 10px;
        font-size: 0.8rem;
    }
    
    .cost-summary {
        margin: 20px 0;
        padding: 15px;
    }
    
    .summary-item {
        font-size: 0.9rem;
        padding: 6px 0;
    }
    
    .summary-item.total {
        font-size: 1rem;
        padding-top: 10px;
    }
    
    /* Tracking Responsive */
    .tracking-header h2 {
        font-size: 1.3rem;
        flex-direction: column;
        gap: 5px;
    }
    
    .tracking-info {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .tracking-info h3 {
        font-size: 1.1rem;
        margin-bottom: 10px;
    }
    
    .tracking-details {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .tracking-details .info-item {
        padding: 12px;
    }
    
    .tracking-timeline {
        padding-left: 20px;
    }
    
    .timeline-event {
        margin-bottom: 20px;
        padding-left: 15px;
    }
    
    .event-content {
        padding: 12px 15px;
    }
    
    .event-status {
        font-size: 0.95rem;
        margin-bottom: 6px;
    }
    
    .event-location {
        font-size: 0.85rem;
        margin-bottom: 3px;
    }
    
    .event-time {
        font-size: 0.8rem;
    }
    
    /* Loading Overlay */
    .loading-spinner i {
        font-size: 2rem;
        margin-bottom: 15px;
    }
    
    .loading-spinner p {
        font-size: 1rem;
    }
    
    /* Error Message */
    .error-message {
        padding: 12px 15px;
        font-size: 0.9rem;
        margin-top: 15px;
        border-radius: 6px;
    }
    
    /* Success Message */
    .success-message {
        padding: 12px 15px;
        font-size: 0.9rem;
        margin-top: 15px;
        border-radius: 6px;
    }
}

/* Extra Small Devices */
@media (max-width: 480px) {
    body {
        padding: 0;
    }
    
    .header {
        padding: 12px 15px;
    }
    
    .header h1 {
        font-size: 1.2rem;
    }
    
    .header p {
        font-size: 0.8rem;
    }
    
    .search-section, .orders-section {
        padding: 0;
    }
    
    .tracking-form {
        padding: 12px 15px;
    }
    
    .order-card {
        padding: 12px;
        border-radius: 6px;
    }
    
    .order-header h3 {
        font-size: 1rem;
    }
    
    .order-date {
        font-size: 0.8rem;
    }
    
    .order-items-section h4 {
        font-size: 0.9rem;
    }
    
    .order-item {
        padding: 8px;
        gap: 10px;
    }
    
    .item-image {
        width: 50px;
        height: 50px;
    }
    
    .item-name {
        font-size: 0.85rem;
    }
    
    .item-sku, .item-size, .item-status {
        font-size: 0.75rem;
    }
    
    .modal-content {
        width: 98%;
        margin: 5px;
    }
    
    .modal-header {
        padding: 12px 15px;
    }
    
    .modal-body {
        padding: 15px 10px;
    }
    
    .form-group input {
        padding: 10px 12px;
        font-size: 16px;
    }
    
    .btn-primary, .btn-secondary {
        padding: 10px 15px;
        font-size: 0.85rem;
    }
    
    .order-actions .btn-secondary,
    .order-actions .btn-primary {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .modal-content {
        max-height: 90vh;
    }
    
    .modal-body {
        max-height: 70vh;
        overflow-y: auto;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .order-card:hover {
        transform: none;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    }
    
    .btn-primary:hover,
    .btn-secondary:hover {
        transform: none;
    }
    
    .order-card:active {
        transform: scale(0.98);
    }
    
    .btn-primary:active,
    .btn-secondary:active {
        transform: scale(0.95);
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .item-image img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Iframe-specific scrolling fixes */
iframe {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
}

/* Modal body scroll prevention */
body.modal-open {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
}

/* Ensure modal covers full screen */
.modal {
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

/* Ensure proper scrolling in iframe context */
body.iframe-body {
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    height: auto;
    min-height: 100vh;
}

/* Fix for mobile iframe scrolling issues */
@media (max-width: 768px) {
    body.iframe-body .container {
        height: auto;
        min-height: 100vh;
        overflow-y: visible;
    }
    
    body.iframe-body .orders-section {
        height: auto;
        min-height: 100vh;
        overflow-y: visible;
    }
    
    body.iframe-body #orders-list {
        height: auto;
        overflow-y: visible;
        padding-bottom: 30px;
    }
}

/* Mobile-specific improvements */
@media (max-width: 768px) {
    /* Remove hover effects on touch devices */
    .order-card:hover {
        transform: none;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .btn-primary:hover,
    .btn-secondary:hover {
        transform: none;
    }
    
    /* Add active states for touch feedback */
    .order-card:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
    
    .btn-primary:active,
    .btn-secondary:active {
        transform: scale(0.95);
        transition: transform 0.1s ease;
    }
    
    /* Improve text readability */
    .item-name {
        word-wrap: break-word;
        hyphens: auto;
    }
    
    /* Better spacing for touch targets */
    .order-actions {
        margin-top: 15px;
    }
    
    /* Ensure proper scrolling */
    .modal-body {
        -webkit-overflow-scrolling: touch;
        overflow-y: auto;
        max-height: 70vh;
    }
    
    /* Fix iframe scrolling issues */
    .orders-section {
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        height: auto;
        min-height: 100vh;
    }
    
    /* Ensure orders container can scroll */
    #orders-list {
        overflow-x: hidden;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 20px;
    }
    
    /* Fix iOS input zoom */
    .form-group input[type="email"],
    .form-group input[type="text"] {
        font-size: 16px;
        transform: translateZ(0);
    }
    
    /* Better button spacing */
    .btn-primary + .btn-secondary,
    .btn-secondary + .btn-primary {
        margin-top: 8px;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success Message */
.success-message {
    background: #d4edda;
    color: #155724;
    padding: 15px 20px;
    border-radius: 10px;
    margin-top: 20px;
    border: 1px solid #c3e6cb;
}

.success-message i {
    margin-right: 8px;
}

/* Order Details Page Styles */
.order-details-page {
    padding: 40px;
}

.order-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.summary-card {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    border: 1px solid #e1e5e9;
}

.summary-card h2 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.3rem;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.summary-card h2 i {
    margin-right: 10px;
    color: #667eea;
}

.info-grid {
    display: grid;
    gap: 15px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-item.full-width {
    flex-direction: column;
    align-items: flex-start;
}

.info-item label {
    font-weight: 600;
    color: #555;
    min-width: 120px;
}

.info-item span {
    color: #333;
    text-align: right;
}

.total-amount {
    font-size: 1.2rem;
    font-weight: 700;
    color: #28a745 !important;
}

/* Order Items Table */
.order-items {
    margin-bottom: 40px;
}

.order-items h2 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.5rem;
}

.order-items h2 i {
    margin-right: 10px;
    color: #667eea;
}

.items-table {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.items-table table {
    width: 100%;
    border-collapse: collapse;
}

.items-table th {
    background: #667eea;
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

.items-table td {
    padding: 15px;
    border-bottom: 1px solid #e1e5e9;
}

.items-table tr:hover {
    background: #f8f9fa;
}

.total-row {
    background: #f8f9fa;
    font-weight: 700;
}

.total-row td {
    border-bottom: none;
}

/* Timeline Styles */
.status-history {
    margin-bottom: 40px;
}

.status-history h2 {
    margin-bottom: 30px;
    color: #333;
    font-size: 1.5rem;
}

.status-history h2 i {
    margin-right: 10px;
    color: #667eea;
}

.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e1e5e9;
}

.timeline-item {
    position: relative;
    margin-bottom: 30px;
}

.timeline-marker {
    position: absolute;
    left: -22px;
    top: 5px;
    width: 12px;
    height: 12px;
    background: #667eea;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 0 3px #667eea;
}

.timeline-content {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid #e1e5e9;
}

.timeline-content h4 {
    margin-bottom: 5px;
    color: #333;
    font-size: 1.1rem;
}

.timeline-date {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.timeline-notes {
    color: #555;
    font-style: italic;
}

/* Progress Tracking Styles */
.tracking-page {
    padding: 40px;
}

.tracking-summary {
    margin-bottom: 40px;
}

.progress-section {
    margin-bottom: 40px;
}

.progress-section h2 {
    margin-bottom: 30px;
    color: #333;
    font-size: 1.5rem;
}

.progress-section h2 i {
    margin-right: 10px;
    color: #667eea;
}

.progress-bar-container {
    margin-bottom: 40px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e1e5e9;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
}

.progress-percentage {
    text-align: center;
    font-weight: 600;
    color: #667eea;
    font-size: 1.1rem;
}

.status-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.step {
    display: flex;
    align-items: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
    border: 2px solid #e1e5e9;
    transition: all 0.3s ease;
}

.step.completed {
    background: #d4edda;
    border-color: #28a745;
}

.step-icon {
    width: 50px;
    height: 50px;
    background: #e1e5e9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    transition: all 0.3s ease;
}

.step.completed .step-icon {
    background: #28a745;
    color: white;
}

.step-icon i {
    font-size: 1.2rem;
}

.step-content h4 {
    margin-bottom: 5px;
    color: #333;
    font-size: 1rem;
}

.step-content p {
    color: #666;
    font-size: 0.9rem;
    margin: 0;
}

/* Responsive Updates */
@media (max-width: 768px) {
    .order-summary {
        grid-template-columns: 1fr;
    }
    
    .info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .info-item label {
        min-width: auto;
    }
    
    .items-table {
        overflow-x: auto;
    }
    
    .items-table table {
        min-width: 600px;
    }
    
    .status-steps {
        grid-template-columns: 1fr;
    }
    
    .step {
        flex-direction: column;
        text-align: center;
    }
    
    .step-icon {
        margin-right: 0;
        margin-bottom: 10px;
    }
}

/* Search Section */
.search-section {
    padding: 15px;
}

/* Orders Section */
.orders-section {
    padding: 10px;
}

.orders-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 20px 0;
}

.modal-content {
    background: white;
    border-radius: 15px;
    max-width: 800px;
    width: 98%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    margin-top: 0;
    margin-bottom: 20px;
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.modal-header h2 i {
    margin-right: 10px;
    color: #ffd700;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 30px;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.loading-spinner {
    text-align: center;
    color: #667eea;
}

.loading-spinner i {
    font-size: 3rem;
    margin-bottom: 20px;
}

.loading-spinner p {
    font-size: 1.2rem;
    font-weight: 500;
}

/* Order Card Styles */
.order-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

.order-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.order-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.3rem;
}

.order-status {
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
}

.status-shipped {
    background: #d4edda;
    color: #155724;
}

.status-processing {
    background: #cce5ff;
    color: #004085;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-delivered {
    background: #d1ecf1;
    color: #0c5460;
}

.order-date {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
    color: #666;
}

.order-date i {
    width: 20px;
    margin-right: 10px;
    color: #667eea;
}

.order-items-section {
    margin-bottom: 20px;
}

.order-items-section h4 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.1rem;
    font-weight: 600;
}

.order-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.item-image {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.placeholder-image {
    color: #adb5bd;
    font-size: 2rem;
}

.item-details {
    flex: 1;
}

.item-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    font-size: 1rem;
    line-height: 1.3;
}

.item-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.item-sku,
.item-size,
.item-status {
    font-size: 0.9rem;
    color: #666;
}

.item-sku strong,
.item-size strong,
.item-status strong {
    color: #495057;
    margin-right: 5px;
}

.order-details {
    margin-bottom: 20px;
}

.detail-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    color: #666;
}

.detail-row i {
    width: 20px;
    margin-right: 10px;
    color: #667eea;
}

.order-actions {
    display: flex;
    gap: 0px;
    flex-wrap: wrap;
}

.order-actions .btn-secondary,
.order-actions .btn-primary {
    flex: 1;
    min-width: 120px;
    text-align: center;
    padding: 10px 15px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.order-actions .btn-secondary {
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
}

.order-actions .btn-secondary:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.order-actions .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.order-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Invoice Content Styles - Updated to match screenshot */
.invoice-content {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    max-width: 800px;
    margin: 0 auto;
}

.invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.invoice-header h1 {
    color: #333;
    margin: 0;
    font-size: 1.8rem;
    font-weight: bold;
}

.company-name {
    font-size: 1.8rem;
    font-weight: bold;
    color: #333;
    text-align: center;
    flex: 1;
    margin: 0 20px;
}

.invoice-header .modal-close {
    background: #f8f9fa;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    color: #666;
}

.invoice-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.info-section h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.1rem;
    font-weight: bold;
    border-bottom: none;
    padding-bottom: 0;
}

.info-item {
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.info-item strong {
    color: #333;
    font-weight: bold;
    display: block;
    margin-bottom: 2px;
}

.info-item:not(:last-child) {
    margin-bottom: 8px;
}

.items-table {
    margin: 30px 0;
    overflow-x: auto;
}

.items-table h4 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.1rem;
    font-weight: bold;
    padding: 5px;
}

.items-table table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.items-table th {
    background: #f8f9fa;
    color: #333;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    border-bottom: 1px solid #e0e0e0;
}

.items-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9rem;
}

.items-table tr:hover {
    background: #f8f9fa;
}

.items-table tr:last-child td {
    border-bottom: none;
}

/* Cost Summary Styles - Updated to match screenshot */
.cost-summary {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.95rem;
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-item.total {
    font-weight: bold;
    font-size: 1.1rem;
    color: #333;
    padding-top: 12px;
    border-top: 2px solid #667eea;
    margin-top: 8px;
}

.summary-item span:first-child {
    color: #495057;
}

.summary-item span:last-child {
    color: #333;
    font-weight: 500;
}

.summary-item.total span:last-child {
    font-weight: bold;
    color: #333;
    font-size: 1.1rem;
}

/* Specific colors for different summary items */
.summary-item:nth-child(2) span:last-child {
    color: #28a745; /* Green for free shipping */
}

.summary-item:nth-child(3) span:last-child {
    color: #dc3545; /* Red for discount */
}

/* Invoice Footer */
.invoice-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
}

.invoice-footer p {
    font-style: italic;
    color: #666;
    font-size: 1rem;
}


/* Tracking Modal Styles - Updated to match screenshot */
.tracking-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.tracking-header h2 {
    color: #333;
    margin: 0;
    font-size: 1.8rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.tracking-header h2 i {
    color: #667eea;
    font-size: 1.5rem;
}

.tracking-timeline {
    position: relative;
    padding-left: 30px;
}

.tracking-timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #667eea;
    border-radius: 2px;
}

.timeline-event {
    position: relative;
    margin-bottom: 25px;
    padding-left: 20px;
}

.timeline-event::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 8px;
    width: 12px;
    height: 12px;
    background: #667eea;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 0 2px #667eea;
}

.event-content {
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #667eea;
}

.event-status {
    font-weight: bold;
    color: #333;
    font-size: 1rem;
    margin-bottom: 8px;
    line-height: 1.4;
}

.event-location {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.event-time {
    color: #888;
    font-size: 0.85rem;
    font-family: 'Courier New', monospace;
}

.no-tracking {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.no-tracking p {
    font-size: 1.1rem;
    margin: 0;
}

/* Tracking Content Styles */
.tracking-content {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.tracking-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.tracking-info h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.tracking-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.tracking-details .info-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.tracking-details .info-item strong {
    display: block;
    color: #555;
    margin-bottom: 5px;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.tracking-details .info-item span {
    color: #333;
    font-weight: 500;
}

.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #667eea;
}

.timeline-item {
    position: relative;
    margin-bottom: 30px;
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-left: 20px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -25px;
    top: 25px;
    width: 12px;
    height: 12px;
    background: #667eea;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 0 0 3px #667eea;
}

.timeline-content h4 {
    color: #333;
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.timeline-date {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.timeline-notes {
    color: #555;
    font-size: 0.95rem;
    line-height: 1.4;
}

.timeline-notes i {
    color: #667eea;
    margin-right: 5px;
}
