@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal {
    display: none; 
    position: fixed;
    z-index: 2000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(2px);
}

/* モーダル位置調整 */
.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* モーダル本体 */
.modal-content {
    background: var(--white-color);
    width: 40%;
    padding: 2% 3%;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
    animation: modalFadeIn 0.25s ease;
    position: relative;
}

/* タイトル */
.modal-content h2 {
    margin: 0 0 16px 0;
    font-size: 20px;
    color: var(--black-color);
    border-bottom: 2px solid var(--main-color);
    padding-bottom: 8px;
}

/* ラベル */
.modal-content label {
    color: var(--darkgray-color);
    display: block;
    font-weight: 500;
    margin-top: 14px;
    font-size: 14px;
}

/* 入力欄 */
.modal-content input[type="text"],
.modal-content input[type="number"],
.modal-content input[type="email"],
.modal-content input[type="password"],
.modal-content select {
    width: 100%;
    padding: 10px;
    margin-top: 6px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: #fafafa;
    font-size: 14px;
    transition: border-color 0.2s;
}

/* 削除モーダル限定 */
.delete-message {
    text-align: center;
}

.modal-content.delete h2 {
    text-align: center;
    font-size: 20px;
    color: var(--black-color);
    border-bottom: 2px solid var(--main-color);
    padding-bottom: 8px;
}


/* ボタン共通 */
.modal-btn {
    margin-top: 8%;
    width: 30%;
    padding: 12px;
    color: var(--white-color);
    font-weight: bold;
    font-size: 15px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-flex{
    justify-content: center;
    display: flex;
    gap: 1rem;
}

/* 追加ボタン */
.modal-btn.add {
    background: var(--main-color);
}

.modal-btn.add:hover {
    background: var(--main-hover-color);
}

/* キャンセルボタン */
.modal-btn.cancel {
    background: var(--gray-color);
}

.modal-btn.cancel:hover {
    background: var(--gray-hover-color);
}

/* 保存ボタン */
.modal-btn.submit {
    background: var(--accent-color);
}
.modal-btn.submit:hover {
    background: var(--accent-hover-color);
}

/* 削除ボタン*/
.modal-btn.delete {
    background: var(--delete-color);
}

.modal-btn.delete:hover {
    background: var(--delete-hover-color);
}