﻿/* ═══════════════════════════════════════════
   FLOATING ORDER BADGE — LEFT SIDE
   ═══════════════════════════════════════════ */

.order-badge {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9999;
    background: #1b1b2f;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.05);
    cursor: pointer;
    font-family: 'Segoe UI', 'Roboto', sans-serif;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    user-select: none;
}

    .order-badge:hover {
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.08);
        transform: translateY(-2px);
    }

/* ─── Mobile Button (Hidden on Desktop) ─── */
.badge-mobile-btn {
    display: none;
}

/* ─── Collapsed View ─── */
.badge-collapsed {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    min-width: 160px;
}

.badge-collapsed-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.badge-collapsed-title {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.3px;
}

.badge-collapsed-sub {
    font-size: 11px;
    color: #8888a8;
}

/* ─── Expanded View ─── */
.badge-expanded {
    padding: 16px 18px 18px;
    min-width: 260px;
    max-width: 300px;
    animation: badgeFadeIn 0.25s ease-out;
}

@keyframes badgeFadeIn {
    from {
        opacity: 0;
        transform: scale(0.96);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Header */
.badge-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.badge-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.badge-icon {
    font-size: 18px;
}

.badge-order-id {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
}

.badge-close-btn {
    background: rgba(255, 255, 255, 0.06);
    border: none;
    color: #666680;
    font-size: 18px;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
}

    .badge-close-btn:hover {
        background: rgba(233, 69, 96, 0.2);
        color: #e94560;
    }

/* Divider */
.badge-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
    margin: 12px 0;
}

/* Status Row */
.badge-status-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.badge-status-text {
    font-size: 13px;
    color: #ccccdd;
    line-height: 1.4;
}

/* ─── Dots ─── */
.badge-dot,
.badge-dot-large,
.badge-dot-mobile {
    border-radius: 50%;
    flex-shrink: 0;
}

.badge-dot {
    width: 10px;
    height: 10px;
}

.badge-dot-large {
    width: 12px;
    height: 12px;
}

.badge-dot-mobile {
    width: 10px;
    height: 10px;
    position: absolute;
    top: 8px;
    right: 8px;
}

    /* Pending */
    .badge-dot.pending,
    .badge-dot-large.pending,
    .badge-dot-mobile.pending {
        background: #ffc107;
        animation: pulsePending 1.5s infinite;
    }

@keyframes pulsePending {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.5);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(255, 193, 7, 0);
    }
}

/* Accepted */
.badge-dot.accepted,
.badge-dot-large.accepted,
.badge-dot-mobile.accepted {
    background: #4caf50;
    animation: pulseAccepted 1.5s infinite;
}

@keyframes pulseAccepted {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.5);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(76, 175, 80, 0);
    }
}

/* Rejected */
.badge-dot.rejected,
.badge-dot-large.rejected,
.badge-dot-mobile.rejected {
    background: #e94560;
    animation: none;
}

/* ─── Progress Bar ─── */
.badge-progress {
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 14px;
}

.badge-progress-fill {
    height: 100%;
    border-radius: 4px;
    width: 33%;
    transition: width 0.8s ease, background 0.5s ease;
}

    .badge-progress-fill.pending {
        background: linear-gradient(90deg, #ffc107, #ffab00);
    }

    .badge-progress-fill.accepted {
        background: linear-gradient(90deg, #4caf50, #66bb6a);
        width: 100%;
    }

    .badge-progress-fill.rejected {
        background: linear-gradient(90deg, #e94560, #ff6b6b);
        width: 100%;
    }

/* ─── View Button ─── */
.badge-view-btn {
    display: block;
    width: 100%;
    text-align: center;
    background: #e94560;
    color: #ffffff;
    padding: 10px 0;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.4px;
    transition: background 0.2s, transform 0.15s;
}

    .badge-view-btn:hover {
        background: #d63851;
        color: #ffffff;
        text-decoration: none;
        transform: scale(1.02);
    }

    .badge-view-btn:active {
        transform: scale(0.98);
    }

/* ═══════════════════════════════════════════
   SHOW / HIDE ANIMATION
   ═══════════════════════════════════════════ */

.order-badge.show {
    animation: badgeSlideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.order-badge.hiding {
    animation: badgeSlideOut 0.3s ease-in forwards;
}

@keyframes badgeSlideIn {
    from {
        transform: translateX(-80px) scale(0.8);
        opacity: 0;
    }

    to {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

@keyframes badgeSlideOut {
    from {
        transform: translateX(0) scale(1);
        opacity: 1;
    }

    to {
        transform: translateX(-80px) scale(0.8);
        opacity: 0;
    }
}

/* ═══════════════════════════════════════════
   MOBILE — SMALL ROUND BUTTON
   ═══════════════════════════════════════════ */

@media (max-width: 576px) {

    .order-badge {
        bottom: 16px;
        left: 16px;
        border-radius: 50%;
        width: 52px;
        height: 52px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        overflow: visible;
    }

    /* Show small round button */
    .badge-mobile-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 52px;
        height: 52px;
        position: relative;
    }

    .badge-mobile-icon {
        font-size: 22px;
    }

    /* Hide collapsed desktop view */
    .badge-collapsed {
        display: none !important;
    }

    /* Expanded on mobile = popup above button */
    .order-badge.expanded {
        border-radius: 16px;
        width: auto;
        height: auto;
        bottom: 16px;
        left: 16px;
        right: 16px;
    }

        .order-badge.expanded .badge-mobile-btn {
            display: none;
        }

        .order-badge.expanded .badge-expanded {
            display: block !important;
            min-width: unset;
            max-width: unset;
            width: 100%;
        }

    /* Slide from left on mobile */
    @keyframes badgeSlideIn {
        from {
            transform: scale(0.5);
            opacity: 0;
        }

        to {
            transform: scale(1);
            opacity: 1;
        }
    }

    @keyframes badgeSlideOut {
        from {
            transform: scale(1);
            opacity: 1;
        }

        to {
            transform: scale(0.5);
            opacity: 0;
        }
    }
}

@media (max-width: 360px) {
    .order-badge {
        bottom: 12px;
        left: 12px;
        width: 48px;
        height: 48px;
    }

    .badge-mobile-btn {
        width: 48px;
        height: 48px;
    }

    .badge-mobile-icon {
        font-size: 20px;
    }

    .order-badge.expanded {
        left: 10px;
        right: 10px;
        bottom: 12px;
    }

    .badge-expanded {
        padding: 14px;
    }
}
