/**
 * RothCo Order Push & Tracking — Frontend Tracking Styles (v2.1.0)
 *
 * Clean, responsive design for customer-facing order tracking.
 * Brand colors: navy (#1a2744) + orange (#e87722) accent.
 *
 * v2.1.0: Added styles for tracking_number display and tracking section.
 */

/* ═════════════════════════════════════════════════════════════════
   Base & Reset
   ═════════════════════════════════════════════════════════════════ */

.rothco-tracking-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 15px 40px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: #333;
    line-height: 1.6;
}

/* ═════════════════════════════════════════════════════════════════
   Hero Section
   ═════════════════════════════════════════════════════════════════ */

.rothco-tracking-hero {
    background: linear-gradient(135deg, #1a2744 0%, #2d4a7a 100%);
    color: #fff;
    padding: 40px 20px;
    text-align: center;
    border-radius: 8px;
    margin-bottom: 30px;
}

.rothco-tracking-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px;
    color: #fff;
}

.rothco-tracking-subtitle {
    font-size: 16px;
    opacity: 0.85;
    margin: 0;
}

/* ═════════════════════════════════════════════════════════════════
   Form
   ═════════════════════════════════════════════════════════════════ */

.rothco-tracking-form-wrap {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.rothco-tracking-form {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.rothco-form-group {
    flex: 1;
    min-width: 200px;
}

.rothco-form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #1a2744;
    margin-bottom: 6px;
}

.rothco-form-input {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    transition: border-color 0.2s;
    box-sizing: border-box;
    -webkit-box-sizing: border-box;
}

.rothco-form-input:focus {
    outline: none;
    border-color: #e87722;
    box-shadow: 0 0 0 3px rgba(232, 119, 34, 0.15);
}

.rothco-form-input::placeholder {
    color: #aaa;
}

/* ═════════════════════════════════════════════════════════════════
   Buttons
   ═════════════════════════════════════════════════════════════════ */

.rothco-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    white-space: nowrap;
}

.rothco-btn:active {
    transform: scale(0.97);
}

.rothco-btn-primary {
    background: #e87722;
    color: #fff;
}

.rothco-btn-primary:hover {
    background: #d06a1c;
}

.rothco-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.rothco-btn-loader {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* ═════════════════════════════════════════════════════════════════
   Alerts
   ═════════════════════════════════════════════════════════════════ */

.rothco-alert {
    padding: 14px 18px;
    border-radius: 6px;
    margin-top: 15px;
    font-size: 14px;
    line-height: 1.5;
}

.rothco-alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* ═════════════════════════════════════════════════════════════════
   Loading Spinner
   ═════════════════════════════════════════════════════════════════ */

.rothco-tracking-loading {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.rothco-loading-spinner,
.rothco-spinner {
    display: inline-block;
    width: 36px;
    height: 36px;
    border: 3px solid #e0e0e0;
    border-top-color: #e87722;
    border-radius: 50%;
    animation: rothco-spin 0.8s linear infinite;
}

.rothco-spinner {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

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

/* ═════════════════════════════════════════════════════════════════
   Status Badges
   ═════════════════════════════════════════════════════════════════ */

.rothco-tracking-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rothco-badge-success {
    background: #dcfce7;
    color: #166534;
}

.rothco-badge-processing {
    background: #dbeafe;
    color: #1e40af;
}

.rothco-badge-error {
    background: #fee2e2;
    color: #991b1b;
}

.rothco-badge-pending {
    background: #fef3c7;
    color: #92400e;
}

.rothco-badge-sandbox {
    background: #f3e8ff;
    color: #6b21a8;
}

.rothco-badge-unknown {
    background: #f3f4f6;
    color: #6b7280;
}

.rothco-badge-not-sent {
    background: #f3f4f6;
    color: #9ca3af;
    font-size: 12px;
}

/* ═════════════════════════════════════════════════════════════════
   Results
   ═════════════════════════════════════════════════════════════════ */

.rothco-tracking-results {
    animation: rothco-fade-in 0.4s ease;
}

@keyframes rothco-fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.rothco-result-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 16px;
}

.rothco-result-status-label {
    font-weight: 600;
    color: #1a2744;
}

.rothco-result-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.rothco-result-section {
    padding: 20px 25px;
    border-bottom: 1px solid #f0f0f0;
}

.rothco-result-section:last-child {
    border-bottom: none;
}

.rothco-result-section-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a2744;
    margin: 0 0 15px;
}

.rothco-result-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f8f8f8;
    font-size: 14px;
    gap: 15px;
}

