/**
 * =====================================================================================
 * HELLA 3D MANAGEMENT SUITE: ORDER STATUS SPECIFIC STYLESHEET
 * =====================================================================================
 * @file        order_status.css
 * @description Stylesheet for the secure order tracking portal and telemetry visualizer.
 * @version     1.0.0
 * @cleared     Jul 5, 2026
 * * ARCHITECTURE OVERVIEW:
 * 1. CSS Keyframe Animations: Utilizes lightweight opacity and transform transitions 
 * to fade in DOM elements without requiring Javascript intersection observers.
 * 2. Responsive Telemetry: The tracking timeline natively switches from a horizontal 
 * flex layout to a vertical tree layout below 600px.
 * 3. Liquid Glassmorphism: Inherits global backdrop filter variables for UI consistency.
 * =====================================================================================
 */

.page-main-content {
    position: relative;
    z-index: 10;
    padding: 80px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: calc(100vh - 300px);
}

.status-portal-wrapper {
    max-width: 1200px;
    width: calc(100% - 40px);
    margin: 0 auto 3rem auto;
    
    background-color: var(--glass-bg);
    background-image: var(--glass-noise);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    
    border-radius: 24px;
    padding: 4rem 3rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.status-header {
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 2rem;
}

.status-header h1 {
    font-size: 2.8rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.status-header p {
    color: #a0a0a0;
    font-size: 1.1rem;
    max-width: 500px;
    margin: 0 auto;
}

.tracking-form-group {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.tracking-input {
    flex: 1;
    padding: 12px 15px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #ffffff;
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.3s ease, background 0.3s ease;
    box-sizing: border-box;
}

.tracking-input:focus { 
    border-color: #ff3b3b; 
    background: rgba(0, 0, 0, 0.4); 
}

.btn-tracking-search {
    padding: 14px 24px;
    background-color: #ff3b3b;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-tracking-search:hover { 
    background-color: #e62e2e; 
}

/* --- HYBRID ORDER CARD --- */
.order-card {
    background: rgba(10, 10, 12, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    animation: fadeIn 0.3s ease forwards;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

@keyframes fadeIn { 
    from { opacity: 0; transform: translateY(5px); } 
    to { opacity: 1; transform: translateY(0); } 
}

.order-header-compact {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.order-meta h3 {
    margin: 0 0 4px 0;
    color: #fff;
    font-size: 1.4rem;
    font-weight: 700;
    font-family: monospace;
    letter-spacing: 0.5px;
}

.order-meta span {
    font-size: 0.9rem;
    color: #888;
}

/* --- SLEEK TELEMETRY TRACKER --- */
.compact-tracker {
    position: relative;
    padding: 2rem 0 3.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.track-line-wrapper {
    position: relative;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 1px;
    margin: 0 10px;
}

.track-line-fill {
    position: absolute;
    top: 0; 
    left: 0;
    height: 100%;
    width: var(--fill-pct, 0%);
    background: #ff3b3b;
    box-shadow: 0 0 10px rgba(255, 59, 59, 0.5);
    transition: width 0.5s ease-out, height 0.5s ease-out;
}

.track-nodes {
    position: absolute;
    top: -6px;
    left: 0; right: 0;
    display: flex;
    justify-content: space-between;
}

.node-point {
    width: 14px;
    height: 14px;
    background: #1a1a1a;
    border: 2px solid #444;
    border-radius: 50%;
    position: relative;
    transition: all 0.3s ease;
}

.node-point.active {
    background: #ff3b3b;
    border-color: #ff3b3b;
    box-shadow: 0 0 8px rgba(255, 59, 59, 0.6);
}

.node-label {
    position: absolute;
    top: 22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666;
    white-space: nowrap;
    text-align: center;
    line-height: 1.2;
}

.node-point.active .node-label { 
    color: #ddd; 
}

.exception-banner {
    background: rgba(255, 59, 59, 0.05);
    border: 1px dashed rgba(255, 59, 59, 0.3);
    padding: 1rem;
    border-radius: 6px;
    text-align: center;
    color: #ff3b3b;
}

.exception-banner h4 { 
    margin: 0 0 0.25rem 0; 
    font-size: 1rem; 
    font-weight: 700; 
    text-transform: uppercase; 
}

.exception-banner p { 
    margin: 0; 
    color: #a0a0a0; 
    font-size: 0.9rem; 
}

/* --- ITEMS LIST --- */
.order-items-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    list-style: none;
    margin: 0; padding: 0;
}

.order-item-row {
    display: flex;
    align-items: center; /* Or flex-start if you prefer top alignment */
    gap: 1.25rem;
    padding: 1.25rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.item-thumb-container {
    width: 90px; 
    height: 60px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-thumb-container img {
    width: 100%; 
    height: 100%;
    object-fit: cover;
}

.item-details { 
    flex: 1; 
    min-width: 0; 
    display: flex; 
    flex-direction: column; 
    gap: 6px;
}

.item-title { 
    font-size: 1.05rem; 
    font-weight: 600; 
    color: #e0e0e0; 
    text-decoration: none; 
    white-space: normal; 
    overflow-wrap: break-word;
}

.item-title:hover { color: #fff; }
.item-title.disabled { pointer-events: none; color: #777; }

.item-variations { 
    font-size: 0.85rem; 
    color: #888; 
    white-space: normal; 
    overflow-wrap: break-word;
    line-height: 1.4; 
}

.item-sku { 
    color: #ddd; 
    font-family: monospace; 
    font-weight: 600; 
    letter-spacing: 0.5px; 
}

.item-pricing { 
    text-align: right; 
    display: flex; 
    flex-direction: column; 
    align-items: flex-end; 
    gap: 14px; 
    flex-shrink: 0;
}

.item-price-calc { 
    font-size: 1.05rem; 
    color: #ccc; 
}

.item-qty { 
    color: #ff3b3b; 
    font-weight: 700; 
    margin-right: 4px; 
}

.btn-buy-again {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.08);
    color: #ddd;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-buy-again:hover { 
    background: rgba(255, 255, 255, 0.15); 
    color: #fff; 
    border-color: rgba(255, 255, 255, 0.4); 
}

.badge-unavailable { 
    font-size: 0.8rem; 
    color: #ff3b3b; 
    font-weight: 600; 
}

/* --- CENTER SPLIT LAYOUT --- */
.order-footer-split {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 1.5rem;
    gap: 4rem;
}

.order-timeline {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    flex: 1;
    max-width: 400px;
}

.timeline-log {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.85rem;
    color: #a0a0a0;
}

.timeline-log strong { 
    color: #e0e0e0; 
    font-weight: 600; 
    width: 140px; 
    flex-shrink: 0; 
}

.log-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #444;
    flex-shrink: 0;
}

.log-dot.active { background: #ff3b3b; box-shadow: 0 0 5px rgba(255, 59, 59, 0.5); }
.log-dot.error { background: #ff3b3b; box-shadow: 0 0 5px rgba(255, 59, 59, 0.5); }
.log-dot.pending { background: #666666; }

.status-badge-active { 
    color: #ff3b3b; 
    font-weight: 700; 
    letter-spacing: 0.5px; 
}

.order-receipt {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.4rem;
    flex: 1;
    max-width: 400px;
}

.receipt-line {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 320px;
    font-size: 0.95rem;
    color: #a0a0a0;
}

.receipt-line.discount { 
    color: #00e676; 
}

.receipt-total {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 320px;
    font-size: 1.25rem;
    font-weight: 800;
    color: #ff3b3b;
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* --- ARCHIVED TOGGLE --- */
.btn-archived-toggle {
    width: 100%;
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(255, 255, 255, 0.15);
    color: #888;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-archived-toggle:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ddd;
    border-color: rgba(255, 255, 255, 0.3);
}

.archived-orders-container { 
    display: flex; 
    flex-direction: column; 
    gap: 1.5rem; 
}

.loading-spinner { 
    text-align: center; 
    color: #666; 
    padding: 2rem; 
    font-style: italic; 
    font-size: 1rem; 
}

/* ==============================================================================
 * MOBILE RESPONSIVE QUERIES
 * ============================================================================== */

@media (max-width: 968px) {
    .status-portal-wrapper { padding: 3rem 1.5rem; }
    .tracking-form-group { flex-direction: column; }
    .btn-tracking-search { width: 100%; }
}

@media (max-width: 768px) {
    .status-header h1 { font-size: 2.2rem; }
    .order-footer-split { flex-direction: column; gap: 2rem; align-items: stretch; }
    .order-timeline, .order-receipt { max-width: 100%; }
    .receipt-line, .receipt-total { max-width: 100%; }
}

@media (max-width: 600px) {
    .page-main-content { padding: 40px 10px; }
    .status-portal-wrapper { padding: 2rem 1rem; border-radius: 16px; margin-bottom: 1.5rem; } /* Reduced footer gap for mobile */
    .status-header h1 { font-size: 1.8rem; }
    .status-header p { font-size: 0.95rem; }
    
    .order-card { padding: 1.25rem; }
    .order-header-compact { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
    
    /* Shift to Vertical Tracking Nodes */
    .compact-tracker { 
        padding: 1rem 0 2rem 1.5rem; 
    }
    .track-line-wrapper {
        height: 200px;
        width: 2px;
        margin: 0;
    }
    .track-line-fill {
        width: 100%; 
        height: var(--fill-pct, 0%); 
    }
    .track-nodes {
        flex-direction: column;
        height: 100%;
        top: 0;
        left: -6px;
        width: 14px;
    }
    .node-label { 
        top: 50%;
        left: 28px;
        transform: translateY(-50%);
        white-space: nowrap; 
        max-width: none;     
        font-size: 0.75rem;
        text-align: left;
    }

    /* Fix for order items squishing horizontally */
    .order-item-row { flex-wrap: wrap; gap: 1rem; padding: 1rem 0; align-items: flex-start; }
    .item-thumb-container { width: 70px; height: 70px; }
    .item-details { flex: 1 1 calc(100% - 90px); }
    
    /* Drop pricing to its own clean row below the thumbnail/title */
    .item-pricing { 
        flex: 1 1 100%; 
        flex-direction: row; 
        justify-content: space-between; 
        align-items: center; 
        padding-top: 1rem;
        border-top: 1px dashed rgba(255, 255, 255, 0.08);
        text-align: left;
    }
    
    .timeline-log { font-size: 0.8rem; }
    .timeline-log strong { width: 120px; font-size: 0.8rem; }
}