/*
 * ═══════════════════════════════════════════════════════════════
 *  DELIVERY PANEL STYLES - Mobile First
 * ═══════════════════════════════════════════════════════════════
 */

/* ─── Login ─────────────────────────────────────────────────── */
.delivery-login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--bg-primary);
    background-image: radial-gradient(circle at 50% 30%, rgba(255, 107, 53, 0.08) 0%, transparent 50%);
}

.delivery-login-card {
    width: 100%;
    max-width: 400px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: var(--shadow-xl);
}

.delivery-login-header {
    text-align: center;
    margin-bottom: 32px;
}

.delivery-login-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    animation: bounceIn 0.6s ease;
}

/* ─── App Layout ────────────────────────────────────────────── */
.delivery-app {
    min-height: 100vh;
    max-width: 480px;
    margin: 0 auto;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: var(--shadow-xl);
}

/* ─── Top Bar ───────────────────────────────────────────────── */
.delivery-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.online-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

.online-status-text {
    font-size: 0.85rem;
    font-weight: 600;
}

.online-status-text.online {
    color: var(--success);
}

.online-status-text.offline {
    color: var(--text-muted);
}

/* ─── Profile Bar ───────────────────────────────────────────── */
.delivery-profile-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.delivery-name {
    font-weight: 700;
    font-size: 1.05rem;
}

.delivery-quick-stats {
    display: flex;
    gap: 16px;
}

.quick-stat {
    text-align: center;
}

.quick-stat-value {
    display: block;
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--primary);
}

.quick-stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ─── Tab Bar ───────────────────────────────────────────────── */
.delivery-tabs {
    display: flex;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.delivery-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 8px;
    font-size: 0.75rem;
    color: var(--text-muted);
    position: relative;
    border: none;
    background: none;
    cursor: pointer;
    transition: var(--transition);
}

.delivery-tab i {
    font-size: 1.1rem;
}

.delivery-tab.active {
    color: var(--primary);
}

.delivery-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20%;
    right: 20%;
    height: 3px;
    background: var(--primary);
    border-radius: 3px 3px 0 0;
}

.delivery-tab:hover {
    color: var(--text-primary);
}

.delivery-tab-badge {
    position: absolute;
    top: 6px;
    right: calc(50% - 20px);
    min-width: 18px;
    height: 18px;
    background: var(--danger);
    color: white;
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: 700;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.delivery-tab-badge.visible {
    display: flex;
}

/* ─── Content ───────────────────────────────────────────────── */
.delivery-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.delivery-tab-content {
    animation: fadeIn 0.3s ease;
}

/* ─── Active Delivery Card ──────────────────────────────────── */
.active-delivery-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    overflow: hidden;
    margin-bottom: 16px;
}

.active-delivery-header {
    padding: 16px 20px;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.active-delivery-header h4 {
    color: white;
    font-size: 1rem;
}

.active-delivery-body {
    padding: 20px;
}

.delivery-customer-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 16px;
}

.delivery-customer-info .customer-name {
    font-weight: 700;
    font-size: 1rem;
}

.delivery-customer-info .customer-phone {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.delivery-address {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.delivery-address .address-icon {
    color: var(--primary);
    font-size: 1.2rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.delivery-address .address-text {
    font-size: 0.9rem;
    line-height: 1.5;
}

.delivery-items-summary {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 16px;
}

.delivery-item-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 0.9rem;
}

.delivery-total-row {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary);
    padding-top: 8px;
}

.delivery-payment-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(255, 107, 53, 0.1);
    border: 1px solid rgba(255, 107, 53, 0.3);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 16px;
}

.delivery-action-buttons {
    display: flex;
    gap: 10px;
}

.delivery-action-buttons .btn {
    flex: 1;
}

/* ─── Delivery Map Simulation ───────────────────────────────── */
.delivery-map-sim {
    width: 100%;
    height: 160px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.delivery-map-sim .route-line {
    position: absolute;
    top: 50%;
    left: 10%;
    right: 10%;
    height: 3px;
    background: var(--border-color);
    border-radius: 3px;
}

.delivery-map-sim .route-progress {
    position: absolute;
    top: 50%;
    left: 10%;
    height: 3px;
    background: var(--primary-gradient);
    border-radius: 3px;
    transition: width 1s ease;
}

.delivery-map-sim .pin-start {
    position: absolute;
    left: 8%;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
}

.delivery-map-sim .pin-end {
    position: absolute;
    right: 8%;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
}

.delivery-map-sim .bike-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.8rem;
    transition: left 2s ease;
    filter: drop-shadow(0 0 10px rgba(255, 107, 53, 0.5));
}

/* ─── New Order Card ────────────────────────────────────────── */
.new-delivery-order {
    background: var(--bg-card);
    border: 2px solid var(--warning);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 12px;
    animation: pulse 2s infinite, slideUp 0.4s ease;
}

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

.new-order-id {
    font-weight: 700;
    font-size: 1.05rem;
}

.new-order-timer {
    font-size: 0.85rem;
    color: var(--warning);
    font-weight: 600;
}

.new-order-restaurant {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.new-order-distance {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.new-order-earning {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--success);
    margin-bottom: 16px;
}

/* ─── History Card ──────────────────────────────────────────── */
.history-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.history-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.history-icon.delivered {
    background: rgba(46, 213, 115, 0.15);
}

.history-icon.cancelled {
    background: rgba(255, 71, 87, 0.15);
}

.history-info {
    flex: 1;
}

.history-order-id {
    font-weight: 600;
    font-size: 0.9rem;
}

.history-customer {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.history-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.history-amount {
    font-weight: 700;
    font-size: 1rem;
    color: var(--primary);
}

/* ─── Profile Card ──────────────────────────────────────────── */
.profile-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 24px;
    text-align: center;
    margin-bottom: 16px;
}

.profile-card .profile-avatar {
    font-size: 4rem;
    margin-bottom: 16px;
}

.profile-card .profile-name {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.profile-card .profile-id {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.profile-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px;
    text-align: center;
}

.profile-stat-card .p-stat-value {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary);
}

.profile-stat-card .p-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.profile-detail-list {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.profile-detail-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.profile-detail-item:last-child {
    border-bottom: none;
}

.profile-detail-item i {
    width: 20px;
    text-align: center;
    color: var(--primary);
}

.profile-detail-item .detail-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.profile-detail-item .detail-value {
    font-weight: 500;
    font-size: 0.9rem;
}

.profile-logout-btn {
    margin-top: 20px;
}

/* ─── Call Button ───────────────────────────────────────────── */
.call-btn-float {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2ED573, #1abc9c);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(46, 213, 115, 0.3);
}

.call-btn-float:hover {
    transform: scale(1.1);
}

/* ─── Responsive ────────────────────────────────────────────── */
@media (min-width: 481px) {
    .delivery-login-screen {
        background-image: radial-gradient(circle at 50% 30%, rgba(255, 107, 53, 0.05) 0%, transparent 50%);
    }
}

@media (max-width: 480px) {
    .delivery-profile-bar {
        flex-direction: column;
        gap: 16px;
    }

    .delivery-quick-stats {
        width: 100%;
        justify-content: space-around;
    }

    .delivery-action-buttons {
        flex-direction: column;
    }
}
