/* User Dashboard Styles */
.bot-user-dashboard {
    padding: 24px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    max-width: 1120px;
    margin: 0 auto;
}

/* Error Styles */
.bot-error, .batch-error {
    background: #fef2f2;
    color: #dc2626;
    padding: 12px;
    border-radius: 4px;
    margin: 16px 0;
    border-left: 3px solid #dc2626;
}

.error-message {
    color: #dc2626;
}

/* Dashboard Header */
.bot-dashboard-header {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
}

.bot-section-title {
    font-size: 18px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 16px;
}

/* Simple inline notice styles */
.bot-notice {
    padding: 10px 12px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}

.bot-notice-success {
    background: #ecfdf3;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.bot-notice-warning {
    background: #fffbeb;
    color: #854d0e;
    border: 1px solid #facc15;
}

.bot-stat-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 16px;
    text-align: center;
    margin-bottom: 12px;
}

/* Tables */
.bot-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
}

/* Shipments mobile cards – hidden by default (shown on small screens) */
.bot-shipment-card-list {
    display: none;
}

.bot-shipment-card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    padding: 14px 14px 12px;
}

.bot-shipment-card-header {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.bot-shipment-card-title {
    font-size: 14px;
    font-weight: 500;
    color: #111827;
}

.bot-shipment-card-batch {
    font-size: 12px;
    color: #4b5563;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.bot-shipment-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    margin-bottom: 6px;
}

.bot-shipment-card-meta-item span {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
}

.bot-shipment-card-meta-item strong {
    display: block;
    margin-top: 1px;
    color: #111827;
}

.bot-shipment-card-status {
    border-radius: 999px;
    padding-inline: 8px;
}

.bot-shipment-card-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 4px;
    font-size: 12px;
    border-top: 1px solid #e5e7eb;
    padding-top: 6px;
}

.bot-shipment-card-footer-item span {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
}

.bot-shipment-card-footer-item strong {
    display: block;
    margin-top: 1px;
}

.bot-shipment-card-empty {
    text-align: center;
    color: #6b7280;
}

.bot-table th {
    background: #f9fafb;
    padding: 12px;
    text-align: left;
    font-weight: 500;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
}

.bot-table td {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
    color: #374151;
}

/* Tracking page layout */
.bot-tracking-dashboard {
    background: #f9fafb;
}

.bot-tracking-hero {
    margin-bottom: 24px;
}

.bot-tracking-card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    padding: 24px 24px 20px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
}

.bot-tracking-card-header {
    margin-bottom: 16px;
}

.bot-tracking-title {
    margin: 0 0 4px 0;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: #111827;
}

.bot-tracking-subtitle {
    margin: 0;
    font-size: 14px;
    color: #4b5563;
}

.bot-tracking-subtitle span {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
}

.bot-tracking-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 10px;
}

.bot-tracking-input {
    flex: 1 1 260px;
    min-width: 0;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    font-size: 14px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
    background: #ffffff;
}

.bot-tracking-input:focus {
    outline: none;
    border-color: #2563eb;
    background: #ffffff;
    box-shadow: 0 0 0 1px #2563eb33;
}

.bot-tracking-submit {
    white-space: nowrap;
    padding-inline: 18px;
}

.bot-tracking-result {
    margin-top: 16px;
    font-size: 14px;
}

/* Tracking result card */
.bot-tracking-result-card {
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    padding: 16px 16px 14px;
}

.bot-tracking-result-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.bot-tracking-result-id {
    min-width: 0;
}

.bot-tracking-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    margin-bottom: 2px;
}

.bot-tracking-code {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.bot-tracking-batch-label {
    font-size: 13px;
    color: #4b5563;
}

.bot-tracking-result-status {
    text-align: right;
    min-width: 160px;
}

.bot-tracking-status-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b7280;
    margin-bottom: 4px;
}

.bot-status-chip {
    border-radius: 999px;
    padding-inline: 10px;
}

.bot-tracking-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    color: #374151;
    margin-bottom: 6px;
}

.bot-tracking-meta-item {
    min-width: 120px;
}

.bot-tracking-meta-item span {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
}

