/* =============================================
   PGC STATUS BAR — Frontend Styles
   ============================================= */

.pgc-status-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 0;
    background: var(--pgc-bg, transparent);
    border-radius: var(--pgc-radius, 8px);
    overflow: visible;
    width: auto;
    max-width: 100%;
    position: relative;
    z-index: 99999;
}

/* ---- Single item ---- */
.pgc-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: var(--pgc-pad-desktop, 12px) 18px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
    border-right: 1px solid rgba(255,255,255,0.2);
}
.pgc-item:last-child { border-right: none; }
.pgc-item:hover { background: rgba(255,255,255,0.08); }

/* ---- Dot indicator ---- */
.pgc-dot {
    width: var(--pgc-dot-desktop, 14px);
    height: var(--pgc-dot-desktop, 14px);
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
}
.pgc-dot--open    { background: #4CAF50; box-shadow: 0 0 6px rgba(76,175,80,0.5); }
.pgc-dot--closed  { background: #f44336; box-shadow: 0 0 6px rgba(244,67,54,0.5); }
.pgc-dot--limited { background: #ff9800; box-shadow: 0 0 6px rgba(255,152,0,0.5); }

/* ---- Icon ---- */
.pgc-icon {
    font-size: calc(var(--pgc-font-desktop, 14px) + 2px);
    flex-shrink: 0;
    line-height: 1;
}

/* ---- Label ---- */
.pgc-label {
    font-size: var(--pgc-font-desktop, 14px);
    font-weight: 600;
    color: var(--pgc-text, #333);
    line-height: 1.2;
}

/* ---- Tooltip ---- */
.pgc-tooltip {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.18);
    padding: 14px 18px;
    min-width: 200px;
    width: var(--pgc-tooltip-w, 250px);
    max-width: 90vw;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 999999;
    white-space: normal;
    pointer-events: none;
}
.pgc-tooltip::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 12px;
    height: 12px;
    background: #fff;
    box-shadow: -2px -2px 4px rgba(0,0,0,0.04);
}

.pgc-item:hover .pgc-tooltip,
.pgc-item.pgc-touch-active .pgc-tooltip {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.pgc-tooltip-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}
.pgc-tooltip-header .pgc-dot {
    width: 10px;
    height: 10px;
}

.pgc-tooltip-status {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.pgc-tooltip-status--open    { color: #4CAF50; }
.pgc-tooltip-status--closed  { color: #f44336; }
.pgc-tooltip-status--limited { color: #ff9800; }

.pgc-tooltip-desc {
    font-size: 13px;
    color: #555;
    line-height: 1.5;
}

/* No icons modifier */
.pgc-no-icons .pgc-icon { display: none; }

/* =============================================
   TABLET  (max 900px)
   ============================================= */
@media (max-width: 900px) {
    .pgc-item {
        padding: var(--pgc-pad-tablet, 8px) 12px;
        gap: 6px;
    }
    .pgc-dot {
        width: var(--pgc-dot-tablet, 12px);
        height: var(--pgc-dot-tablet, 12px);
    }
    .pgc-label {
        font-size: var(--pgc-font-tablet, 12px);
    }
    .pgc-icon {
        font-size: calc(var(--pgc-font-tablet, 12px) + 2px);
    }
}

/* =============================================
   MOBILE  (max 600px)
   ============================================= */
@media (max-width: 600px) {
    .pgc-status-bar {
        width: 100%;
        border-radius: calc(var(--pgc-radius, 8px) / 2);
    }
    .pgc-item {
        flex: 1 1 0;
        justify-content: center;
        padding: var(--pgc-pad-mobile, 5px) 4px;
        gap: 3px;
        min-width: 0;
    }
    .pgc-dot {
        width: var(--pgc-dot-mobile, 10px);
        height: var(--pgc-dot-mobile, 10px);
    }
    .pgc-label {
        font-size: var(--pgc-font-mobile, 10px);
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .pgc-icon {
        display: none;
    }

    /* Tooltip edge corrections */
    .pgc-item:first-child .pgc-tooltip {
        left: 0;
        transform: translateX(0);
    }
    .pgc-item:first-child .pgc-tooltip::before {
        left: 16px;
        transform: rotate(45deg);
    }
    .pgc-item:last-child .pgc-tooltip {
        left: auto;
        right: 0;
        transform: translateX(0);
    }
    .pgc-item:last-child .pgc-tooltip::before {
        left: auto;
        right: 16px;
        transform: rotate(45deg);
    }
}

/* =============================================
   VERY SMALL  (max 380px)
   ============================================= */
@media (max-width: 380px) {
    .pgc-label {
        font-size: calc(var(--pgc-font-mobile, 10px) - 1px);
    }
    .pgc-item {
        padding: 4px 2px;
        gap: 2px;
    }
}