.rothco-result-row:last-child {
    border-bottom: none;
}

.rothco-result-label {
    color: #666;
    white-space: nowrap;
    font-weight: 500;
}

.rothco-result-value {
    color: #333;
    text-align: right;
    word-break: break-word;
}

.rothco-result-code {
    font-family: "SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", monospace;
    font-size: 13px;
    background: #f5f5f5;
    padding: 3px 8px;
    border-radius: 4px;
    color: #e87722;
    font-weight: 600;
    word-break: break-all;
}

/* ═════════════════════════════════════════════════════════════════
   Tracking Number Section (v2.1.0)
   ═════════════════════════════════════════════════════════════════ */

.rothco-tracking-section {
    background: #f0fdf4;
    border-bottom: 2px solid #86efac;
}

.rothco-tracking-section .rothco-result-section-title {
    color: #166534;
}

.rothco-tracking-number-display {
    padding: 5px 0;
}

.rothco-tracking-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: "SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", monospace;
    font-size: 15px;
    font-weight: 700;
    color: #e87722;
    text-decoration: none;
    padding: 6px 14px;
    background: #fff;
    border: 2px solid #e87722;
    border-radius: 6px;
    transition: background 0.2s;
    word-break: break-all;
}

.rothco-tracking-link:hover {
    background: #fff7ed;
    color: #c45d14;
}

.rothco-external-icon {
    font-size: 16px;
    font-weight: normal;
    color: #e87722;
}

.rothco-tracking-number-small {
    color: #e87722;
    font-weight: 500;
}

.rothco-tracking-number-small a {
    color: #e87722;
    text-decoration: none;
    font-family: monospace;
    font-size: 11px;
}

.rothco-tracking-number-small a:hover {
    text-decoration: underline;
}

/* ═════════════════════════════════════════════════════════════════
   Items Table
   ═════════════════════════════════════════════════════════════════ */

.rothco-result-table-wrap {
    overflow-x: auto;
}

.rothco-result-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.rothco-result-table th {
    text-align: left;
    padding: 10px 12px;
    background: #f8f9fa;
    color: #1a2744;
    font-weight: 600;
    border-bottom: 2px solid #e0e0e0;
}

.rothco-result-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: top;
}

.rothco-result-table tr:last-child td {
    border-bottom: none;
}

/* ═════════════════════════════════════════════════════════════════
   Warnings
   ═════════════════════════════════════════════════════════════════ */

.rothco-result-warnings {
    background: #fefce8;
    border-top: 1px solid #fde68a;
}

.rothco-warnings-title {
    color: #92400e !important;
}

.rothco-warning-list {
    padding: 0 25px 20px;
}

.rothco-warning-item {
    padding: 6px 0;
    color: #92400e;
    font-size: 14px;
}

/* Sandbox Notice */
.rothco-sandbox-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 25px;
    background: #f3e8ff;
    color: #6b21a8;
    font-size: 13px;
}

/* Last Checked */
.rothco-result-last-checked {
    padding: 10px 25px;
    background: #f9fafb;
    color: #999;
    text-align: right;
}

/* ═════════════════════════════════════════════════════════════════
   My Account Integration Styles
   ═════════════════════════════════════════════════════════════════ */

