/**
 * Order Dashboard — mobile-first styles
 * Tryb dashboardu zamówienia w index.html (?order=)
 */

/* ── Container ──────────────────────────────────────────────── */

#order-dashboard {
    max-width: 600px;
    margin: 0 auto;
    padding: 16px;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ── Header ─────────────────────────────────────────────────── */

.od-header {
    text-align: center;
    padding: 24px 0 16px;
}

.od-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
}

.od-order-id {
    font-size: 0.85rem;
    color: #888;
    margin: 4px 0 0;
}

.od-customer {
    font-size: 0.95rem;
    color: #555;
    margin: 2px 0 0;
}

/* ── Info bar ───────────────────────────────────────────────── */

.od-info {
    background: #f0f4ff;
    border-radius: 12px;
    padding: 14px 18px;
    margin-bottom: 20px;
    text-align: center;
}

.od-info p {
    margin: 0;
    font-size: 0.9rem;
    color: #444;
    line-height: 1.5;
}

/* ── All done ───────────────────────────────────────────────── */

.od-all-done {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #e8f5e9, #f1f8e9);
    border-radius: 16px;
    margin-bottom: 20px;
}

.od-done-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.od-all-done h2 {
    font-size: 1.3rem;
    color: #2e7d32;
    margin: 0 0 8px;
}

.od-all-done p {
    font-size: 0.9rem;
    color: #558b2f;
    margin: 0;
    line-height: 1.5;
}

/* ── Product cards ──────────────────────────────────────────── */

.od-products {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.od-card {
    background: #fff;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 2px solid transparent;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.od-card:not(.od-card-done):not(.od-card-unknown) {
    border-color: #e0e0e0;
}

.od-card-done {
    background: #f9fdf9;
    border-color: #c8e6c9;
    opacity: 0.85;
}

.od-card-progress {
    border-color: #bbdefb;
    background: #f5f9ff;
}

.od-card-unknown {
    border-color: #ffecb3;
    background: #fffde7;
}

/* ── Card header ────────────────────────────────────────────── */

.od-card-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 14px;
}

.od-card-icon {
    font-size: 2rem;
    line-height: 1;
    flex-shrink: 0;
}

.od-card-info {
    flex: 1;
    min-width: 0;
}

.od-card-name {
    font-size: 1.05rem;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0 0 4px;
    line-height: 1.3;
}

.od-card-details {
    font-size: 0.85rem;
    color: #777;
    margin: 0;
}

/* ── Card footer ────────────────────────────────────────────── */

.od-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.od-status {
    font-size: 0.85rem;
    font-weight: 500;
}

.od-status-done { color: #2e7d32; }
.od-status-progress { color: #1565c0; }
.od-status-pending { color: #888; }
.od-status-unknown { color: #e65100; }

.od-card-hint {
    font-size: 0.8rem;
    color: #bf360c;
    margin: 4px 0 0;
}

/* ── Buttons ────────────────────────────────────────────────── */

.od-btn {
    border: none;
    border-radius: 10px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    /* Min touch target 48px */
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.od-btn:active {
    transform: scale(0.97);
}

.od-btn-primary {
    background: linear-gradient(135deg, #6200ea 0%, #4a00b8 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(98, 0, 234, 0.25);
}

.od-btn-primary:hover {
    box-shadow: 0 4px 12px rgba(98, 0, 234, 0.35);
}

.od-btn-start {
    flex-shrink: 0;
    white-space: nowrap;
}

/* ── Loading ────────────────────────────────────────────────── */

.od-loading {
    text-align: center;
    padding: 60px 20px;
}

.od-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e0e0e0;
    border-top-color: #6200ea;
    border-radius: 50%;
    animation: od-spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes od-spin {
    to { transform: rotate(360deg); }
}

.od-loading p {
    color: #888;
    font-size: 0.95rem;
}

/* ── Error ──────────────────────────────────────────────────── */

.od-error {
    text-align: center;
    padding: 40px 20px;
}

.od-error-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.od-error h2 {
    font-size: 1.2rem;
    color: #c62828;
    margin: 0 0 8px;
}

.od-error p {
    font-size: 0.9rem;
    color: #777;
    margin: 0 0 20px;
    line-height: 1.5;
}

/* ── Desktop ────────────────────────────────────────────────── */

@media (min-width: 768px) {
    #order-dashboard {
        padding: 32px 24px;
    }

    .od-header {
        padding: 32px 0 24px;
    }

    .od-title {
        font-size: 1.8rem;
    }

    .od-card {
        padding: 22px;
    }

    .od-card-icon {
        font-size: 2.4rem;
    }

    .od-card-name {
        font-size: 1.15rem;
    }
}