.bot-tracking-meta-item strong {
    display: block;
    margin-top: 2px;
}

.bot-tracking-timeline-wrapper {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e5e7eb;
}

.bot-tracking-timeline-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    color: #111827;
}

.bot-tracking-timeline {
    position: relative;
    padding-left: 16px;
}

.bot-tracking-timeline::before {
    content: "";
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 4px;
    width: 2px;
    background: linear-gradient(to bottom, #bfdbfe, #e5e7eb);
}

.bot-tracking-timeline-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 10px;
}

.bot-tracking-timeline-dot {
    margin-right: 8px;
    margin-top: 4px;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #2563eb;
    box-shadow: 0 0 0 2px #bfdbfe;
}

.bot-tracking-timeline-content {
    font-size: 12px;
}

.bot-tracking-timeline-status {
    font-weight: 500;
    color: #111827;
}

.bot-tracking-timeline-location {
    color: #4b5563;
}

.bot-tracking-timeline-date {
    color: #6b7280;
}

.bot-tracking-timeline-note {
    margin-top: 2px;
    color: #4b5563;
}

.bot-tracking-timeline-empty {
    margin-top: 10px;
    font-size: 13px;
    color: #6b7280;
}

/* Shipments table section on tracking page */
.bot-shipments-section {
    margin-top: 8px;
}

.bot-show-more-container {
    text-align: center;
    padding: 16px 0 10px;
}

.bot-show-more-btn {
    background: #111827;
    color: #f9fafb;
    border-radius: 999px;
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 500;
}

.bot-show-more-btn:hover {
    background: #020617;
}

/* Form Elements */
.bot-search-box, .bot-filter-select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 14px;
    width: 100%;
    max-width: 300px;
}

/* Buttons */
.bot-btn {
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    border: none;
    font-weight: 500;
}

.bot-btn-primary {
    background: #3b82f6;
    color: #fff;
}

.bot-btn-secondary {
    background: #fff;
    color: #374151;
    border: 1px solid #d1d5db;
}

/* Status Badges */
.bot-status {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.bot-status-processing {
    background: #fef3c7;
    color: #92400e;
}

.bot-status-shipped {
    background: #d1fae5;
    color: #065f46;
}

.bot-status-delivered {
    background: #dbeafe;
    color: #1e40af;
}

 .bot-status-delayed {
    background: #fee2e2;
    color: #991b1b;
}
.bot-status-partial-delivery {
    background: #e0f2fe;
    color: #0369a1;
}

/* Modal */
.bot-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;
}

.bot-modal-content {
    background: #fff;
    border-radius: 6px;
    padding: 24px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.bot-modal-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    float: right;
    color: #6b7280;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .bot-user-dashboard {
        padding: 12px;
    }
    
    .bot-dashboard-header {
        padding: 16px;
    }
    
    .bot-table {
        font-size: 14px;
    }
    
    .bot-search-box, .bot-filter-select {
        max-width: 100%;
        margin-bottom: 8px;
    }
}

/* Loading Spinner */
.bot-loading {
    text-align: center;
    padding: 20px;
}

.bot-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f4f6;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Modal Styles */
.bot-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: 999999;
}

.bot-modal-content {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.bot-modal-title {
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.bot-modal-close {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    font-size: 24px;
    padding: 4px;
}

.bot-modal-close:hover {
    color: #475569;
}

/* Tracking: responsive tweaks */
@media screen and (max-width: 768px) {
    .bot-tracking-result-status {
        text-align: left;
    }

    .bot-tracking-card {
        padding: 18px 16px 16px;
    }

    .bot-tracking-form {
        flex-direction: column;
        align-items: stretch;
    }

    .bot-tracking-submit {
        width: 100%;
    }

    /* On small screens, show both table and cards (table scrolls horizontally) */
    .bot-shipment-card-list {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin-top: 8px;
    }
}

/* Notifications */
.bot-notification {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 16px 24px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.bot-notification-success {
    border-left: 4px solid #15803d;
}

.bot-notification-error {
    border-left: 4px solid #dc2626;
}

.bot-notification-message {
    color: #1e293b;
    margin: 0;
}

/* Loading States */
.bot-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.bot-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