.rothco-order-info-section {
    margin: 20px 0;
    padding: 20px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.rothco-order-info-section h3 {
    margin: 0 0 15px;
    color: #1a2744;
    font-size: 18px;
}

.rothco-order-info-card {
    padding: 15px;
    background: #f9fafb;
    border-radius: 6px;
}

.rothco-info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.rothco-info-row:last-child {
    border-bottom: none;
}

.rothco-info-label {
    color: #666;
    font-weight: 500;
}

.rothco-info-row code {
    background: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    color: #e87722;
}

.rothco-tracking-number-row {
    border-bottom: 1px solid #ddd !important;
    padding: 10px 0;
}

.rothco-tracking-number-link {
    color: #e87722;
    text-decoration: none;
    font-weight: 600;
    word-break: break-all;
}

.rothco-tracking-number-link:hover {
    text-decoration: underline;
}

.rothco-warnings {
    margin-top: 15px;
    padding: 12px;
    background: #fefce8;
    border-radius: 6px;
}

.rothco-warning-item {
    padding: 4px 0;
    font-size: 13px;
    color: #92400e;
}

/* ═════════════════════════════════════════════════════════════════
   My Orders Section (v2.2.0 — logged-in users)
   ═════════════════════════════════════════════════════════════════ */

.rothco-my-orders-wrap {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.rothco-my-orders-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a2744;
    margin: 0 0 15px;
}

.rothco-my-orders-loading {
    text-align: center;
    padding: 30px 20px;
    color: #666;
}

.rothco-my-orders-list {
    display: grid;
    gap: 12px;
}

.rothco-my-order-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px 20px;
    transition: border-color 0.2s, box-shadow 0.2s;
    cursor: default;
}

.rothco-my-order-card:hover {
    border-color: #e87722;
    box-shadow: 0 2px 8px rgba(232, 119, 34, 0.1);
}

.rothco-my-order-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.rothco-my-order-number {
    font-size: 16px;
    font-weight: 700;
    color: #1a2744;
}

.rothco-my-order-details {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    font-size: 14px;
    color: #666;
}

.rothco-my-order-date {
    color: #888;
}

.rothco-my-order-total {
    font-weight: 600;
    color: #333;
}

.rothco-my-order-tn {
    font-family: "SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", monospace;
    font-size: 13px;
    font-weight: 600;
    color: #e87722;
}

.rothco-my-order-tn a {
    color: #e87722;
    text-decoration: none;
}

.rothco-my-order-tn a:hover {
    text-decoration: underline;
}

.rothco-my-orders-empty {
    text-align: center;
    padding: 20px;
    color: #888;
    font-size: 15px;
}

/* Track This Order button */
.rothco-btn-sm {
    padding: 8px 18px;
    font-size: 13px;
}

.rothco-btn-track {
    background: #e87722;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.rothco-btn-track:hover {
    background: #d06a1c;
}

/* Separator */
.rothco-tracking-separator {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 20px 0;
    color: #aaa;
    font-size: 14px;
}

.rothco-tracking-separator::before,
.rothco-tracking-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e0e0e0;
}

.rothco-separator-text {
    white-space: nowrap;
    font-style: italic;
}

/* ═════════════════════════════════════════════════════════════════
   Responsive Design
   ═════════════════════════════════════════════════════════════════ */

@media (max-width: 600px) {
    .rothco-tracking-hero {
        padding: 30px 15px;
    }

    .rothco-tracking-title {
        font-size: 22px;
    }

    .rothco-tracking-form {
        flex-direction: column;
        gap: 12px;
    }

    .rothco-form-group {
        min-width: 100%;
    }

    .rothco-btn {
        width: 100%;
    }

    .rothco-result-row {
        flex-direction: column;
        gap: 4px;
    }

    .rothco-result-value,
    .rothco-result-code {
        text-align: left;
    }

    .rothco-info-row {
        flex-direction: column;
        gap: 4px;
    }

    .rothco-result-table th,
    .rothco-result-table td {
        padding: 8px;
        font-size: 13px;
    }

    .rothco-result-section {
        padding: 15px;
    }

    .rothco-tracking-link {
        font-size: 13px;
    }

    .rothco-my-order-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .rothco-my-order-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .rothco-btn-track {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 400px) {
    .rothco-tracking-title {
        font-size: 20px;
    }

    .rothco-result-banner {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
}
