/* General Container */
.stbf-tracker-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    max-width: 600px;
    margin: 40px auto;
    padding: 24px;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
}

.stbf-tracker-header {
    text-align: center;
    margin-bottom: 24px;
}

.stbf-tracker-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 8px;
}

.stbf-tracker-header p {
    font-size: 16px;
    color: #6b7280;
    margin: 0;
}

/* Form Styling */
.stbf-track-form .stbf-input-group {
    display: flex;
    align-items: center;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 4px;
    transition: box-shadow 0.2s ease-in-out;
}

.stbf-track-form .stbf-input-group:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.stbf-icon-box {
    color: #6b7280;
    margin: 0 8px 0 12px;
}

.stbf-track-form input[type="text"] {
    flex-grow: 1;
    border: none;
    outline: none;
    padding: 12px 0;
    font-size: 16px;
    background: transparent;
    color: #111827;
}

.stbf-track-form input[type="text"]::placeholder {
    color: #9ca3af;
}

#stbf-track-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #3b82f6;
    color: #ffffff;
    font-size: 16px;
    font-weight: 500;
    border: none;
    border-radius: 6px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin-left: 8px;
}

#stbf-track-btn:hover {
    background-color: #2563eb;
}

#stbf-track-btn .stbf-arrow-icon {
    width: 20px;
    height: 20px;
    margin-left: 8px;
    transition: transform 0.2s ease;
}

#stbf-track-btn:hover .stbf-arrow-icon {
    transform: translateX(3px);
}

/* Alert/Error Styling */
.stbf-alert {
    padding: 12px;
    margin-top: 16px;
    border-radius: 6px;
    font-size: 14px;
    text-align: center;
}

.stbf-alert-danger {
    background-color: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.stbf-hidden {
    display: none;
}

/* Modal Styles */
.stbf-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.stbf-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.stbf-modal-container {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.stbf-modal-overlay.active .stbf-modal-container {
    transform: scale(1);
}

.stbf-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.stbf-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.stbf-btn-close {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
}

.stbf-modal-body {
    padding: 24px;
}

.stbf-waybill-actions {
    margin-bottom: 20px;
    text-align: right;
}

.stbf-btn-blue {
    background-color: #3b82f6;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    transition: background-color 0.2s ease;
}

.stbf-btn-blue:hover {
    background-color: #2563eb;
}

/* Modern Timeline/Waybill Styles */
.stbf-modern-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #333;
}

.stbf-modern-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 24px;
}

.stbf-modern-header h2 {
    font-size: 22px;
    font-weight: 600;
    margin: 0;
}

.stbf-ref-id {
    font-size: 14px;
    color: #6b7280;
}
.stbf-ref-id span {
    font-weight: 500;
    color: #111827;
}

.stbf-modern-body .stbf-modern-row {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.stbf-modern-row .stbf-row-label {
    font-weight: 500;
    color: #6b7280;
    font-size: 14px;
}

.stbf-route-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f9fafb;
    padding: 16px;
    border-radius: 8px;
}
.stbf-route-point {
    text-align: center;
}
.stbf-route-title {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 4px;
}
.stbf-route-location {
    font-size: 16px;
    font-weight: 600;
}
.stbf-route-plane {
    color: #3b82f6;
}

.stbf-milestones-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.stbf-milestone-card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
}
.stbf-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}
.stbf-card-header svg {
    width: 20px;
    height: 20px;
    color: #9ca3af;
}
.stbf-milestone-card.status-pending .stbf-card-header svg { color: #f59e0b; }
.stbf-milestone-card.shipping-date .stbf-card-header svg { color: #3b82f6; }
.stbf-milestone-card.expected-delivery .stbf-card-header svg { color: #10b981; }

.stbf-card-body {
    font-size: 16px;
    font-weight: 600;
}

.stbf-modern-row ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.stbf-modern-row li {
    background: #f9fafb;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 14px;
}

/* History Timeline */
.stbf-history-timeline {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}
.stbf-history-timeline h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}
.stbf-history-timeline ul {
    list-style: none;
    padding: 0;
    margin: 0;
    position: relative;
}
.stbf-history-timeline ul::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 5px;
    bottom: 5px;
    width: 2px;
    background-color: #e5e7eb;
}
.stbf-history-timeline li {
    position: relative;
    padding-left: 30px;
    margin-bottom: 20px;
}
.stbf-history-timeline li::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 5px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: #d1d5db;
    border: 2px solid #fff;
}
.stbf-history-timeline li:first-child::before {
    background-color: #3b82f6;
    transform: scale(1.1);
}
.stbf-history-timeline .stbf-time {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 4px;
}
.stbf-history-timeline .stbf-status {
    font-weight: 600;
    color: #111827;
}
.stbf-history-timeline .stbf-location,
.stbf-history-timeline .stbf-notes {
    font-size: 14px;
    color: #4b5563;
    margin-top: 4px;
}

