/**
 * Frontend Styles for Corporate Spec Tools
 */

/* Tracking Wrapper */
.cst-tracking-wrapper {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

/* Back Link */
.cst-back-link {
    margin-bottom: 20px;
}

.cst-back-link a {
    color: #0073aa;
    text-decoration: none;
    font-size: 14px;
}

.cst-back-link a:hover {
    text-decoration: underline;
}

/* Order Header */
.cst-order-header {
    background: #f7f7f7;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #e5e5e5;
}

.cst-order-header h2 {
    margin: 0 0 15px;
    font-size: 24px;
    color: #333;
}

.cst-order-meta p {
    margin: 5px 0;
    font-size: 14px;
}

.cst-order-meta strong {
    color: #555;
}

/* Priority Badge */
.cst-priority {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.cst-priority-high {
    background: #f8d7da;
    color: #721c24;
}

.cst-priority-medium {
    background: #fff3cd;
    color: #856404;
}

.cst-priority-low {
    background: #d1ecf1;
    color: #0c5460;
}

/* Order Notes */
.cst-order-notes {
    background: #fff9e6;
    border-left: 4px solid #ffc107;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

/* Simplified Status View */
.cst-simplified-status {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 20px;
}

.cst-status-message {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: #f0f8ff;
    border-radius: 8px;
    margin-bottom: 25px;
}

.cst-status-icon {
    font-size: 48px;
    line-height: 1;
}

.cst-status-message p {
    margin: 0;
    font-size: 16px;
    color: #333;
}

/* Progress Section */
.cst-progress-section {
    margin: 25px 0;
    padding: 20px;
    background: #fafafa;
    border-radius: 8px;
}

.cst-progress-text {
    font-size: 14px;
    font-weight: 600;
    color: #555;
    margin-bottom: 10px;
}

.cst-progress-bar-container {
    width: 100%;
    height: 30px;
    background: #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
}

.cst-progress-bar-fill {
    height: 100%;
    background: #46b450;
    border-radius: 15px;
    transition: width 0.8s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    position: relative;
}

.cst-progress-percentage {
    font-size: 12px;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* Delivery Information */
.cst-delivery-info,
.cst-no-delivery {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.cst-delivery-info h3 {
    margin: 0 0 15px;
    font-size: 18px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cst-delivery-estimate,
.cst-driver-info,
.cst-route-info {
    margin: 10px 0;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.cst-delivery-estimate:last-child,
.cst-driver-info:last-child,
.cst-route-info:last-child {
    border-bottom: none;
}

.cst-route-position {
    margin-top: 10px;
    font-size: 13px;
    color: #666;
}

.cst-no-delivery {
    text-align: center;
    padding: 30px 20px;
}

.cst-no-delivery p {
    margin: 10px 0;
    color: #666;
}

/* Detailed Status View */
.cst-detailed-status {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 25px;
}

.cst-detailed-status h3 {
    margin: 0 0 20px;
    font-size: 18px;
    color: #333;
}

/* Task List */
.cst-tasks-list {
    margin-bottom: 25px;
}

.cst-task-item {
    background: #fafafa;
    border: 2px solid #e5e5e5;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.cst-task-item:last-child {
    margin-bottom: 0;
}

.cst-task-completed {
    background: #f0f9f0;
    border-color: #46b450;
}

.cst-task-in-progress {
    background: #fff9e6;
    border-color: #ffc107;
}

.cst-task-pending {
    background: #f7f7f7;
    border-color: #ddd;
}

.cst-task-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.cst-task-icon {
    font-size: 24px;
    line-height: 1;
}

.cst-task-type {
    flex: 1;
    font-size: 16px;
    color: #333;
}

.cst-task-status {
    font-size: 13px;
    padding: 3px 10px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #ddd;
    font-weight: 500;
}

.cst-task-completed .cst-task-status {
    background: #46b450;
    color: #fff;
    border-color: #46b450;
}

.cst-task-in-progress .cst-task-status {
    background: #ffc107;
    color: #000;
    border-color: #ffc107;
}

.cst-task-assigned,
.cst-task-time {
    font-size: 13px;
    color: #666;
    margin: 5px 0;
}

/* Order Items */
.cst-order-items {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.cst-order-items h3 {
    margin: 0 0 15px;
    font-size: 18px;
    color: #333;
}

.cst-order-items ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cst-order-items li {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.cst-order-items li:last-child {
    border-bottom: none;
}

/* No Tracking Available */
.cst-no-tracking {
    text-align: center;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 40px 20px;
}

.cst-no-tracking-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.cst-no-tracking h2 {
    color: #333;
    margin-bottom: 15px;
}

.cst-no-tracking p {
    color: #666;
    margin: 10px 0;
}

.cst-no-tracking ul {
    text-align: left;
    display: inline-block;
    margin: 20px 0;
}

.cst-no-tracking li {
    margin: 8px 0;
    color: #666;
}

.cst-order-basic-info {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #e5e5e5;
}

.cst-order-basic-info h3 {
    margin: 0 0 15px;
}

.cst-order-basic-info p {
    margin: 8px 0;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .cst-tracking-wrapper {
        padding: 15px;
    }

    .cst-order-header h2 {
        font-size: 20px;
    }

    .cst-status-message {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .cst-status-icon {
        font-size: 36px;
    }

    .cst-task-header {
        flex-wrap: wrap;
    }

    .cst-task-type {
        flex-basis: 100%;
        margin-top: 5px;
    }

    .cst-progress-bar-container {
        height: 25px;
    }

    .cst-progress-percentage {
        font-size: 11px;
    }
}

@media screen and (max-width: 480px) {
    .cst-order-header,
    .cst-simplified-status,
    .cst-detailed-status {
        padding: 15px;
    }

    .cst-status-message {
        padding: 15px;
    }

    .cst-task-item {
        padding: 12px;
    }

    .cst-no-tracking {
        padding: 30px 15px;
    }

    .cst-no-tracking-icon {
        font-size: 48px;
    }
}

/* Loading State */
.cst-loading {
    text-align: center;
    padding: 40px;
}

.cst-loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    animation: cst-spin 1s linear infinite;
}

@keyframes cst-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
