/* ==========================================================
   Anegasaki Wait Status — Frontend Styles
   カード (.wait-status-box) と 固定バー (.aws-bar) を制御
   ========================================================== */

/* ── カード：home.php .wait-status-box を上書き ─────────── */

.wait-status-box {
    position: relative;
    max-width: 520px;
    margin: 0 auto 36px;
    padding: 28px 32px 24px;
    background-color: rgba(255, 255, 255, 0.92);
    border: 2px solid var(--color-primary, #8E78B8);
    border-radius: 14px;
    box-shadow: 0 4px 24px rgba(142, 120, 184, 0.13);
    text-align: center;
}

.wait-status-label {
    display: inline-block;
    padding: 5px 18px;
    border-radius: 999px;
    background: rgba(142, 120, 184, 0.1);
    color: var(--color-primary, #8E78B8);
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.wait-status-main {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    margin: 14px 0 6px;
}

.wait-status-count {
    font-family: 'Roboto', sans-serif;
    font-size: 6rem;
    font-weight: 700;
    line-height: 1;
    color: var(--color-primary, #8E78B8);
    letter-spacing: -0.02em;
}

.wait-status-unit {
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--color-primary, #8E78B8);
    padding-bottom: 4px;
}

.wait-status-text {
    margin: 10px 0 0;
    color: var(--color-primary, #8E78B8);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.75;
}

.wait-status-updated {
    margin: 8px 0 0;
    color: var(--color-primary, #8E78B8);
    opacity: 0.6;
    font-size: 0.8rem;
}

@media (max-width: 480px) {
    .wait-status-box {
        padding: 22px 20px 20px;
        border-radius: 10px;
    }
    .wait-status-count {
        font-size: 5rem;
    }
    .wait-status-unit {
        font-size: 1.4rem;
    }
    .wait-status-text {
        font-size: 0.97rem;
    }
}

/* ── 固定バー ────────────────────────────────────────────── */

.aws-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9000;
    background-color: rgba(255, 255, 255, 0.95);
    border-top: 2px solid var(--color-primary, #8E78B8);
    box-shadow: 0 -3px 16px rgba(142, 120, 184, 0.15);
}

.aws-bar-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    max-width: 1100px;
    margin: 0 auto;
    padding: 14px 28px;
}

.aws-bar-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--color-primary, #8E78B8);
    white-space: nowrap;
    flex-shrink: 0;
}

.aws-bar-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 14px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid #10b981;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #065f46;
    white-space: nowrap;
    flex-shrink: 0;
}

.aws-bar-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    display: inline-block;
    animation: aws-pulse 2s ease-in-out infinite;
}

@keyframes aws-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.45; transform: scale(0.75); }
}

.aws-bar-count-wrap {
    display: flex;
    align-items: baseline;
    gap: 4px;
    flex-shrink: 0;
}

.aws-bar-count {
    font-family: 'Roboto', sans-serif;
    font-size: 2.4rem;
    font-weight: 700;
    line-height: 1;
    color: var(--color-primary, #8E78B8);
    letter-spacing: -0.01em;
}

.aws-bar-unit {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-primary, #8E78B8);
}

.aws-bar-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-primary, #8E78B8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 1;
}