/* Waybill Container and Layout */
.stbf-waybill-container {
    background: white;
    padding: 30px;
    max-width: 900px;
    margin: 0 auto;
    font-family: Arial, sans-serif;
}

.stbf-waybill-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 3px solid #333;
}

.stbf-logo-section {
    flex: 1;
}

.stbf-logo {
    max-width: 200px;
    max-height: 60px;
    height: auto;
}

.stbf-logo-text {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.stbf-tracking-number-section {
    text-align: right;
}

.stbf-tracking-label {
    font-size: 14px;
    font-weight: bold;
    color: #666;
    margin-bottom: 5px;
}

.stbf-tracking-number {
    font-size: 22px;
    font-weight: bold;
    color: #000;
    font-family: monospace;
    letter-spacing: 1px;
}

/* Details Grid */
.stbf-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #ddd;
}

.stbf-detail-box {
    break-inside: avoid;
}

.stbf-box-title {
    font-size: 12px;
    font-weight: bold;
    color: #333;
    background-color: #f0f0f0;
    padding: 8px 12px;
    margin: 0 0 12px 0;
    border-left: 4px solid #0066cc;
}

.stbf-info-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.stbf-info-table tr {
    border-bottom: 1px solid #e0e0e0;
}

.stbf-info-table td {
    padding: 8px;
}

.stbf-info-table .stbf-label {
    font-weight: bold;
    width: 70px;
    background-color: #f9f9f9;
}

.stbf-info-table td:last-child {
    word-wrap: break-word;
}

/* Shipment Information */
.stbf-shipment-info {
    margin-bottom: 30px;
}

.stbf-section-header {
    font-size: 12px;
    font-weight: bold;
    color: #333;
    background-color: #f0f0f0;
    padding: 8px 12px;
    margin: 0 0 12px 0;
    border-left: 4px solid #0066cc;
}

.stbf-shipment-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.stbf-shipment-table tr {
    border-bottom: 1px solid #e0e0e0;
}

.stbf-shipment-table td {
    padding: 10px;
}

.stbf-shipment-table .stbf-field-name {
    font-weight: bold;
    background-color: #f9f9f9;
    width: 20%;
}

.stbf-shipment-table tr:last-child td {
    border-bottom: 2px solid #333;
}

