/* ==========================================================================
   FOODHUB ENTERPRISE POPUP & MODAL SYSTEM (SWIGGY / STRIPE GRADE)
   Ultra-Modern Glassmorphism Modals, Metric Cards & Dynamic Island Toasts
   ========================================================================== */

/* Modal Backdrop */
.foodhub-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.28s;
}

.foodhub-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Card */
.foodhub-modal-card {
    background: #111827;
    color: #f8fafc;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
    width: 100%;
    max-width: 480px;
    overflow: hidden;
    position: relative;
    transform: scale(0.92) translateY(15px);
    opacity: 0;
    transition: transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.28s;
}

.foodhub-modal-overlay.active .foodhub-modal-card {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* Modal Header & Icon */
.foodhub-modal-header {
    padding: 24px 24px 16px 24px;
    text-align: center;
    position: relative;
}

.foodhub-modal-icon-wrap {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px auto;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    position: relative;
    animation: iconPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes iconPop {
    0% { transform: scale(0.4); opacity: 0; }
    70% { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}

/* Icon Type Themes */
.foodhub-modal-card[data-type="success"] .foodhub-modal-icon-wrap {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1.5px solid rgba(16, 185, 129, 0.35);
    box-shadow: 0 0 25px rgba(16, 185, 129, 0.25);
}

.foodhub-modal-card[data-type="monetization"] .foodhub-modal-icon-wrap {
    background: rgba(244, 63, 94, 0.15);
    color: #fb7185;
    border: 1.5px solid rgba(244, 63, 94, 0.35);
    box-shadow: 0 0 25px rgba(244, 63, 94, 0.25);
}

.foodhub-modal-card[data-type="warning"] .foodhub-modal-icon-wrap,
.foodhub-modal-card[data-type="confirm"] .foodhub-modal-icon-wrap {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1.5px solid rgba(245, 158, 11, 0.35);
    box-shadow: 0 0 25px rgba(245, 158, 11, 0.25);
}

.foodhub-modal-card[data-type="error"] .foodhub-modal-icon-wrap {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1.5px solid rgba(239, 68, 68, 0.35);
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.25);
}

.foodhub-modal-card[data-type="gps"] .foodhub-modal-icon-wrap {
    background: rgba(37, 99, 235, 0.15);
    color: #3b82f6;
    border: 1.5px solid rgba(37, 99, 235, 0.35);
    box-shadow: 0 0 25px rgba(37, 99, 235, 0.25);
}

.foodhub-modal-title {
    font-size: 19px;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 6px 0;
    letter-spacing: -0.2px;
    line-height: 1.35;
}

.foodhub-modal-subtitle {
    font-size: 13.5px;
    color: #94a3b8;
    margin: 0;
    line-height: 1.5;
}

/* Modal Body Content */
.foodhub-modal-body {
    padding: 0 24px 20px 24px;
}

.foodhub-modal-message {
    font-size: 13.5px;
    color: #cbd5e1;
    line-height: 1.6;
    margin-bottom: 16px;
    text-align: center;
}

/* Metric Grid (Key-Value Badges) */
.foodhub-modal-metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 14px;
}

.foodhub-metric-chip {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: transform 0.15s, background 0.15s;
}

.foodhub-metric-chip:hover {
    background: rgba(255, 255, 255, 0.07);
    transform: translateY(-1px);
}

.foodhub-metric-label {
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.foodhub-metric-value {
    font-size: 15px;
    font-weight: 800;
    color: #f8fafc;
}

.foodhub-metric-chip.accent-monetization .foodhub-metric-value { color: #fb7185; }
.foodhub-metric-chip.accent-success .foodhub-metric-value { color: #34d399; }
.foodhub-metric-chip.accent-gps .foodhub-metric-value { color: #60a5fa; }

/* Modal Footer & Buttons */
.foodhub-modal-footer {
    padding: 16px 24px 24px 24px;
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: flex-end;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.15);
}

.foodhub-btn-modal-cancel {
    padding: 11px 20px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 700;
    background: transparent;
    color: #94a3b8;
    border: 1px solid rgba(255, 255, 255, 0.15);
    cursor: pointer;
    transition: all 0.18s;
}

.foodhub-btn-modal-cancel:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
}

.foodhub-btn-modal-confirm {
    flex: 1;
    padding: 12px 22px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 800;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.18s;
    color: #ffffff;
}

.foodhub-modal-card[data-type="success"] .foodhub-btn-modal-confirm {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35);
}

.foodhub-modal-card[data-type="monetization"] .foodhub-btn-modal-confirm {
    background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
    box-shadow: 0 4px 16px rgba(244, 63, 94, 0.4);
}

.foodhub-modal-card[data-type="warning"] .foodhub-btn-modal-confirm,
.foodhub-modal-card[data-type="confirm"] .foodhub-btn-modal-confirm {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.35);
}

.foodhub-modal-card[data-type="error"] .foodhub-btn-modal-confirm {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.35);
}

.foodhub-modal-card[data-type="gps"] .foodhub-btn-modal-confirm {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
}

.foodhub-btn-modal-confirm:hover {
    transform: translateY(-1px);
    filter: brightness(1.08);
}

.foodhub-btn-modal-confirm:active {
    transform: translateY(1px);
}

/* ==========================================================================
   DYNAMIC ISLAND FLOATING TOASTS (TOP CENTER)
   ========================================================================== */
.foodhub-toast-container {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100001;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    width: 90%;
    max-width: 420px;
}

.foodhub-toast-pill {
    pointer-events: auto;
    background: rgba(17, 24, 39, 0.92);
    color: #f8fafc;
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    padding: 12px 18px;
    border-radius: 100px;
    box-shadow: 0 12px 35px -5px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: toastSlideIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    transition: transform 0.25s, opacity 0.25s;
}

.foodhub-toast-pill.removing {
    transform: translateY(-20px) scale(0.9);
    opacity: 0;
}

@keyframes toastSlideIn {
    0% { transform: translateY(-30px) scale(0.85); opacity: 0; }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}

.foodhub-toast-icon {
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.foodhub-toast-pill[data-type="success"] .foodhub-toast-icon { color: #34d399; }
.foodhub-toast-pill[data-type="error"] .foodhub-toast-icon { color: #f87171; }
.foodhub-toast-pill[data-type="warning"] .foodhub-toast-icon { color: #fbbf24; }
.foodhub-toast-pill[data-type="info"] .foodhub-toast-icon { color: #38bdf8; }

.foodhub-toast-text {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    flex: 1;
}

/* Mobile Bottom-Sheet Behavior */
@media (max-width: 600px) {
    .foodhub-modal-overlay {
        align-items: flex-end;
        padding: 0;
    }
    
    .foodhub-modal-card {
        border-radius: 24px 24px 0 0;
        max-width: 100%;
        transform: translateY(100%);
    }
    
    .foodhub-modal-overlay.active .foodhub-modal-card {
        transform: translateY(0);
    }
    
    .foodhub-toast-container {
        top: 14px;
        width: 94%;
    }
}
