/**
 * 共通UI部品のスタイル。processing.js / messagebox.js が生成する要素に対応する。
 *
 * 会員側・企業側の双方から読み込むため、全て ui_ 接頭辞で定義する。
 * 会員側 SPA は Vue が同名の #processing を別途出しているので、
 * こちらは #ui_processing として完全に分離してある。読み込み順への依存も無い。
 */

#ui_processing {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 11000;
}

#ui_processing .ui_processing_message {
    margin-top: 12px;
    color: #fff;
    font-size: 14px;
}

.ui_inline_processing {
    text-align: center;
    padding: 20px 0;
}

.ui_inline_processing img {
    /* スピナー SVG は暗いオーバーレイ前提の fill:#fff 固定。
       インライン版は白背景のダイアログ内に置くため反転させる */
    filter: invert(1) opacity(0.55);
}

.ui_inline_processing_message {
    margin-top: 8px;
    font-size: 13px;
}

/* メッセージボックスは三点ローディングより手前に出す。
   処理中にエラーを出す場面があり、背後に隠れると操作不能になるため */
.ui_messagebox {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    /* 長文でもボタンに到達できるようにする。fixed なのでページ側では追えない */
    overflow-y: auto;
    overscroll-behavior: contain;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 12000;
}

.ui_messagebox_panel {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    width: min(100%, 420px);
    max-height: calc(100vh - 40px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.ui_messagebox_message {
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.8;
    color: #333;
    word-break: break-word;
}

.ui_messagebox_buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.ui_messagebox_buttons button {
    padding: 8px 20px;
    border-radius: 6px;
    border: 1px solid #ccc;
    background: #f5f5f5;
    color: #333;
    font-size: 14px;
    cursor: pointer;
}

/* .ui_messagebox_buttons button より詳細度を上げないと打ち消される */
.ui_messagebox_buttons .ui_messagebox_ok {
    border-color: #e8a33d;
    background: #f0ad4e;
    color: #fff;
}

.ui_messagebox_buttons button:focus-visible {
    outline: 2px solid #1b6ac9;
    outline-offset: 2px;
}

@media screen and (max-width: 768px) {
    .ui_messagebox_panel {
        padding: 18px;
    }

    .ui_messagebox_buttons button {
        flex: 1;
    }
}

/* 画面遷移のローディング。
   現行の #loading（init.css）と同じ見た目にしてある。id を分けているのは、
   企業側に common/company/dialog/loading.php の #loading が既にあるため */
#ui_loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: #fff;
    z-index: 1001;
}
