/**
 * CargoHub Frontend CSS
 * Styles for customer-facing tracking displays
 */

/* Order Tracking Section */
.cargohub-order-tracking {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 25px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.cargohub-order-tracking h2 {
    color: #333;
    font-size: 24px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #007cba;
    display: flex;
    align-items: center;
}

.cargohub-order-tracking h2::before {
    content: "📦";
    margin-right: 10px;
    font-size: 20px;
}

/* Tracking Info Container */
.cargohub-tracking-info {
    background: white;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #dee2e6;
}

.cargohub-carrier-info {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
}

.cargohub-carrier-logo {
    flex-shrink: 0;
}

.cargohub-carrier-logo img {
    max-width: 120px;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.cargohub-carrier-logo img:hover {
    transform: scale(1.05);
}

.cargohub-carrier-details {
    flex: 1;
    min-width: 250px;
}

.cargohub-carrier-details h3 {
    color: #333;
    font-size: 20px;
    margin: 0 0 15px 0;
    font-weight: 600;
}

.cargohub-carrier-details p {
    margin: 10px 0;
    line-height: 1.6;
}

/* Tracking Number Display */
.cargohub-tracking-number {
    font-family: 'Courier New', Consolas, monospace;
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
    background: #f8f9fa;
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    display: inline-block;
    letter-spacing: 1px;
    margin: 5px 0;
}

/* Track Button */
.cargohub-track-button {
    display: inline-block;
    padding: 12px 24px;
    background: linear-gradient(135deg, #007cba 0%, #005a87 100%);
    color: white !important;
    text-decoration: none !important;
    border-radius: 6px;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    margin: 10px 0;
    text-align: center;
    min-width: 150px;
}

.cargohub-track-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    text-decoration: none !important;
    color: white !important;
}

.cargohub-track-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Tracking Date */
.cargohub-tracking-date {
    color: #6c757d;
    font-size: 14px;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #e9ecef;
}

/* Carrier-specific Button Colors */
.carrier-yurtici .cargohub-track-button {
    background: linear-gradient(135deg, #e30613 0%, #b30510 100%);
}

.carrier-aras .cargohub-track-button {
    background: linear-gradient(135deg, #0066cc 0%, #004d99 100%);
}

.carrier-dhl .cargohub-track-button {
    background: linear-gradient(135deg, #ffcc00 0%, #e6b800 100%);
    color: #333 !important;
}

.carrier-dhl .cargohub-track-button:hover {
    color: #333 !important;
}

.carrier-suratkargo .cargohub-track-button {
    background: linear-gradient(135deg, #ff6600 0%, #cc5200 100%);
}

.carrier-ptt .cargohub-track-button,
.carrier-pttkargo .cargohub-track-button,
.carrier-pttgonderi .cargohub-track-button {
    background: linear-gradient(135deg, #003366 0%, #001f3d 100%);
}

/* My Account Orders Page */
.woocommerce-MyAccount-orders .cargohub-track-link {
    background: #007cba;
    color: white !important;
    padding: 6px 12px;
    border-radius: 4px;
    text-decoration: none !important;
    font-size: 12px;
    font-weight: 500;
    display: inline-block;
    margin: 2px;
    transition: background 0.3s ease;
}

.woocommerce-MyAccount-orders .cargohub-track-link:hover {
    background: #005a87;
    color: white !important;
}

/* My Account Orders Table - Carrier Column */
.woocommerce-MyAccount-orders .cargohub-track-btn {
    background: #007cba !important;
    color: white !important;
    padding: 8px 16px !important;
    border-radius: 4px !important;
    text-decoration: none !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    display: inline-block !important;
    margin: 0 !important;
    transition: all 0.3s ease !important;
    border: none !important;
    cursor: pointer !important;
}

.woocommerce-MyAccount-orders .cargohub-track-btn:hover {
    background: #005a87 !important;
    color: white !important;
    transform: translateY(-1px) !important;
}

/* Carrier logo styling in orders table */
.woocommerce-MyAccount-orders .carrier-logo {
    max-width: 40px;
    max-height: 30px;
    border-radius: 3px;
    object-fit: contain;
    margin: 0 auto 5px auto;
}

/* Carrier color blocks for orders without logos */
.woocommerce-MyAccount-orders .carrier-color-block {
    width: 35px;
    height: 25px;
    border-radius: 3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
    font-weight: bold;
    margin: 0 auto 5px auto;
}

/* Tracking code styling */
.woocommerce-MyAccount-orders .tracking-code {
    background: #f0f0f0;
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 12px;
    font-family: monospace;
    display: block;
    margin-bottom: 5px;
    color: #333;
}

.woocommerce-MyAccount-orders .tracking-date {
    font-size: 11px;
    color: #666;
}

/* Responsive design for orders table */
@media (max-width: 768px) {
    .woocommerce-MyAccount-orders .carrier-logo {
        max-width: 30px;
        max-height: 20px;
    }
    
    .woocommerce-MyAccount-orders .carrier-color-block {
        width: 30px;
        height: 20px;
        font-size: 9px;
    }
    
    .woocommerce-MyAccount-orders .tracking-code {
        font-size: 11px;
        padding: 2px 4px;
    }
    
    .woocommerce-MyAccount-orders .cargohub-track-btn {
        padding: 6px 12px !important;
        font-size: 12px !important;
    }
}

/* Email Styles (Inline backup) */
.cargohub-email-tracking {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
    font-family: Arial, sans-serif;
}

.cargohub-email-tracking h3 {
    color: #333;
    margin-bottom: 15px;
}

.cargohub-email-tracking .tracking-number {
    font-family: monospace;
    font-size: 16px;
    font-weight: bold;
    background: white;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #ddd;
    margin: 10px 0;
    display: inline-block;
}

/* Loading Animation */
@keyframes cargohub-pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.cargohub-loading {
    animation: cargohub-pulse 1.5s ease-in-out infinite;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cargohub-carrier-info {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .cargohub-carrier-logo {
        align-self: center;
    }
    
    .cargohub-carrier-details {
        min-width: auto;
    }
    
    .cargohub-track-button {
        display: block;
        width: 100%;
        margin: 15px 0;
    }
    
    .cargohub-tracking-number {
        font-size: 16px;
        display: block;
        text-align: center;
        margin: 10px 0;
    }
    
    .cargohub-order-tracking {
        padding: 15px;
        margin: 15px 0;
    }
    
    .cargohub-order-tracking h2 {
        font-size: 20px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .cargohub-order-tracking h2::before {
        display: block;
        margin: 0 auto 5px auto;
        text-align: center;
    }
    
    .cargohub-tracking-number {
        font-size: 14px;
        word-break: break-all;
    }
    
    .cargohub-carrier-details h3 {
        font-size: 18px;
    }
}

/* Print Styles */
@media print {
    .cargohub-order-tracking {
        background: white !important;
        box-shadow: none !important;
        border: 2px solid #333 !important;
    }
    
    .cargohub-track-button {
        display: none !important;
    }
    
    .cargohub-tracking-info {
        border: 1px solid #333 !important;
        background: white !important;
    }
    
    .cargohub-carrier-logo img {
        max-width: 80px !important;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .cargohub-order-tracking {
        border: 2px solid #000;
        background: #fff;
    }
    
    .cargohub-tracking-info {
        border: 1px solid #000;
        background: #fff;
    }
    
    .cargohub-track-button {
        border: 2px solid #000;
        background: #000 !important;
        color: #fff !important;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .cargohub-carrier-logo img,
    .cargohub-track-button {
        transition: none;
    }
    
    .cargohub-track-button:hover {
        transform: none;
    }
    
    .cargohub-loading {
        animation: none;
        opacity: 0.7;
    }
} 