/* Responsive Design */
@media (max-width: 768px) {
    .stbf-waybill-container {
        padding: 15px;
    }
    
    .stbf-waybill-header {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .stbf-tracking-number-section {
        text-align: center;
    }
    
    .stbf-details-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .stbf-info-table,
    .stbf-shipment-table {
        font-size: 12px;
    }
    
    .stbf-info-table td,
    .stbf-shipment-table td {
        padding: 6px;
    }
}

/* Print Styles */
@media print {
    * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }
    
    body {
        background: white;
        font-size: 12pt;
    }
    
    /* Hide non-waybill content */
    .stbf-tracker-container,
    .stbf-tracker-header,
    .stbf-track-form,
    .stbf-waybill-actions,
    .stbf-btn-blue,
    #stbf-track-btn,
    .stbf-waybill-actions,
    .no-print,
    button,
    .stbf-modal-header {
        display: none !important;
    }
    
    /* Waybill container adjustments */
    .stbf-waybill-container {
        width: 100%;
        max-width: 100%;
        padding: 0.5in;
        margin: 0;
        background: white;
        box-shadow: none;
        border: none;
        page-break-after: avoid;
    }
    
    /* Header */
    .stbf-waybill-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        margin-bottom: 0.25in;
        padding-bottom: 0.15in;
        border-bottom: 2pt solid black;
        page-break-inside: avoid;
    }
    
    .stbf-logo-section {
        flex: 1;
    }
    
    .stbf-logo {
        max-width: 2in;
        max-height: 0.8in;
        height: auto;
    }
    
    .stbf-logo-text {
        font-size: 14pt;
        font-weight: bold;
        color: black;
    }
    
    .stbf-tracking-number-section {
        text-align: right;
    }
    
    .stbf-tracking-label {
        font-size: 11pt;
        font-weight: bold;
        color: black;
        margin-bottom: 3pt;
    }
    
    .stbf-tracking-number {
        font-size: 18pt;
        font-weight: bold;
        color: black;
        font-family: monospace;
        letter-spacing: 1pt;
    }
    
    /* Details Grid */
    .stbf-details-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.2in;
        margin-bottom: 0.2in;
        padding-bottom: 0.15in;
        border-bottom: 1.5pt solid #ccc;
        page-break-inside: avoid;
    }
    
    .stbf-detail-box {
        page-break-inside: avoid;
    }
    
    .stbf-box-title {
        font-size: 11pt;
        font-weight: bold;
        color: black;
        background-color: #e0e0e0;
        padding: 6pt 10pt;
        margin: 0 0 10pt 0;
        border-left: 3pt solid #003366;
    }
    
    .stbf-info-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 11pt;
        page-break-inside: avoid;
    }
    
    .stbf-info-table tr {
        border-bottom: 0.5pt solid #ddd;
    }
    
    .stbf-info-table td {
        padding: 6pt 8pt;
        color: black;
    }
    
    .stbf-info-table .stbf-label {
        font-weight: bold;
        background-color: #f5f5f5;
        width: 25%;
    }
    
    .stbf-info-table td:last-child {
        word-wrap: break-word;
    }
    
    /* Shipment Information */
    .stbf-shipment-info {
        margin-bottom: 0.2in;
        page-break-inside: avoid;
    }
    
    .stbf-section-header {
        font-size: 11pt;
        font-weight: bold;
        color: black;
        background-color: #e0e0e0;
        padding: 6pt 10pt;
        margin: 0 0 10pt 0;
        border-left: 3pt solid #003366;
    }
    
    .stbf-shipment-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 11pt;
        page-break-inside: avoid;
    }
    
    .stbf-shipment-table tr {
        border-bottom: 0.5pt solid #ddd;
    }
    
    .stbf-shipment-table td {
        padding: 8pt 10pt;
        color: black;
    }
    
    .stbf-shipment-table .stbf-field-name {
        font-weight: bold;
        background-color: #f5f5f5;
        width: 20%;
    }
    
    .stbf-shipment-table tr:last-child td {
        border-bottom: 2pt solid black;
    }
    
    /* History Timeline */
    .stbf-history-timeline {
        margin-top: 0.2in;
        padding-top: 0.15in;
        border-top: 1.5pt solid #ccc;
        page-break-inside: avoid;
    }
    
    .stbf-history-timeline h3 {
        font-size: 13pt;
        font-weight: bold;
        margin-bottom: 10pt;
        color: black;
    }
    
    .stbf-history-timeline ul {
        list-style: none;
        padding: 0;
        margin: 0;
    }
    
    .stbf-history-timeline li {
        page-break-inside: avoid;
        margin-bottom: 10pt;
        padding-left: 0;
    }
    
    .stbf-history-timeline li::before {
        display: none;
    }
    
    .stbf-history-timeline ul::before {
        display: none;
    }
    
    .stbf-history-timeline .stbf-time {
        font-size: 10pt;
        color: black;
        margin-bottom: 2pt;
        font-weight: bold;
    }
    
    .stbf-history-timeline .stbf-status {
        font-weight: bold;
        color: black;
        font-size: 11pt;
    }
    
    .stbf-history-timeline .stbf-location,
    .stbf-history-timeline .stbf-notes {
        font-size: 10pt;
        color: black;
        margin-top: 2pt;
    }
    
    /* Page settings */
    @page {
        size: letter;
        margin: 0.5in;
    }
    
    /* Hide scrollbars and backgrounds */
    html {
        background: white !important;
    }
    
    body {
        background: white !important;
    }
    
    /* Ensure text is black for better printing */
    p, span, div, td, th, h1, h2, h3, h4, h5, h6 {
        color: black !important;
        background-color: transparent !important;
    }
}