.aws-bar-updated {
    font-size: 0.75rem;
    color: var(--color-primary, #8E78B8);
    opacity: 0.6;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── 受付時間外バー ──────────────────────────────────────── */

.aws-bar--closed {
    border-top-color: var(--color-primary, #8E78B8);
}

.aws-bar--closed .aws-bar-label {
    color: var(--color-primary, #8E78B8);
}

.aws-bar-closed-badge {
    font-size: 1.2rem;
    font-weight: 700;
    color: #c0392b;
    white-space: nowrap;
    flex-shrink: 0;
}

.aws-bar-hours {
    font-size: 0.82rem;
    color: var(--color-text, #444);
    opacity: 0.75;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 受付時間外・終了バーの上下余白を広げる */
.aws-bar--closed .aws-bar-inner,
.aws-bar--ended .aws-bar-inner,
.aws-bar--kyushin .aws-bar-inner {
    padding-top: 20px;
    padding-bottom: 20px;
}

/* スマホ */
@media (max-width: 600px) {
    .aws-bar-inner {
        gap: 12px;
        padding: 9px 16px;
        justify-content: center;
        flex-wrap: wrap;
    }
    .aws-bar-label {
        display: none;
    }
    .aws-bar-count {
        font-size: 2rem;
    }
    .aws-bar-text {
        font-size: 0.82rem;
        flex-basis: 100%;
        text-align: center;
        order: 3;
    }
    .aws-bar-updated {
        display: none;
    }
}

/* ── 臨時休診ポップアップ ────────────────────────────────── */

.aws-closed-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: aws-overlay-in 0.2s ease;
}

@keyframes aws-overlay-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.aws-closed-modal {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.22);
    padding: 40px 36px 32px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    animation: aws-modal-in 0.25s ease;
}

@keyframes aws-modal-in {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.aws-closed-icon {
    font-size: 2.8rem;
    line-height: 1;
    margin-bottom: 14px;
}

.aws-closed-title {
    margin: 0 0 14px;
    font-size: 1.35rem;
    font-weight: 700;
    color: #b42318;
    letter-spacing: 0.02em;
}

.aws-closed-body {
    margin: 0 0 10px;
    font-size: 0.95rem;
    color: #444;
    line-height: 1.75;
}

.aws-closed-updated {
    margin: 0 0 24px;
    font-size: 0.78rem;
    color: #999;
}

.aws-closed-btn {
    display: inline-block;
    padding: 11px 40px;
    border: none;
    border-radius: 8px;
    background: #b42318;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
}

.aws-closed-btn:hover {
    background: #8f1b13;
}

.aws-closed-detail-link {
    display: block;
    margin: 0 0 14px;
    color: #b42318;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.aws-closed-detail-link:hover {
    color: #8f1b13;
}

@media (max-width: 480px) {
    .aws-closed-modal {
        padding: 32px 24px 28px;
    }
    .aws-closed-title {
        font-size: 1.15rem;
    }
}

/* ── 受付終了ポップアップ（午前／午後共用） ───────────────── */

.aws-ended-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: aws-overlay-in 0.2s ease;
}

.aws-ended-modal {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.22);
    padding: 40px 36px 32px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    animation: aws-modal-in 0.25s ease;
}

.aws-ended-icon {
    font-size: 2.8rem;
    line-height: 1;
    margin-bottom: 14px;
}

.aws-ended-title {
    margin: 0 0 14px;
    font-size: 1.35rem;
    font-weight: 700;
    color: #92400e;
    letter-spacing: 0.02em;
}

.aws-ended-body {
    margin: 0 0 10px;
    font-size: 0.95rem;
    color: #444;
    line-height: 1.75;
}

.aws-ended-updated {
    margin: 0 0 24px;
    font-size: 0.78rem;
    color: #999;
}

.aws-ended-btn {
    display: inline-block;
    padding: 11px 40px;
    border: none;
    border-radius: 8px;
    background: #d97706;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
}

.aws-ended-btn:hover {
    background: #b45309;
}

@media (max-width: 480px) {
    .aws-ended-modal {
        padding: 32px 24px 28px;
    }
    .aws-ended-title {
        font-size: 1.15rem;
    }
}

/* ── 外来受付終了 固定バー ────────────────────────────────── */

.aws-bar--ended {
    border-top-color: #b42318;
    background-color: #fff5f5;
}

.aws-bar--ended .aws-bar-label {
    color: #b42318;
}

/* ── 臨時休診 固定バー ────────────────────────────────────── */

.aws-bar--kyushin {
    border-top-color: #b42318;
    background-color: #fff5f5;
}

.aws-bar--kyushin .aws-bar-label {
    color: #b42318;
}
