﻿/* オーバーレイ：画面全体を覆う透明な背景 */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

/* ダイアログ：中央に表示、中身に合わせてサイズ調整 */
.dialog {
    background-color: #f8f8f8;
    color: #222;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-width: 900px;
    min-width: 300px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 0;
}

/* ダイアログヘッダー */
.dialog-header {
    padding: 16px 24px;
}

/* ダイアログコンテンツ */
.dialog-content {
    padding: 16px 24px;
}

/* 2カラムレイアウト */
.dialog-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

.dialog-left,
.dialog-right {
    min-width: 0; /* グリッドアイテムのオーバーフロー防止 */
}

/* セクション */
.dialog-section {
    margin-bottom: 16px;
}

    .dialog-section:last-child {
        margin-bottom: 0;
    }

    .dialog-section h3 {
        margin: 0 0 16px 0;
    }

    /* フォームグループ */
    .dialog-section .form-group {
        margin-bottom: 8px;
    }

        .dialog-section .form-group:last-child {
            margin-bottom: 0;
        }

        .dialog-section .form-group label {
            display: block;
            margin-bottom: 8px;
        }

        .dialog-section .form-group input[type="text"],
        .dialog-section .form-group input[type="number"],
        .dialog-section .form-group textarea,
        .dialog-section .form-group select {
            width: 100%;
            padding: 8px 12px;
            border-radius: 4px;
            box-sizing: border-box;
        }

    /* チェックボックスグループ */
    .dialog-section label.checkbox-label {
        display: flex;
        align-items: end;
        cursor: pointer;
    }

        .dialog-section label.checkbox-label input[type="checkbox"] {
            margin-right: 8px;
            cursor: pointer;
        }

    /* ボタングループ */
    .dialog-section .button-group {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
    }

        .dialog-section .button-group button {
            width: 48px;
            height: 48px;
            padding: 0;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            border-radius: 4px;
        }

    /* フィールドセット */
    .dialog-section fieldset {
        border: none;
        padding: 0;
        margin: 0 0 8px 0;
    }

        .dialog-section fieldset legend {
            margin-bottom: 8px;
            padding: 0;
        }

        .dialog-section fieldset label {
            display: flex;
            align-items: center;
            margin-bottom: 4px;
            cursor: pointer;
            font-weight: normal;
        }

            .dialog-section fieldset label:last-child {
                margin-bottom: 0;
            }

        .dialog-section fieldset input[type="radio"] {
            margin-right: 8px;
            cursor: pointer;
        }

    /* シングルライン */
    .dialog-section .single-line {
        display: flex;
        align-items: center;
        gap: 8px;
    }

        .dialog-section .single-line span {
            white-space: nowrap;
        }

/* ダイアログフッター */
.dialog-footer {
    padding: 16px 24px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

    .dialog-footer button {
        padding: 10px 24px;
        border: none;
        border-radius: 4px;
    }

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .dialog {
        max-width: 95%;
        margin: 20px;
    }

    .dialog-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .dialog-header {
        padding: 16px 20px;
    }

    .dialog-content {
        padding: 20px;
    }

    .dialog-footer {
        padding: 12px 20px;
        flex-direction: column;
    }

        .dialog-footer button {
            width: 100%;
        }
}
